Using AC/DC converter to power Arduino from Vin

I want to make a project where I use a servo and a rf rc to turn on/off a switch. I was going to use a battery but since the system will be open 7/24, battery would not last more than 2 days with the stall current of servo. So I want to power my arduino from a converter 5V 700ma from VIN on the arduino, since I want a compact system.

Converter is this:

I will use arduino nano.

If I am not wrong VIN max current is 1A, so in theory I see no problem. Is there problem?

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

This is an AC mains to 5Vdc power supply.

So you want to use a mains to 5Vdc power supply.

Yes you can, but you need to connect the 5V output to the 5V pin not the Vin pin.

The Vin pin needs 7V or more to supply the onboard 5V regulator.
As you are supplying regulated 5Vdc you will need to connect it to the 5V pin.

Thanks.. Tom.. :slight_smile:

I'm not sure if it's powerful enough because you want to use a servo. Servo's are power hungry!

And for supply voltages the current rating works the other way around. Aka, the supply need to be able to deliver what the load asks. So a voltage source with a higher current rating is just fine. Also, the 1A for Vin is not the rating what it draws, but what it maximally can deliver on the 5V line. But it's heavily overspeced. Yes the max rating of the regulator is 1A but that is with sufficient cooling. On an Arduino it has not. With 12V on Vin you can barely connect one or two leds.

TomGeorge:
Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

This is an AC mains to 5Vdc power supply.

So you want to use a mains to 5Vdc power supply.

Yes you can, but you need to connect the 5V output to the 5V pin not the Vin pin.

The Vin pin needs 7V or more to supply the onboard 5V regulator.
As you are supplying regulated 5Vdc you will need to connect it to the 5V pin.

Thanks.. Tom.. :slight_smile:

Sorry for the very poor quality :D. It is the only way I can do right now:

So what you are saying is, for convertor, I should use green path instead of red path. Am I right?

Not specific for converters, but if you want to power it with 5V, use the 5V. One catch, DON'T connect the usb to the computer when you feed it with 5V. Or if you do what that (and I don't blame you), take a USB cable, cut away the sleeve and cut the (probably) red power wire only.

But again, servo's are power hungry, think about 1A+. And even then you might want/need to use a decoupling diode for the Arduino power.

septillion:
Not specific for converters, but if you want to power it with 5V, use the 5V. One catch, DON'T connect the usb to the computer when you feed it with 5V. Or if you do what that (and I don't blame you), take a USB cable, cut away the sleeve and cut the (probably) red power wire only.

But again, servo's are power hungry, think about 1A+. And even then you might want/need to use a decoupling diode for the Arduino power.

I see, so I will use 5V pin to power up my arduino. About the servo. This servo's stall current is 0.4 Amp-ish. And I don't really need the full power of the servo really. Electric switches are not that tough :D. Thanks for the answer :).

compnaion:
This servo's stall current is 0.4 Amp-ish.

May I ask which lower power servo you use?

Also note, when you command the servo to go to an angle and it's far off, it will draw the stall current. Aka, hardest part is at startup when you don't know where it is.

septillion:
May I ask which lower power servo you use?

Also note, when you command the servo to go to an angle and it's far off, it will draw the stall current. Aka, hardest part is at startup when you don't know where it is.

I use HD 1800A, works from usb. Wait, so motor uses stall power when it is under pressure?

The HD 1800A is indeed a very tiny cute servo :slight_smile: So you're probably fine if you add a decent capacitor across the power supply and/or decouple the Arduino power.

More force = more current
Big position change = servo tries to move as fast as possible = more current

At start up you probably don't know where it is aka Murphy tells you it's far away. :smiley:

septillion:
The HD 1800A is indeed a very tiny cute servo :slight_smile: So you're probably fine if you add a decent capacitor across the power supply and/or decouple the Arduino power.

More force = more current
Big position change = servo tries to move as fast as possible = more current

At start up you probably don't know where it is aka Murphy tells you it's far away. :smiley:

:D. Sorry I don't know that much about electronics. Why should I use capacitor, to protect the system from sudden current changes? BTW now I noticed, doesn't the converter already have a capacitor?

compnaion:
Why should I use capacitor, to protect the system from sudden current changes?

Not to protect (against damage anyway) but to stabilize the voltage more in case of bursts of power which might drop the voltage and thus reset the Arduino.

compnaion:
BTW now I noticed, doesn't the converter already have a capacitor?

Yes, but that's not all that big :slight_smile:

septillion:
Not to protect (against damage anyway) but to stabilize the voltage more in case of bursts of power which might drop the voltage and thus reset the Arduino.
Yes, but that's not all that big :slight_smile:

I see.

septillion:
Not to protect (against damage anyway) but to stabilize the voltage more in case of bursts of power which might drop the voltage and thus reset the Arduino.
Yes, but that's not all that big :slight_smile:

