Author Topic: 24VAC to DC  (Read 7623 times)

0 Members and 1 Guest are viewing this topic.

Offline joeyjoejoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: ca
24VAC to DC
« on: January 19, 2020, 12:04:30 am »
I'd like to build a controller board for automating some HVAC. Unfortunately, I'm not able to find quite a few different components of the "easy route".

High level requirements:
- Open-source support (esphome, tasmota, etc) (Sonoff comes close)
- Powered by 24V AC
- Using reliable components (writes off a few AliExpress)

So, I think I'll build my own - a fun project no doubt! Low voltage and low loads (these are all control signals), but I'll need to design for reliability.

I'd like to use a transformer to go from 24VAC to something a lower for efficiency, but mainly isolation from the power supply which is shared by other components. I'll use a linear regular afterwards, so the output voltage would be dependent on the headroom needed - probably not much with an LDO, so to hit 3v3DC, I could probably head to 4-5VAC, rectify and filter.

I figured this would be an exercise in picking winding ratios on the transformer. But when I head to digikey's Power Transformer section, it's a bit more confusing then that. Mouser's search reveals a few more goodies (Wurth 750313441) but I'd rather know what I'm looking at first to pick something. Component cost is a bit of a factor as well.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 24VAC to DC
« Reply #1 on: January 19, 2020, 12:22:03 am »
Why do you need isolation?

Years ago I built a controller to select between my heat pump and gas furnace depending on outdoor temperature. I used a buck regulator made from one of the SimpleSwitcher ICs, I think LM2567. It runs cool and has been working for something like 14 years now. Bridge rectifier, filter, buck regulator, it goes from the 24VAC transformer in the furnace to 5VDC. It's not isolated but that didn't matter for what I was doing.
 

Offline joeyjoejoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: ca
Re: 24VAC to DC
« Reply #2 on: January 19, 2020, 12:25:01 am »
I figure, worst case, I build something that fails. I'll do the best to make sure it doesn't, but in the event it does, probably best not to take out other things.

I guess I could also just put a fuse inline as well to do as you suggest. But I'm wondering if an LM2567 would up the BOM costs or complexity significantly? I know I don't want to use those premade LM2567's, as I'm worried about reliability. Rather use genuine components.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: 24VAC to DC
« Reply #3 on: January 19, 2020, 01:09:09 am »
Guessing you don't need three friggin' amperes to run things, a little SOT23-6 part should do, for example.

Why isolate the input?  Why not isolate the output?  It's just a contact closure (relay or optoisolator), no?

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 24VAC to DC
« Reply #4 on: January 19, 2020, 01:38:44 am »
A genuine LM2567 costs a few dollars at most, these days you can get smaller parts but 14 years ago there were a lot fewer easy to use switching regulator ICs on the market and I think I got the part I used as a free sample. Since the existing equipment already uses 24V I'm not sure how you'd damage it, if I remember correctly, I used opto-isolators on the input from the thermostat, I don't recall exactly why I chose that approach but it has worked. BOM cost should be a non-issue unless you're mass producing something. Certainly a switching regulator is going to be much cheaper than a custom 60Hz power transformer.

This is one of those cases though where if you're not certain you know what you're doing, you probably shouldn't be doing it. You don't want your heat to get stuck running for a week solid while you're out of town or something when something malfunctions.
 

Offline joeyjoejoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: ca
Re: 24VAC to DC
« Reply #5 on: January 19, 2020, 03:52:07 am »
Guessing you don't need three friggin' amperes to run things, a little SOT23-6 part should do, for example.

Why isolate the input?  Why not isolate the output?  It's just a contact closure (relay or optoisolator), no?

Tim

Yup a relay. Unsure on optoisolators yet driving the relays since it's signalling, no real load, hopefully no real noise.

If I assume every other device on that circuit is designed well, then isolating input I can't affect it with my circuit. I'm switching those "good" devices with a relay. Need to read up on failure modes more, but for the time being the worst would be fan staying on.

If something bad happens without input isolation, I could take down other devices, which worst case might mean blowing the fuse on my furnace, which means no more heat.

