My project is an Arduino Mini, An Ultrasonic Motion Sensor, a small servo and a DIY DFPlayer with 3.5 mm jack. The wiring diagram is outlined below as is the code but every time I power it up I get the same error code:
21:02:53.464 -> Initializing DFPlayer...
21:02:55.666 -> Unable to begin DFPlayer Mini.
I think you mean distance sensor, perhaps HC-SR04?
You should never attempt to power a motor or servo from the Arduino 5V pin. That will cause the Arduino to malfunction, and can even damage it permanently.
Use a separate power supply (4xAA battery pack is OK for a small servo), and be sure to connect the grounds.
Please show your schematic, at least a simple drawing. Or a table showing all your connections. Or a high resolution photo showing all connections. We need to eliminate a wiring error before looking further.
Thanks for all the responses. Yes I know I should power the servo from a separate power source but this is a small servo and it will be activated infrequently so I was just prototyping it with a single power source at the moment. Ill use a separate source in the final project
I tried to make a schematic of the wiring but I only have access to Tinkercad and the don't have an MP3 player in the parts choices. I took some pictures. Obviously harder to see the wiring this way so I apologize but if this help and thanks in advance for taking a look.
But your image shows some other board. Perhaps Nano?
There is likely diode between USB-supply and 5V pin and it might not be rated for currents that motor/speaker can draw.
Draw the wiring by hand of the ACTUAL connections, then take a picture of the diagram and post it.
But the first step is to reduce the number of components until you have the smallest set that produces the problem. Ideally that will be one! Now draw the diagram etc and post all the code in code tags and error log if any.
Thanks. Yeah, I noticed that an maybe thats the problem. I had to go out of town but when I get back tomorrow I am going to work on that. Thanks for the input.