I see. Here where I live, mains are 220VAC. What should I buy?

There are not that many countries left with a nominal 220VAC. Sure it's not 230VAC? :wink:

But that cap should go on the output of the converter aka on the 5VDC side. A 10V 1000uF should be fine. And for safety, use a old (but preferably from a good brand) USB charger. Saves the hassle and is safe :slight_smile:

septillion:
There are not that many countries left with a nominal 220VAC. Sure it's not 230VAC? :wink:

But that cap should go on the output of the converter aka on the 5VDC side. A 10V 1000uF should be fine. And for safety, use a old (but preferably from a good brand) USB charger. Saves the hassle and is safe :slight_smile:

Yes, I am sure of it. Everytime I think it is done, you add something new :D. And I don't want to bother you anymore, you have been very helpful, honestly. So, last question, at least I hope. Where will I use an usb charger? I mean once I program the arduino, usb will not be used ever again as long as, something goes wrong and I need to program the arduino again.

May I ask where you live?

Two things:

  1. You can use the USB of the Arduino to just power it (for example from a charger or power bank). You do the same when you charge your phone :wink: And a good charger is a easy and safe long term solution.
  2. You don't need to use the USB on the Arduino when you use a charger. You can cut a USB cable and solder the power just to the 5V and the GND pin. That way the USB is still free. But connecting it to a PC while also supplied with 5V from another source you feed 5V back to the PC. Most PC's don't like that. So if you want to connect it to the PC while connected to the charger (for example during debugging or changing the code later) you can use a USB cable with the (red) 5V cable cut. Alternatively you can cut the trace on the Arduino for the 5V from USB (but that's kind of a permanent solution) or not connect the USB while it's power from another source. BUT, that's pretty easy to forget :wink:

septillion:
May I ask where you live?

Two things:

  1. You can use the USB of the Arduino to just power it (for example from a charger or power bank). You do the same when you charge your phone :wink: And a good charger is a easy and safe long term solution.
  2. You don't need to use the USB on the Arduino when you use a charger. You can cut a USB cable and solder the power just to the 5V and the GND pin. That way the USB is still free. But connecting it to a PC while also supplied with 5V from another source you feed 5V back to the PC. Most PC's don't like that. So if you want to connect it to the PC while connected to the charger (for example during debugging or changing the code later) you can use a USB cable with the (red) 5V cable cut. Alternatively you can cut the trace on the Arduino for the 5V from USB (but that's kind of a permanent solution) or not connect the USB while it's power from another source. BUT, that's pretty easy to forget :wink:

I'm from Turkey. Cutting an usb cable and connecting it to the converter seems really good idea. I would use a usb charger but, it would make the system a lot bigger than I desire. What I am planning to do is, I will take mains from under the electric switch and connect it to the converter. This way there won't be any cable to be seen in the environment (I will make a 3d printed case for the system). Thank you very much for all of your helps :).

Mm, Turkey is indeed one of the countries I'm not sure :smiley:

You can also cut the charger open and use the bare PCB. It's just that the module inside of a brand charger is known to be safe whereas for a China model you just don't know what you get.

septillion:
Mm, Turkey is indeed one of the countries I'm not sure :smiley:

You can also cut the charger open and use the bare PCB. It's just that the module inside of a brand charger is known to be safe whereas for a China model you just don't know what you get.

I see, but that might be risky for me, since I don't know how to handle it. I am planning to use this converter:
https://tr.aliexpress.com/item/50PCS-5V700mA-3-5W-isolated-switch-power-supply-module-AC-DC-buck-step-down-module-220V/32664572619.html?src=google&albslr=223754018&isdl=y&aff_short_key=UneMJZVf&source={ifdyn:dyn}{ifpla:pla}{ifdbm:DBM&albch=DID}&src=google&albch=shopping&acnt=494-037-6276&isdl=y&albcp=994029296&albag=50935160804&slnk=&trgt=304655778945&plac=&crea=tr32664572619&netw=g&device=c&mtctp=&aff_platform=google&gclid=Cj0KCQjw0PTXBRCGARIsAKNYfG3M_se-r8NGOvbLfey-U8lfUo_mBRKkVHOEa5MeU4UzfH3QnifGVtcaAnHwEALw_wcB&gclsrc=aw.ds

It will be much more easy for me to use this.

Don't know how to handle what?

They kind of look like what you linked but better quality. Power in goes to where the prongs where connected, power goes out of the USB connector of which you can get info. Probably has explaining silkscreen on it as well.

septillion:
Don't know how to handle what?

They kind of look like what you linked but better quality. Power in goes to where the prongs where connected, power goes out of the USB connector of which you can get info. Probably has explaining silkscreen on it as well.

Well then, you are right about quality, I will try to make one. Thank you for the advise :).