Powering an Arduino and system with 24VAC

Hey guys/gals,

I'll just throw this out as a disclaimer... I'm not a electrical engineer by any stretch of the imagination... I know just enough to be dangerous. :slight_smile: ...but I'm learning!

I'm working on a little project over the holidays and have run into a small issue. I know this has been covered before and there are a few options, but this is a bit different from the other post. I'm working on a actuator that utilizes a stepper motor that I'm driving with a Arduino Nano. The stepper controller (TB6600) works fine when I'm powering the Nano from the USB port, but when I apply power from my power circuit the motor just clicks a bit.

I'm using the 24VAC to power the stepper controller and therefore the stepper itself though a full bridge rectifier with a 100uF cap on the output. This seems to work fine.

I'm also using the 24VAC to make 5VDC... Half wave rectification (diode) to the input side of a 7805, input side also has a 10uF cap, with a 100uF cap on the output... puts out a stable 4.96VDC with everything running. Seems kosher.

I'm using one side of the 24VAC supply as a common ground for the 5V portion. (The neg side of the full wave rectified is not connected to this.)

Now, again, I can ground the controller to my power supply common ground and power the nano from the USB port, and everything works as intended, but the second I power the Nano from the 7805 circuit, the stepper motor just clicks.

Anyone with better electronics mojo than me have any thoughts? Thanks in advance!

Chad

I think you need to sketch up a schematic. It can be hand drawn. Without it we are only guessing about the details...... and you know the saying.... "the devil is in the details"

John

I see a few questionable details, but without seeing a schematic, as JonRob said, we would be just guessing. We don't like to guess.

Gotcha! Schematic should be attached…

Doh. The pic got attached twice... they are the same. Sorry about that.

All 4 diodes in the bridge rectifier are draw reversed
in polarity. You can not connect the 7805 that way
because when its ground is connected to the system
ground, a diode is shorted out.
Herb

Generally what @herbschwarz said.

In addition:

Unless your stepper driver - Pulse is ground there is not common reference (aka ground) between the two devices).

I don't think the 10µf at the 7805 and 100µf at the stepper input are adequate.

For instance, the 10µF cap will drops in voltage ~ 2000V/second with a 20 ma load.
The time between the 60 Hz peaks is 16ms (or 0.016 sec)

2000 * 0.016 = 33 volts. So the 7805 is dropping to a low voltage every 16 ms. This would cause the nano to reset.

I don't like using a 7805 like this. I can't imagine a clean +5V on the output from a half-wave input.

Consider this PSU. The specs say it can take up to 40V on the input. I use a couple of them in my Xmas displays to provide 5V for two Wemos D1 Mini boards.

After reviewing my controls I'm realizing that I had a bit of tunnel vision in thinking that I had to power the system with 24VAC... I can get there with a 24VDC supply. This will alleviate my conversion issues, my 7805 will work without resetting my Nano and everyone will have a common ground. Issue resolved.

A big thank you to all who responded. I very much appreciate your input and helpful advice.

...back to lurking and learning...

Chad

If you look at the 7805 datasheet, it should have ceramic or film "bypass" capacitors on the input & outputs and they should be mounted physically-close to the regulator. That's in addition to any electrolytic capacitors. Electrolytic capacitors don't "act like" capacitors at high frequencies and the ceramic/film capacitors help to stabilize the circuit to prevent high-frequency oscillation/instability.

The power (and heat) dropped across a linear regulator is related to the current and the voltage dropped across it. Power (Watts) is calculated as Voltage X Current, so with a high voltage-in the regulator is using (wasting) more power than the 5V Arduino. And, although the 78xx regulators are rated up to 1 Amp, in the real world they are usually limited by power/heat so you rarely get 1A out of them. You are probably OK since you're just powering the Nano, but if your 7805 it too hot to touch, add a heatsink.


Next time you built a power supply -
It's OK to build your own power supply. Whenever I start a new electronics project I almost always start by building a power supply because I'm going to need one and I can't do much without it. (I do have a "little" bench supply that I built.)

But, if you're going to need more than abut 1A it might be better to buy a switching supply. Switching supplies are more efficient and at higher-currents more economical, but they are a little more difficult to build yourself. I bought a switching supply for my latest project (which is unfortunately on-hold for now).

In case you don't know this, a 24VAC transformer will give you about 33 VDC. The peak voltage of a sine wave is 1.4 times the RMS voltage, and the capacitors charge-up to the peak. You loose 1.4V across the full-wave bridge but with no load (or a light load, such as the motors not running) you'll get a little more voltage out of the transformer so you might get more than 33V (with no load) even allowing for the diode drop.

As a rule-of thumb, use a filter capacitor of 1000uF or more.

chuggins143:
After reviewing my controls I'm realizing that I had a bit of tunnel vision in thinking that I had to power the system with 24VAC... I can get there with a 24VDC supply.

Yes. I'm assuming the stepper driver requires 24VDc to do what you want.... is this true?

I see three ways to do what you need when using a 24vdc supply for the steppers.

  1. (my favorite) Buy a 5V wall wart, connect it's common to the common of the 24Vdc. Power the steppers with the 24V and the nano with the 5V.

  2. drop the 24 V down to 5 Volts using a DC/DC converter. will work well but DC/DC converters create electrical noise which I prefer not to create unless it is an absolute requirement.

  3. drop the 24V down to 12V with a linear regulator and power the nano with 12V. It would dissipate (24-12) *0.02 = 1/4 watt. Doable with a linear. However if you have a lot of other devices on the nano and they are drawing more power then this is not an option.

JohnRob:
Yes. I’m assuming the stepper driver requires 24VDc to do what you want… is this true?

Not necessarily. Check the maximum voltage of your stepper driver!
In fact it most likely will work fine at just 5V, but better at higher voltage, if it can handle 33V great as then you can use the rectified current of your 24AC supply directly. A 1,000µF cap would be a good start for decouping your stepper’s supply. As it’s basically a constant current driver I figure it’s quite tolerant to a somewhat unstable voltage, as is what you would have now.

  1. drop the 24 V down to 5 Volts using a DC/DC converter. will work well but DC/DC converters create electrical noise which I prefer not to create unless it is an absolute requirement.

This is not a HiFi audio application, it won’t be an issue for the processor as such ripple is usually less than 100 mV. All in all a good, efficient solution here.

The 7805 is a bad idea… even at just 100 mA output it’d have to dissipate almost 3W: (33 - 5V) * 100 mA = 2.8W, or an overall efficiency of just 15%. A buck converter easily gets >80%, maybe even >90%.