Arduino Nano ATmega328P - power supply issues

I have a board set up to hold the ATmega328P chip and it is connected to a Hobby King servo. This set up has worked fine until today - I have attached an image of the set up which show the connections. Note this is the set up to control a number of signals, my test rig only has one servo connected on pin 3.

If the board is simply connected to my computer via the USB port I can program it and it operates quite normally and as expected. However, used stand alone with an external 12v power supply operating the switch results in the servo trying to turn full circle (which it cannot do) and jamming against the internal stop. Reverting to the power supply via the computer all is fine and the servo behave as expected.

I’d appreciate some input here please

David

CB_Signals_Arduino.jpg
OK, a little hint here.

Do not - ever - attempt to use the "Vin" or "barrel jack" connector on an Arduino UNO, Nano, Pro Mini, Leonardo, Pro Micro or that adapter board when using any other connected devices.

Yes, under some circumstances it may function and the unhelpful tutorials suggest you can, but the on-board regulator has no significant heatsink and without a heatsink, will shut down. Hopefully only temporarily.

You need to provide a (regulated) 5 V power supply. A "phone charger" with a USB output connector is generally a suitable and inexpensive choice at least for small projects.


Not sure what that "rectifier" business in that diagram is doing to provide 5 V! It certainly had better not be 12 V. :astonished:

Thanks for the reply - but I am mightily confused now! That diagram has been posted on here before when I was having some programming problems and no-one has commented on the 12v input. However, I believe you and will make the changes. The "rectifier" is a small circuit board (don't ask what as I have no clue - it was given to me) that does provide a steady 5vdc.

If I am reading your comment correctly, I need to power the Atmega328P direct with 5vdc via the USB port on the board, not the 5vdc connection on the red adapter board. Or can I connect my 5vdc power supply to the red adapter board where it indicates "use a local 5vdc"? That would be easier for me as I have limited capacity in the models wiring to add any more circuits.

Thanks again for the help, much appreciated

David

rynd2it:
Thanks for the reply - but I am mightily confused now!

Such is life! :grinning:

rynd2it:
That diagram has been posted on here before when I was having some programming problems and no-one has commented on the 12v input.

No doubt because the context of the problem was different and they were looking at the other connections and the code.

rynd2it:
The "rectifier" is a small circuit board (don't ask what as I have no clue - it was given to me) that does provide a steady 5vdc.

Presumably a bridge rectifier/ reservoir capacitor/ regulator module. You will have to be careful - it may be capable of a single servo, but not necessarily more.

rynd2it:
If I am reading your comment correctly, I need to power the Atmega328P direct with 5vdc via the USB port on the board, not the 5vdc connection on the red adapter board.

Well, no, that is limited by the capability of the rectifier on the Nano which feeds power from the USB port to the 5 V pin if you are connecting the other things (servos) to the 5 V pin. And it is indeed, inconvenient

rynd2it:
Or can I connect my 5vdc power supply to the red adapter board where it indicates "use a local 5vdc"? That would be easier for me as I have limited capacity in the models wiring to add any more circuits.

That is indeed the preferred way of supplying 5 V to the board, it is the "5V" pin on the Nano. I got out a board to check - the blue one actually, but while less colourful than the one in the diagram, it is the same. :grinning:

There is a caution that it may not be a good idea to connect 5 V to the "5V" pin while the USB is connected to a PC - especially a laptop - for uploading code or using the serial monitor.

Thank you Paul, that explains it clearly and solves my wiring problems.
Only one servo would ever be used at a time, they are railway signals so would be activated in a sequence.

Once again, many thanks

David

rynd2it:
Only one servo would ever be used at a time, they are railway signals so would be activated in a sequence.

Whoah! Only one servo may actuate at once, but the servos have a substantial "standing" current, and if they hit a stop, they draw the full stall current. :astonished: This is always a potential problem with servos.

In general if you use servos, you need to make sure that they determine where they stop their movement, rather than hitting any (end) stop. :grinning: Stepper motors are even trickier - they use slightly less current when they move, but standing still, use maximum current irrespective of whether they are loaded or not, so end-stops work just fine.

Understood, the servos should never hit the stop, they are programmed to turn about 30 degrees from 070 to around 105 and then back. I can't find a spec of the servo to determine its standing current - they are Hobby King 15178 but there is no data on the website.

When I next go down to the club I'll look in detail at the 5v regulator for it's maximum current load and also see if I can determine the 'stall' load on the servo.

Thanks

David

Hi again,

I replaced all the 12v wiring with 5vdc direct into the Funduino board as discussed above. I now seem to have a new problem, when the 5vdc power is switched on the servos all give an initial movement away from their last position and in the "wrong" direction. This regardless of whether the Arduino chip board is actually plugged in or not and happens even if the 5vdc is supplied via the USB or direct to the Funduino.

I have a single servos test board which also behaves this way. This is a problem as if the signals were actually connected (mechanically) to the servos they would be destroyed.

Why could this be happening and is there a way to prevent it?

Thanks in advance

David

Paul__B:
CB_Signals_Arduino.jpg
OK, a little hint here.

Do not - ever - attempt to use the "Vin" or "barrel jack" connector on an Arduino UNO, Nano, Pro Mini, Leonardo, Pro Micro or that adapter board when using any other connected devices.

Yes, under some circumstances it may function and the unhelpful tutorials suggest you can, but the on-board regulator has no significant heatsink and without a heatsink, will shut down. Hopefully only temporarily.

You need to provide a (regulated) 5 V power supply. A "phone charger" with a USB output connector is generally a suitable and inexpensive choice at least for small projects.


Not sure what that "rectifier" business in that diagram is doing to provide 5 V! It certainly had better not be 12 V. :astonished:

Power supplying for Arduino is a problem. what is about the case which Arduino jack is used only for supplying the board and no more current but about 30-40 mA will get from it? The idea of using an adaptor for motor and another for board isn't good. Another solution is DC-DC reducers. you can take 5 v regulated (I heard it not tested) from it and power the board from Vin. In both methods, your other power consumers will feed by DC-DC reducer. I don't know which is better.

I not sure I even understood what you are saying (my knowledge of electronics is limited) however I have almost accidentally discovered what I believe is the problem and solution.

When this set up was first designed (not by me) I was advised to put a 10k resistor across the signal and 5vdc wires to the servo. I now recall that this was to prevent any power-up issues. Turns out that the resistor on my test rig had come loose; I reconnected it more securely and the power-up kick is gone. Just to make absolutely sure I removed it again and the kick came back. QED.

I now need to check all the other servo connectors on the layout boards and make sure the resistors are fixed more permanently

Thanks

David

UPDATE - but still have an issue

I have solved the major servo movement on power up, for some reason the fact that two boards were being powered by one 5v power supply somehow connect them. I discovered this accidentally when I isolated all three baseboards and the problem went away. I have now provided a third 5v power supply and that issue is gone.

BUT, on one of my Arduino boards the first three servos are constantly cycling as if the the operating switch were being moved - it isn't. It's only the first three servos, the other four are not affected.

I can find no spurious signals going to the board and disconnecting the operating switch wire has no effect on the problem. I have used a new chip and reprogrammed it. I have reset the board and carefully checked all my wiring.

I am at a loss to understand this and would appreciate any help you guys can offer. All the details of the set up and the programming code are earlier in this thread.

Thanks is advance