I did find a Micrel lm2574 which is 40V->3v3 step down with 1 coil 1 diode and 2 caps. Pretty nice. I could just have a 1:1 isolation transformer if I can't figure that part out.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 24VAC to DC
« Reply #6 on: January 19, 2020, 04:19:47 am »
WHAAT? That's not cheap by any means.

A 20k LUT Chinese FPGA with 64Mb RAM costs a few bucks, and a 720MHz ARM9 Chinese SoC with 256Mb RAM also costs a few bucks.

For a single quantity from a retail supplier?  I mean how poor do you have to be before a few bucks for a part you need for a hobby project is expensive? An FPGA or an ARM9 isn't much use if the part you need is a voltage regulator.

Sure you can gamble on insanely cheap parts and modules direct from China, I've used them many times and a lot of that stuff is quite good but none of the LM2567 modules I've got have been genuine, they work ok but the operating frequency is wrong and they blow up if you try to draw the full rated current. If I'm building something critical that could burn the house down, cost me a fortune in wasted energy or damage expensive equipment if it fails, I'll splurge and buy a name brand part from Digikey, Mouser or other reputable supplier that is considerably less likely to send me a fake.
 

Offline AVGresponding

  • Super Contributor
  • ***
  • Posts: 4931
  • Country: england
  • Exploring Rabbit Holes Since The 1970s
Re: 24VAC to DC
« Reply #7 on: January 19, 2020, 10:05:12 am »
Why not just make a simple linear reg using a power resistor on the input to limit the volts drop on the reg?

That way if it somehow does fail sc, the current will be limited by the power resistor below damaging levels.

I'd still fuse the input anyway, that's just good practice.
nuqDaq yuch Dapol?
Addiction count: Agilent-AVO-BlackStar-Brymen-Chauvin Arnoux-Fluke-GenRad-Hameg-HP-Keithley-IsoTech-Mastech-Megger-Metrix-Micronta-Racal-RFL-Siglent-Solartron-Tektronix-Thurlby-Time Electronics-TTi-UniT
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 24VAC to DC
« Reply #8 on: January 19, 2020, 04:28:35 pm »
That was what I tried first, but I was getting well over 30VDC after rectifying and filtering and the regulator got scorching hot. A resistor would move some of that heat to it but doesn't get around making the heat. Buck regulators are common and cheap now and this is a perfect place to use one.

The LM2576 was only an example, it's the part I happened to use many years ago with success, one of the first easy to use monolithic buck regulators on the market. Also it comes in a big chunky novice/prototype friendly package. Lots of other parts out there now that are similarly easy to use.
 

Offline AVGresponding

  • Super Contributor
  • ***
  • Posts: 4931
  • Country: england
  • Exploring Rabbit Holes Since The 1970s
Re: 24VAC to DC
« Reply #9 on: January 19, 2020, 05:12:45 pm »
If you're getting 30VDC you're clearly using full wave rectification. Try half wave, that should give you a more manageable 17VDC or so.
nuqDaq yuch Dapol?
Addiction count: Agilent-AVO-BlackStar-Brymen-Chauvin Arnoux-Fluke-GenRad-Hameg-HP-Keithley-IsoTech-Mastech-Megger-Metrix-Micronta-Racal-RFL-Siglent-Solartron-Tektronix-Thurlby-Time Electronics-TTi-UniT
 

Offline AVGresponding

  • Super Contributor
  • ***
  • Posts: 4931
  • Country: england
  • Exploring Rabbit Holes Since The 1970s
Re: 24VAC to DC
« Reply #10 on: January 19, 2020, 05:34:12 pm »
If you have a point to make, please do so. Try to do it without personal insults, please.
nuqDaq yuch Dapol?
Addiction count: Agilent-AVO-BlackStar-Brymen-Chauvin Arnoux-Fluke-GenRad-Hameg-HP-Keithley-IsoTech-Mastech-Megger-Metrix-Micronta-Racal-RFL-Siglent-Solartron-Tektronix-Thurlby-Time Electronics-TTi-UniT
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
Re: 24VAC to DC
« Reply #11 on: January 19, 2020, 05:34:30 pm »
You could combine a basic 10-20 cents LDO (to bring voltage down to 18v..24v) or a zener diode then use a switching regulator for 3.3v

ex ap63301 : https://www.digikey.com/product-detail/en/diodes-incorporated/AP63301WU-7/31-AP63301WU-7CT-ND/10492238
32v max input , 0.8v min output, 500kHz switching, synchronous (no diode needed), small inductor... 50-60 cents and SOT-23-6 package

l78l24 is 17 cents if you buy 100 of them : https://www.digikey.com/product-detail/en/stmicroelectronics/L78L24CD-TR/497-7284-1-ND/1883403
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 24VAC to DC
« Reply #12 on: January 19, 2020, 05:43:24 pm »
The nature of the question suggests a novice, so I was suggesting parts available in prototype friendly through-hole packages. If I were designing something like this today I would have no trouble using a tiny surface mount part but a beginner who is still in the development phase is probably going to want something they can easily wire up on perfboard.

OP, if you can clarify whether this is a one-off hobby project, possibly mass produced, whether you intend to hack together a prototype or make a PCB that will reduce the irrelevant answers.

Either way, full wave rectifier and switching regulator is absolutely the way to go. You can very efficiently drop 30+V down to 3.3 or 5V with a simple and cheap circuit. Pretty much every commercial product does it this way, no sensible design uses a linear regulator for such a large delta.
 

Offline joeyjoejoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: ca
Re: 24VAC to DC
« Reply #13 on: January 19, 2020, 06:33:35 pm »
I plan on making a PCB for this and using SMT when possible.

It's a one off to start but I prefer to keep the BOM low (when possible) and have the option to produce/sell on Tindie if needed. All electronics sourced from DigiKey, wago blocks might be elsewhere since it's low current.

Here's what I came up with so far with a few notes
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 24VAC to DC
« Reply #14 on: January 19, 2020, 08:05:40 pm »
That looks good at a glance, although you should be able to eliminate one of the two capacitors between the rectifier and regulator. It's not hard to find low ESR electrolytics these days, or you could use something like a 1uF ceramic close to the regulator IC, refer to the datasheet to see if there are any specific requirements.

The capacitor can be calculated like this: https://electronicbase.net/smoothing-capacitor-calculator/

Admittedly I typically just choose a value based on intuition, likely ending up with a bit larger cap that is really required but that hasn't let me down yet. I'd probably slap in 330 or 470uF then scope it under load to see how much ripple there is and verify that the ripple isn't present on the output of the regulator.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
Re: 24VAC to DC
« Reply #15 on: January 19, 2020, 08:11:11 pm »
You have to go backwards, from the output voltage and current.

Let's say you want maximum 3.3v at 500mA, for safety go +10%, to 550mA . That's 3.3v x 550mA = 1815 mW
You look in the datasheet and try to determine how efficient that regulator will be converting ~30v to 3.3v at that current amount, with the inductor you choose (again specified in datasheet).
Let's say you determine the efficiency determined is 70% : that means 1815 mW were 70% of the total amount consumed by the regulator, so 100% is 100 * 1815 / 70 = 2592 mW  ... let's round it up to 2600 mW.

So if you assume your voltage will be between 24v and 30v... let's go with 24v, then your input current will be 2600 mW / 24 = 108.33 mA

=> the switching regulator needs 24v+ 108mA+ to output 3.3v 500mA with around 70% efficiency

Now, the switching regulator may pulls energy in bursts or whatever, so let's say you design the input for at least 150 mA
This means the input capacitor must be sized so that the voltage will not go lower than your desired voltage.

In your circuit you have a bridge rectifier rectifying 24v AC to DC ... so you'll get  peak voltage of Vdc peak = sqrt(2) x Vac - 2 x Vdiode.
For a generic bridge rectifier, you'd have Vdc peak = 1.414 x 24v - 2 x 0.8v = ~ 32v
Because you may have less than 110v / 230v on the mains, lowering the output on the secondary, assume a lower peak DC voltage, let's say your maximum will be 30v DC.
0.8v is a fairly good value for the voltage drop on an internal diode at around 0.1-0.2A ... for around 1-2A, you may want to choose around 1v

So you can use a formula to approximate capacitance required :  C (Farads) = Current / [ 2 x AC Frequency x (Vdc peak - Vdc min desired) ]

Let's say you're in US where AC frequency is 60Hz and you want minimum 24v and at least 150mA (0.15) and your peak voltage is 30v, not 32v (for big margins)

=> C = 0.15 A / ( 2 x 60 x (30-24)) =  0.15 / 120 x 6 = 0.00020833 Farads or around 208uF ... this means you could use next value up like 270uF or 330uF and you'll be safe.
You can go with much bigger values but that only means the voltage will be closer to 30-32v for longer periods of time.
Also, bigger capacities are not so good when you start the circuit cold... the empty capacitors act almost like a short sucking in energy, so for a short moment, there's very high current through the transformer, and that can cause the fuse to pop... that's why you often see time delay fuse before the transformer.

Anyway... you have 3.3v up to 550mA , determined about 110mA at 24-30v on input of regulator but used 150mA to determine capacitor, so let's continue to use that.
If you output 24v 150mA on the secondary, that's  3.6 watts (24x0.15).
If your input is 110v, then the primary should take  3.6w / 110 = 0.0327 A or 32 mA ... so in theory, a 50mA fuse would be plenty. But it would probably make more sense to use a 100mA time delay fuse.

You don't need 2 capacitors , if the switching regulator is close to that first capacitor. A single one is plenty.
It may help to have a ceramic 0.1uF right by the input pins of the regulator.

Also you may find cheaper to go with individual diodes for the bridge rectifier... you lose a bit of board space but not much.

Cheapest rectifiers on Digikey are something like 19 cents if you buy 25+, while single diodes are much cheaper.
But you can get much cheaper parts from lcsc.com or tme.eu  or other distributors that do less known manufacturers.

 
The following users thanked this post: joeyjoejoe

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3925
  • Country: de
Re: 24VAC to DC
« Reply #16 on: January 19, 2020, 08:29:29 pm »
If you have a point to make, please do so. Try to do it without personal insults, please.

Have a look at a half-wave rectified sine wave and what is its peak voltage (because that's what the filtering cap gets charged to). Then you maybe will understand that "smoking" comment.
 

Offline joeyjoejoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: ca
Re: 24VAC to DC
« Reply #17 on: January 19, 2020, 08:50:12 pm »
You have to go backwards, from the output voltage and current.


This is great! Thanks for walking through it.

For the time-delay fuse, something like this? https://www.digikey.ca/product-detail/en/bel-fuse-inc/RST-100-BULK/507-1166-ND/809310
« Last Edit: January 19, 2020, 08:57:47 pm by joeyjoejoe »
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3930
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: 24VAC to DC
« Reply #18 on: January 19, 2020, 08:55:58 pm »
If you have a point to make, please do so. Try to do it without personal insults, please.

Point is, that with half-wave rectification of 24V, you still get a the same 33V peak voltage.
 

Offline AVGresponding

  • Super Contributor
  • ***
  • Posts: 4931
  • Country: england
  • Exploring Rabbit Holes Since The 1970s
Re: 24VAC to DC
« Reply #19 on: January 19, 2020, 09:53:41 pm »
With 0 capacitance, and 0 load, yes.

Is that likely? No.
nuqDaq yuch Dapol?
Addiction count: Agilent-AVO-BlackStar-Brymen-Chauvin Arnoux-Fluke-GenRad-Hameg-HP-Keithley-IsoTech-Mastech-Megger-Metrix-Micronta-Racal-RFL-Siglent-Solartron-Tektronix-Thurlby-Time Electronics-TTi-UniT
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3930
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: 24VAC to DC
« Reply #20 on: January 19, 2020, 09:57:07 pm »
Does not depend on capacitance.

halfwave or fullwave, peak voltage is the same. Regardless if there is some or none capacitance.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
Re: 24VAC to DC
« Reply #21 on: January 19, 2020, 11:13:09 pm »

For the time-delay fuse, something like this? https://www.digikey.ca/product-detail/en/bel-fuse-inc/RST-100-BULK/507-1166-ND/809310

If you want to be more user friendly, consider fuse holders

See what sizes are most common and have the most different values in stock.
For example
* 5mm / 5.1mm / 5.2mm  x 20mm and
* 6.35mm x 22mm / 25 mm/25.4mm (0.25" x 0.875"..1" - same distance between 2 holders can be used for all three sizes, the holders are wide enough to accept 3mm of play)
seem to be plentiful and easy to buy in local shops by someone.

There's also 6.3 x 32mm (0.25" x 1.26") that's very common... and the 6.3x25 fits within the footprint of one of these ... so you can make footprints for 3 holders on circuit board but populate only 2, depending on which fuse you end up using.

example of 5mm x 20mm fuse holder (2 of these needed per board) : https://www.digikey.ca/product-detail/en/bel-fuse-inc/FC-211-22/507-1415-ND/622587

example of fuses

~530 results: 5mm or 5.1mm (metal is flexible enough to accept either) : https://www.digikey.ca/products/en/circuit-protection/fuses/139?FV=46%7C13837%2C46%7C14314%2C-8%7C139&quantity=10&ColumnSort=2088&page=1&pageSize=25

~3080 results (919 in stock) : 5.2mm x  20 mm fuses (should fit in 5mm fuse holders just fine) : https://www.digikey.ca/products/en/circuit-protection/fuses/139?k=&pkeyword=&sv=0&pv46=14397&sf=1&FV=-8%7C139&quantity=10&ColumnSort=2088&page=1&pageSize=25


6.3 / 6.35 mm fuse holder example: https://www.digikey.ca/product-detail/en/bel-fuse-inc/FC-102-22/507-1702-ND/622585

6.3 x 22-25mm fuses: https://www.digikey.ca/short/z71rr8

With bigger currents, you can make footprints on board for 6.3/6.35 x 22-25mm and an extra footprint for 6.3 x 32mm distance, so basically 3 holders but only solder 2 holders. If you happen to be "out of stock" of 6.3 x 25 you could solder holder on 6.3x32 footprint and use 6.3 x 32 fuse.

The fuse you chose may work just fine and it has the benefit of being tight package (4.35mm x 8mm) but there's no visual indication if the fuse is blown (user may not have a multimeter) while with a glass fuse user may see the wire blown ... also, user may not buy that fuse on amazon or local store instead you may force him to buy it from you or digikey or other distributor and he may be forced to pay a few dollars in shipping.
In contrast, 5x20mm fuses are easily available on amazon for example : https://www.amazon.com/s?k=fuse+5+x+20+mm&ref=nb_sb_noss_2

The bigger footprint would also allow you to put a sticker (or print on pcb) with current and speed ex "0.1A T / Slow"
(slow blow is time delay more or less)

« Last Edit: January 19, 2020, 11:25:30 pm by mariush »
 
The following users thanked this post: joeyjoejoe

Offline joeyjoejoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: ca
Re: 24VAC to DC
« Reply #22 on: January 19, 2020, 11:19:29 pm »
 :) Good points. I am so used to designing size-constrained boards - no need to for this one. Fuse holders can be something easily sourced from China as well if needed!
 

Offline joeyjoejoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 285
  • Country: ca
Re: 24VAC to DC
« Reply #23 on: January 20, 2020, 02:48:13 am »
Here's the relay driver I came up with.



These are dual mosfets (3v3 logic, 200mA continous) so I can get two to drive four relays. Relays are ~50mA. The pulldown is so we have a defined state in case anything happens to the MCU.
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: ca
Re: 24VAC to DC
« Reply #24 on: January 22, 2020, 11:04:30 pm »
Presuming K1_EN is a 3.3v output from a uC, watch out:  that MOSFET has a Vgs(th) of up to 3.1volts.  The threshold means that's when it just starts to turn on.  Note that Rds(ON) is specified only down to a Vgs of 4.5 volts (3.3 ohms).  Check out the pg 3 top left graph with drain current vs Vgs.  Pretty marginal at 50mA eh?  Especially if it gets cold?  And what exactly is the voltage on K1_EN when loaded down with a LED there anyway? 
I'm pretty sure you can get a better part for less money.  Sorting by quantity in stock is a quick way of turning up the good ones.  ;)

The 10K resistor is presumably a pull down to keep the MOSFET switched off while K1_EN is booting up?  Maybe LED1 is enough depending on it's colour and the Vgs of the MOSFET you select. 
 
The following users thanked this post: joeyjoejoe


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf