Check the charging cable connection.
see to it that the connector is fully seated and that it doesn’t wobble around.
If the micro USB connector feels loose or falls out, then you probably have a worn out cable.

Jeremy Laukkonen
Try a different USB cable.
It’s important to use a cable that is both capable of providing power and transmitting data.
Plug your USB cable into something other than your PS4.
In some cases, a PS4 controller will have difficulty charging from the PS4 USB ports.
Inspect and clean the charging port on your controller.
In other cases, dirty connections just prevent power from transfering.
Reset your PS4 controller.
Your controller may have a firmware issue that’s preventing it from charging.
Power cycle your PS4.
If the controller still doesn’t charge, then power cycling the console may help.
This will only help your PS4 charge your controller.
If you’ve already tried a different charger without any success, this won’t help.
Replace the PS4 controller charging port.
Replace the PS4 controller battery.
When all else fails, there are only two options.
Either the battery is bad, or the controller itself has broken.
Here’s a quick look at the issues you might be dealing with: