Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Page 1 of 3 1 2 3 >
Topic Options
#355246 - 28/09/2012 21:01 24VAC to 5VDC ?
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Originally Posted By: mlord
The 1-amp rated Samsung AC charger supplied with my Galaxy Nexus has pins D- and D+ shorted.

The cheap china car charger I got from DX has proper resistor networks to signal 500mA max per port (2 USB ports). I just now hacked it, adding 200ohms across D- D+, to trick my phone into charging at (up to) 1amp from it, instead of trickle charging as it normally would.


On a semi-related topic..

I'm making my own internet-connected thermostat. Pretty simple stuff, except for how to power it.

Here in Canada (and the USA), thermostats get 24VAC from the heating system. So my puzzle is how best to convert that into regulated 5VDC or less, to power the micro-controller I'm using (atmega328p). No worries about lots of voltage/current for relay coils, as I'm using a solid-state relay (aka. an opto-isolated TRIAC circuit).

I googled the subject, and discoved lots of people with the exact same question, and the "best" answers are always the same: rectify the 24VAC with a diode bridge, filter it with a huge capacitor, and then feed it into a DC-DC converter circuit (a form of switching supply) to get whatever regulated DC voltage I want.

Seems like a lot of fuss though.

Then I looked at the teensy little 100-250VAC adapters that litter my work area. These all put out regulated 5VDC (+/-0.4V), in the form of a USB-A jack.

Mmm.. they're all just switching supplies internally, with some kind of voltage feedback to allow them to adapt to inputs of 100-250VAC, I wonder if they'll also adapt to lower inputs?

Tried three no-name "China chargers", and they all work just fine on the 32VAC (output) transformer at my work bench. Not quite as low as 24VAC, but that's all I have handy. The 9VDC switching adapter I have here also puts out 9VDC just fine when powered by only 32VAC. Encouraging.

Then I tried a Blackberry charger.. it outputs only 4VDC, with fluctuations. No good.

Tried the Samsung charger from my Galaxy Nexus kit: 0VDC output. Same thing with the ASUS charger for the Nexus 7 tablet: 0VDC.

Obviously everyone isn't using quite the same circuitry.
Any of you electronic types have any opinions or suggestions on this?

Right now, I'm planning to just go with one of the "China chargers", since they work. I'll have to retest against true 24VAC first though.. mmmm.. perhaps the doorbell transformer.. mm...

Top
#355247 - 28/09/2012 21:12 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Originally Posted By: mlord
Right now, I'm planning to just go with one of the "China chargers", since they work. I'll have to retest against true 24VAC first though.. mmmm.. perhaps the doorbell transformer.. mm...


Okay, I tried two of them on the 24VAC doorbell circuit: one still gave it's usual 5.3VDC, but the other drooped to a steady 4.0VDC. No Load yet.

I don't expect loading them to make much difference, but it could, I guess. My total load with everything running and the LCD backlight lit will likely be 150mA or less.

Top
#355255 - 29/09/2012 22:30 Re: 24VAC to 5VDC ? [Re: mlord]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
The issue is likely to be the transformer windings; taking one of those off-the-shelf PSUs and either reducing primary windings or increasing secondary windings would likely to do the job.

That said, rewinding transformers isn't a lot of fun or easy to do smile

A rectifier and high voltage buck is the most efficient way to do it.

Top
#355256 - 29/09/2012 23:33 Re: 24VAC to 5VDC ? [Re: altman]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Those supplies will still be rectifying and are probably flyback converters. I'm a little surprised they work that far down. Rewinding the transformer would be difficult since they are probably all encapsulated.

Edit: If you can get a China charger to work properly under load, then great.

As Hugo says, just rectify (half wave should be enough but a full bridge can small enough) and use a high efficiency switching buck convertor. Just need to watch for the input voltage rating since you'll have a fairly high output from the rectifier.


Edited by Shonky (29/09/2012 23:34)
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#355257 - 30/09/2012 00:57 Re: 24VAC to 5VDC ? [Re: Shonky]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Yeah, I've got some 40V bucks on order via eBay, but thinking these china chargers are even simpler.

For the buck -- just a diode in front, or also a big cap?

-ml

Top
#355258 - 30/09/2012 09:03 Re: 24VAC to 5VDC ? [Re: mlord]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
You'll definitely need some sort of filtering/smoothing particularly if only using a single diode to rectify. Even with a full wave it will drop to zero every half cycle:



So enough capacitance to ride through that drop every 16ms (assuming it's 60Hz). You can fairly accurately size it. Probably won't have to be that large since the peak voltage is much higher than what will be the minimum input voltage to the buck for your 5V.

So it's 24VAC *RMS*? And you need 150mA at 5V?
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#355259 - 30/09/2012 09:36 Re: 24VAC to 5VDC ? [Re: Shonky]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
OK. So really rough numbers.

750mW is what you need at the output. Assuming you get 75% efficiency from the buck so you need to put 1W into it. 1 Joule/sec or 0.016 Joules every 16ms.

Capacitor stores 0.5CV^2. Assuming 8V is the minimum input voltage to your regulator and the peak is 24V x 1.41 = ~34V.

Therefore absolute lowest cap size would be (assuming the worst case that the AC supply is instantly charging the cap only once a cycle and not actually powering):

0.016 = 0.5xCx34^2 - 0.5xCx8^2
C = ~30uF

But make it something like 100-220uF and you'll be fine but put it on a scope if you can. Best to keep the DC level fairly smooth if you can. Ripple isn't good for caps.

There are other rule of thumb formulas too that will give you the same sort of results. Things like C = load_current/(2*freq*ripple_voltage). That will give you 220uF for a 5V ish ripple.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#355261 - 30/09/2012 11:38 Re: 24VAC to 5VDC ? [Re: Shonky]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Good. I always assumed it would need a largish cap there, but was wondering some after the comments here about just adding a rectifier or bridge. smile

There should be no problem with going larger on that cap, so I'll use whatever I can find on hand -- likely 470uF/50V as I have lots of those.

It'll be a couple more weeks before the bits and pieces from China come trickling in, or perhaps longer since it's holiday time over there right now.

Thanks

Top
#355270 - 30/09/2012 23:30 Re: 24VAC to 5VDC ? [Re: mlord]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
That should be fine and more is better unless you go way way over board since the inrush current stresses the rectifier diode.

No good with the Chinese chargers?
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#355271 - 01/10/2012 00:51 Re: 24VAC to 5VDC ? [Re: Shonky]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Oh, one of the chargers is good, but I'm thinking of going all 3.3V instead of 5V. So I'd need an extra stage with the charger, making it about the same fuss as the bridge+cap+buck.

The buck board has adjustable output (multi-turn pot), so I can tune it nicely for exactly 3.3V output.

Still, the final choice will come once all of the pieces have arrived. The LCD I'm using wants 3.3V, the RTC is 3.3V, the temperature sensors don't care, and the ethernet adapter also wants 3.3V.

So I may as well just run the Atmega328p at 3.3V as well.

Cheers

Top
#355272 - 01/10/2012 00:52 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Or I suppose I could replace a resistor in the charger with a trim pot and try tuning it for 3.3V output.. might do that just for fun regardless. smile

Top
#355282 - 01/10/2012 14:15 Re: 24VAC to 5VDC ? [Re: mlord]
K447
old hand

Registered: 29/05/2002
Posts: 799
Loc: near Toronto, Ontario, Canada
The simplest way to power an off the shelf power adapter in this case is to connect another 120 to 24 VAC transformer 'backwards'.

Connect the 24 volt secondary of the transformer to your 24 volt AC source in the wall (at or near the thermostat location). The transformer primary will then provide full line voltage. Feed that 110-120VAC into your DC power adapter of choice.

You can wire the transformer 'output' to a standard AC wall outlet and then plug in your adapter. All this can be enclosed within your thermostat box, or tucked into the wall cavity behind.

Top
#355285 - 01/10/2012 19:14 Re: 24VAC to 5VDC ? [Re: K447]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Simpler than that would be to just run 120VAC to the thermostat.

But no need -- there's already 24VAC there, and as discussed above I've got a couple of 5VDC adapters that work just fine off the 24VAC. But they give me 5VDC, not the 3.3VDC I now think I'll need.

Cheers

Top
#355321 - 03/10/2012 16:19 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Originally Posted By: mlord
.. the final choice will come once all of the pieces have arrived. The LCD I'm using wants 3.3V, the RTC is 3.3V, the temperature sensors don't care, and the ethernet adapter also wants 3.3V.


Ugh. Actually, the RTC wants 5V, not 3.3V. So I'm likely to end up having to supply dual voltage on the board, starting with 5V, and using an LDO regulator on that to get 3.3V.

Or maybe find a 3.3V RTC to use instead of the 5V one.

Top
#355323 - 03/10/2012 16:45 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
DS1338 3V RTC module. Expensive ($12 vs. $2.80), but simpler.

Top
#356003 - 31/10/2012 11:31 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
In the end I've gone with a buck regulator found on eBay for $1.70. The chip on it is rated for up to 40V input, tolerating 45V absolute maximum. I tuned the module to give 5.00V output (needed for the relay coils), and further regulate that down to 3.3V (LDO tab regulator) to run the electronics.

This all works fine, but I'm very slightly concerned about something. The DC input produced from the "24VAC" supply ends up being about 38V after the filter cap. That's under 40V, but not by much at all.

To give a little more head room, I've inserted three diodes in series with the 38VDC, dropping it to about 36.8V (gotta double check that measurement). The current flow through it is typically less than 100mA, up to 225mA peak when all five relay coils are active.

The slightly nagging worry is that there's still not much margin there at the input to the buck regulator. It does appear to be of good quality -- 50V input cap, 35V output cap, etc.

Should I be concerned (much)?
I wonder if a 40V zener across the DC input might be useful?

Top
#356006 - 31/10/2012 12:33 Re: 24VAC to 5VDC ? [Re: mlord]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
24V RMS is going to be 34V peak (68V peak to peak). Really shouldn't be able to get any higher than 34V DC. Is the 24VAC really 24VAC?

Is this full wave rectified? How are you getting DC from the 24VAC? How "DC" is the DC?

Have you had a look at any waveforms on a scope? Pics?

Also remember that a zener will clamp and effectively short circuit the input at higher voltages so could end up dissipating quite a bit for long term high input voltage. If the regulator can truly withstand 40V I'd run with just that. There should be enough further headroom above that (and the 5% you have from the 2V gap from 38-40V). I'm not sure how consistent this 24VAC supply should be though.

Also diodes aren't always the greatest for voltage drops since they will vary a bit with current draw particularly with lower currents.

What (brand/part) is the buck regulator? I presume this is a pre built module of some description you are using.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#356008 - 31/10/2012 12:57 Re: 24VAC to 5VDC ? [Re: Shonky]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
The 24VAC is the "nominal" output from the furnace, probably running closer to 26VAC I suspect, but I haven't put a meter on it 28VAC.

The "24VAC" goes to a bridge rectifier salvaged from a computer PSU, and then past a 470uF capacitor to the buck. I've inserted the three extra diodes between the bridge rectifier and the 470uF capacitor.

The "24VAC" supply will fluctuate with line voltage. It should be pretty constant with the odd dip, but can have spikes just like the wall sockets do.

The buck regulator is a standard circuit from the LM2695S-ADJ datasheet. The datasheet says "45V absolute maximum; but only up to 40V for the operating range".

So we're under 40V, I'd just like a little more margin, or some protection against the odd spike -- thus the thought of perhaps a 40V zener.

Cheers


Attachments
buck.jpg




Edited by mlord (31/10/2012 13:23)

Top
#356010 - 31/10/2012 13:12 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Okay, I bypassed the safety shutoffs on the furnace and measured the "24VAC" there: 28VAC according to my (non-RMS) meter.

Edit: It was probably designed to output 24VAC minimum at 110VAC input, all at 60.000HZ. But here in Ottawa, the line voltage is usually between 120VAC and 125VAC -- currently showing 123VAC on my (non-RMS) meter.

Cheers


Edited by mlord (31/10/2012 13:17)

Top
#356011 - 31/10/2012 13:31 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Now I'm thinking there may be a better way do reduce the (effective) input voltage. Since it is AC to begin with, perhaps a TRIAC with appropriate bias could be used to chop it down in front of the bridge rectifier, getting things into a safer 10-12V range perhaps.

???

Though I suppose if I'm at all concerned, I should probably just remove the entire front-end and instead drop in one the USB chargers discussed earlier. It will take the 24-28VAC input and produce 5.1VDC regulated output with no worries, and about the same amount of space taken up inside the box.


Top
#356012 - 31/10/2012 13:38 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Or perhaps remove the bridge rectifier and replace it with a single diode, and maybe add more capacitance to the diode output. I don't know much about electronics, but I think that should give a lower (filtered) DC output. ?

Top
#356046 - 31/10/2012 23:16 Re: 24VAC to 5VDC ? [Re: mlord]
gbeer
carpal tunnel

Registered: 17/12/2000
Posts: 2665
Loc: Manteca, California
_________________________
Glenn

Top
#356049 - 01/11/2012 00:22 Re: 24VAC to 5VDC ? [Re: gbeer]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Half wave or a smaller cap will only increase the ripple on the rectified DC. A larger cap will decrease the ripple, but increase in the initial inrush current when switching on.

The peak voltage of 28VAC RMS = 39.5V peak minus the diode drop in the rectifier diode(s) will still exist either way.

As for the original zener idea, I would put something with some margin over what's normal. Something like 42-43V perhaps. The voltage regulator should be able to run with that. The zener should be thought of as a last resort protection really.

If your current consumption is reasonably constant, you could just use an appropriately rated resistor in series. The voltage drop is proportional to the current. This is not efficient though and the resistor will be just burning that power.

Some numbers:

Say we look for a 5V drop.
You mention 100mA-250mA (at 5V).
Assuming say 70% total efficiency on the buck regulator/rectifier means about 500mW-1.25W output or 700-1.8W input power.
At 40V that's ~20-45mA. 5V at 20mA is 250R. At 45mA it's ~100R.
Sooo.... let's put a 100R resistor in series.
At 20mA that's 2V drop and only 40mW dissipated in the resistor
At 45mA that's 4.5V drop and 200mW dissipated in the resistor

You need to consider your worst case power consumption since that will decide how much is dissipated in the resistor.


Edited by Shonky (01/11/2012 00:35)
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#356052 - 01/11/2012 01:09 Re: 24VAC to 5VDC ? [Re: Shonky]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Okay, non-issue. At the thermostat, with my new thermostat installed and connected, the rectified voltage measures 34.8VDC. That's with the three extra diodes inline to provide a small drop. Looks like they might not even have been necessary.

(previous AC measurements were with the original thermostat in place, not my new one).

So plenty of voltage headroom at the input to the buck. Peachy!
The photo shows it in place, sans cover. The white thing above it is the controller for the HRV air exchanger, which I hope to eliminate in favour of a couple of the spare yellow relays in the new thermostat below. That's the next project.

Except somehow I've managed to fry three (3!!) of my FTDI USB/serial breakout boards.. must have a wire crossed somewhere there. So I cannot actually program anything new until those get replaced -- ordered the raw chips and a supply of ChipQwik from Digikey so that I can just replace the blown chips and reuse the existing Sparkfun breakout boards afterward.


Attachments
stats.jpg



Top
#356054 - 01/11/2012 01:30 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Buck regulator near top left, 3.3V PSU under it, then the Atmega328P microcontroller, and the ULN2003A relay driver chip. The ethernet board connects via SPI, and enables an embedded webserver for status and configuration. The battery-backed Real-Time Clock is on I2C off to the right. Below/between them is the white DHT22 Temperature/Humidity sensor, which uses a proprietary 1-Wire 40-bit protocol. There are five yellow coloured relays, two of which are dedicated for the furnace and fan, the other three are for future expansion. The 3.3V serial port and ethernet share a single run of Cat5e via the special 4w/4w splitter block. The 3.3V LCD display connects via a single wire (tx) serial interface, and the four coloured push-button switches all share a single GPIO using a resistor ladder.

Dagnabbit! Forgot to wire in a reset switch. Which means I'll probably need one. smile


Attachments
stat-close.jpg

Description: Buck regulator at top left.



Top
#356056 - 01/11/2012 02:28 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
I have not connected my scope up to the power supply to check for ripple yet, but my multi-meter claims 1VAC is present at the input to the Buck (along with 34.8VDC). If that means what I think it means, then I've got about 3% ripple at that point.

Beyond the Buck, at the 5VDC and 3.3VDC points, no AC voltage is detected. Still gotta lug the scope out there and rig a stand for it so I can have a more graphical view of it all.

Top
#356057 - 01/11/2012 02:44 Re: 24VAC to 5VDC ? [Re: mlord]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Yes that's probably a fair assumption at least. Note that the ripple is not a sine wave now so if your meter is doing the "rectify/filter/measure DC" and working backwards to AC it could be a bit off but it shouldn't be off by heaps. Best to look at with a scope if you've got one. If you've got a fast min/max function (which you probably don't if it's not True RMS) it might even catch it.

If you wanted to get *real* fancy/geeky you could rig a voltage divider to an ADC input and sample it with your CPU smile. You don't have to sample it particularly fast even.

At 5VDC and 3.3VDC you definitely don't want and shouldn't have any ripple. Still good to check on a DSO though if you have the means. There will be some switching noise at least on the 5V but should be pretty well filtered by the LDO.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#356058 - 01/11/2012 02:48 Re: 24VAC to 5VDC ? [Re: Shonky]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
As for the reset, is there at least a watchdog you can use? That will probably cover you for most if not all things.

I presume there is something that ensure it comes out of reset nicely on power up built in?
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#356063 - 01/11/2012 03:50 Re: 24VAC to 5VDC ? [Re: mlord]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
Just have to say it's cool seeing this come together after seeing all the various parts earlier smile

Top
#356077 - 01/11/2012 15:19 Re: 24VAC to 5VDC ? [Re: Shonky]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Looks like the Atmega328p has a built-in watchdog, which can be configured to a max period of 8 seconds. That's good for my purposes. But I'll have to fuss about to see if the Arduino bootloader code properly deals with it or not -- there's a fair bit of online discussion about that.

I've also got another gizmo laying around that is yet to be installed in the thermostat case: an ultrasonic rangefinder. I'm going to use this as a motion/proximity sensor, to turn the LCD backlight off when there's nobody in front of the thermostat. This will reduce light pollution, and also cut the overall power consumption by half.

The rangefinder itself consumes about 10mA, so I may power it through a spare gate of the relay driver chip, allowing it to be completely powered down when not actively sampling.

There goes three of the remaining 4 GPIO pins. frown

But I'm not touching anything in there until my FTDI boards get repaired -- parts expected here on Friday.

Cheers

Top
#356083 - 02/11/2012 00:41 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Originally Posted By: mlord
... my multi-meter claims 1VAC is present at the input to the Buck (along with 34.8VDC). If that means what I think it means, then I've got about 3% ripple at that point.

My DSO claims 833mV of ripple, which works out to about 2.4%, at frequencies varying between 60Hz and 120Hz. The Buck switches at 150KHz, so I suppose the short bursts from it are confusing my easily befuddled DSO. smile

Cheers

Top
#356085 - 02/11/2012 06:13 Re: 24VAC to 5VDC ? [Re: mlord]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Your DSO is probably trying to look for a sine wave so perhaps that's where the 60/120Hz is coming from (rectified 60Hz really becomes a 120Hz repeating signal).

You can just view it yourself and measure the high low points. AC couple the input (which removes the DC) and zoom in the vertical axis to see the ripple. Do this on the 5V and 3.3V lines likewise if you want to check. At the end of the day they are the most important. I would expect to see something of the order of tens of mV on the 5V line but the 3V should be fairly smooth.

A couple of percent ripple should be OK. Main thing it will affect is the lifetime of that frontend filter cap.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#356093 - 02/11/2012 12:07 Re: 24VAC to 5VDC ? [Re: Shonky]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
The 5V and 3.3V lines didn't show any measurable ripple at all.. whatever there may have been was lost in the noise floor of the scope. I'm happy. Case closed on that one. smile

Top
#356112 - 05/11/2012 20:32 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Originally Posted By: mlord
.. somehow I've managed to fry three (3!!) of my FTDI USB/serial breakout boards.. must have a wire crossed somewhere there.

This has proven to be a rather sticky problem.
I sorted out a minor wiring error, replaced all of the FTDI SMD chips on the breakout boards, and.. over the weekend managed to fry all three of them AGAIN, and even fried one a third time after replacing the replaced chip again.

They work, sometimes, then die mysteriously. One thing they definitely don't like is sharing the ethernet cable with ethernet (2 pairs for serial, 2 for ethernet). Instant death doing that. The last one fried while operating on a dedicated run of cat5e not shared with anything.

So.. more FTDI replacement chips are on the way from digikey again .. the FedEx dude ought to be here around 11am Tuesday with them. And this time I'm putting a dedicated serial adapter inside the thermostat itself, and running the USB back to my PC over cat5 with a pair of DX.COM USB extenders.

That ought to put an end to frying the serial adapters.
Next up after that is taking over the HRV air-exchanger controls.

Top
#356113 - 05/11/2012 20:54 Re: 24VAC to 5VDC ? [Re: mlord]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Sharing cable (well running cables in closely in parallel) shouldn't be killing anything. Something else isn't right. And they shouldn't be just dieing for no apparent reason.

Without knowing the exact wiring, it's a bit hard to say what might be wrong but I'd guess more likely on the power supply side of things than anything

Wrong supply voltage?
Supply voltage connected somewhere it shouldn't be?
Missing power supply?
Correct voltage levels on the TX/RX?
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#356114 - 05/11/2012 21:00 Re: 24VAC to 5VDC ? [Re: Shonky]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
That stuff is all good.
And it all works with a really short cable.

But I've fried too many chips now to continue the experiment, so we may never know for sure what all of the causes were.

Cheers

Top
#356115 - 05/11/2012 21:52 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Mmm.. actually, I just had a thought. I wonder if circuit "ground" is the cause. The TTL serial signals from the thermostat are relative to it's own "ground/earth" wiring, derived from one leg off the bridge rectifier.

Thinking about it now, I don't believe I've fried anything when the serial is connected a battery powered notebook computer, and I know for sure I've fried a ton of components when the notebook is on AC wall power.. with a house ground/earth.

I don't know much at all about how the AC supply from the furnace is wired, but it might have one leg hooked to house ground/earth, or at least have some hefty potential from earth.

Undoubtedly something to do with that.

Ethernet is fine of course, because it uses transformer couplings for the cat5e connections at both ends. But serial has a DC ground..

I'm putting an opto-isolator chip on the board now for the three serial signals. That should keep me from frying anything new.

Top
#356761 - 11/12/2012 12:36 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
It's been a while since I posted an update here. The optocoupler circuit is in place and working well, so I now have remote serial port access to the thermostat, as well as ethernet / web access.

Next step is taking over control of the HVAC (air exchanger) unit. This one is by Venmar, and apparently the controls don't work like many/most other units on the market. I've googled it, and there are lots of reports of people scratching their heads when trying to hook it up to fancy store-bought home controls.

The main unit has two terminals specifically designed for use with simple switches/relays, but behaviour is worse than dumb: closing the contacts triggers a 20-minute timer cycle in the main unit, which cannot be stopped once triggered. Duh.

The wall controller for the unit has a 4-wire interface. Some probing revealed 12VDC power and ground as two of the wires, and +5VDC on the other too. Oh oh.. Logic Analyzer time. It turns out that those two wires are a custom serial interface between the main unit and the wall controller. One wire for each direction, 300 bits/sec.

Then it gets weird. Pressing a button on the controller sends a 24-bit sequence (with a single start bit, and one stop bit). I'm not sure what the purpose of those transmissions is, because they just inform the main unit what "mode" the controller is in. The main unit responds with a 7-bit (or 6-bit?) reply.

Whenever the controller actually turns the fans "on", it sends a 6/7 bit request to the main unit, and gets another 6/7 bit reply. I think the "reply" packets are just to tell the controller to turn status LEDs on/off. One arrives whenever the fan starts up, and another when it shuts off, including when triggered by the simple "timer" contacts discussed earlier.

Anyway, it all looks messy but doable. But during the course of playing with it, I discovered that if I disconnect the main controller, and then just short the transmit line to ground via a 1K resistor, the fan turns on. Remove the short, and the fan turns off. More or less exactly what I need! The main unit seems to have a pull-up on the line, so it floats back to +5V when not connected or shorted to anything. Current through my resistor is about half a milliamp.

So, I'll just ignore the fancy protocol and hook it up to one of the relays in the thermostat. The only slight downside, is this method only operates the fan at HIGH speed. There's also a LOW speed that would have been nice to access, but this would require the fancy digital protocol.

Cheers

Top
#356762 - 11/12/2012 12:54 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Oh, the thermostat also now has a proximity sensor wired in, which turns off the LCD display when nobody is in front of the unit. Much better at night time now. smile

The photo shows the current state of things, with my probe wires still hooked up to the HVAC controller above the thermostat. Lots of reflections from the clear Lexan cover plate on the stat itself.


Attachments
stat1.jpg

Description: Current state of the thermostat, with HVAC controller above.




Edited by mlord (11/12/2012 13:17)
Edit Reason: Much better photo

Top
#356764 - 11/12/2012 15:30 Re: 24VAC to 5VDC ? [Re: mlord]
sein
old hand

Registered: 07/01/2005
Posts: 893
Loc: Sector ZZ9pZa
Good job Mark!
_________________________
Hussein

Top
#356765 - 11/12/2012 19:48 Re: 24VAC to 5VDC ? [Re: sein]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
It does look a bit "raw" with the clear cover plate.

Being a geek, I'll probably leave it like that for a while. Eventually I can insert a photo or just a solid colour of paper between the clear cover and the innards, with cut-outs for the LCD and buttons, and get it to match the décor a bit better. smile

Top
#356767 - 12/12/2012 09:14 Re: 24VAC to 5VDC ? [Re: mlord]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Awesome Mark smile

Where's theres a will, there's a way! I keep meaning to do something to control our heating here, but I never get the time....

Adrian

Top
#356769 - 12/12/2012 12:22 Re: 24VAC to 5VDC ? [Re: sn00p]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
I'm a bit embarrassed by all of the "store bought modules", rather than having rolled it entirely on my own from bare chips. But they're so incredibly cheap to buy that way! Cheaper than the bare parts (by a long way). Eg. about $4 for the SPI-to-ethernet bridge module, DELIVERED! Or less than $2 for the DC-to-DC converter board.

Unbelievable.

Cheers!

Top
#356770 - 13/12/2012 05:34 Re: 24VAC to 5VDC ? [Re: mlord]
sn00p
addict

Registered: 24/07/2002
Posts: 618
Loc: South London
Originally Posted By: mlord
I'm a bit embarrassed by all of the "store bought modules", rather than having rolled it entirely on my own from bare chips. But they're so incredibly cheap to buy that way! Cheaper than the bare parts (by a long way). Eg. about $4 for the SPI-to-ethernet bridge module, DELIVERED! Or less than $2 for the DC-to-DC converter board.

Unbelievable.

Cheers!


Hah, yeah....the problem with that for me is that I'm lazy when it comes to wiring stuff together or using veroboard, I get bored after about 2 minutes!

For this reason most of the stuff we design has i2c+power broken out to a header (even if not populated) just incase we need to try something out or add some extra functionality at a later date - or just want to have a play with some other bit of circuit.

To me this (embedded) is where computing becomes fun again, it's like the (g)olden days of computing for me, the BBC micro, Sinclair Spectum, Archimedes where everything was bare metal.

I find it very hard to get enthused about writing desktop software anymore.

Top
#356777 - 13/12/2012 12:15 Re: 24VAC to 5VDC ? [Re: sn00p]
LittleBlueThing
addict

Registered: 11/01/2002
Posts: 612
Loc: Reading, UK
Originally Posted By: sn00p

I find it very hard to get enthused about writing desktop software anymore.


Yeah - make your own OS - much more fun smile
_________________________
LittleBlueThing Running twin 30's

Top
#356780 - 13/12/2012 15:25 Re: 24VAC to 5VDC ? [Re: mlord]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
(Admin note, finally forked this thread out of the old one. Kinda odd to have a self built thermostat thread in one titled "Attention Hugo".)

Top
#359603 - 05/09/2013 20:16 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Originally Posted By: mlord
The buck regulator is a standard circuit from the LM2695S-ADJ datasheet. The datasheet says "45V absolute maximum; but only up to 40V for the operating range".

So we're under 40V, I'd just like a little more margin, or some protection against the odd spike


Well, at some point during our holiday last week, the regulator stopped passing current. Warm (but not hot) to the touch when I inspected it today. Probably had a line surge from an electrical storm last week, and killed the buck regulator.

So I've installed my "spare" module, and the thermostat is working fine again for now.

At some point in the past year, the LM2576HV chip has made it onto commodity regulator boards such as these. This chip ought to be considerably more robust, with a max operating input voltage of 60V compared to 40V for the LM2695S. So I've ordered one (plus a spare) to replace the current module. $5.24 from HK via eBay.

Top
#359605 - 05/09/2013 22:20 Re: 24VAC to 5VDC ? [Re: mlord]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Higher input voltage doesn't not equate to better surge (really impulse if lightning) immunity.

What protection is on the frontend of this? Actually I'm not sure what the final design was in the end.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#359609 - 06/09/2013 10:39 Re: 24VAC to 5VDC ? [Re: Shonky]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
The thermostat takes "24VAC" from the furnace, which is really more like 28VAC. This goes through a bridge rectifier with a largish filter cap afterwords, giving around 38-39VDC as input to the (40V max) DC-to-DC converter board. The board then spits out 5.000VDC for use by the thermostat.

With a lightning strike in the neighbourhood, our house lights sometimes go brighter for 2-4 seconds, indicating a small voltage surge from the mains. I suspect this is what may have happened, just a few volts higher than normal for a few seconds, maybe a few occurrences during a storm.

Still, I wouldn't mind adding some surge protection in front of all of that. I wonder if perhaps I could just dismantle a normal AC surge suppressor and steal the relevant components for use on the 24(28)VAC input lines?

-ml

Top
#359611 - 06/09/2013 11:03 Re: 24VAC to 5VDC ? [Re: mlord]
larry818
old hand

Registered: 01/10/2002
Posts: 1039
Loc: Fullerton, Calif.
I would think you would have to put those components upstream of the furnace supply transformer. Typically a line surge suppressor caps the voltage at 150v to 250v, which is a significant surge at 24v.

Use a SA28A Transient Voltage Suppressor (TVS) on the 24v line, it'll cap at 28v and is all of 15 cents.

Alternately, you can install a couple of these on the incoming mains and protect the whole house:

http://www.alliedelec.com/search/productdetail.aspx?SKU=70025984#tab=specs

Top
#359612 - 06/09/2013 11:17 Re: 24VAC to 5VDC ? [Re: mlord]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Ok if you are running that close to the max input voltage then maybe a slight over voltage at the mains might damage things but I probably would expect it run a bit beyond absolute max before really dieing.

If you take something designed to protect something expecting 110-240VAC and use it at the 24VAC nominal output it won't do much/anything. Is that what you mean? Typically they will be quite primitive - often just a MOV and inductor.

You're best to have some "headroom" between normal output (38-39VDC) and maximum input (40VDC) and try to clamp the voltage there to have some margin. If you increase the max input to 60VDC though then you get that already but that won't do much for an impulse which can easily be multiple kV at the 110-240V side (but for a very short time)

It depends a bit on the actual failure mode. A surge or impulse is different to a few seconds of over voltage (typically called a swell) and they require different protection. If just a simple swell, then more margin will do it with the 60V input. Not sure how a lightning strike might cause a swell other than maybe causing breakers to open reducing the load and thus the voltage will rise a bit. Then the breakers automatically reclose and the load increases/voltage reduces.

If a surge or impulse due to say a lightning strike, these are much shorter events of the order of milli/microseconds. Then you need to start looking at transorbs/MOVs. An MOV is the cheap and simple protection method for most things. Look to clamp it well above the normal output though since the 24(28)VAC will vary as you've seen. The MOV should not be conducting in normal use ever or it will just die even quicker.

I'm a believer in protecting as early as possible e.g. at the 24VAC line where I'd look to put something like a 33V or 39V MOV. Not 100% on values available in that range but something like that.

_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#359614 - 06/09/2013 13:29 Re: 24VAC to 5VDC ? [Re: Shonky]
K447
old hand

Registered: 29/05/2002
Posts: 799
Loc: near Toronto, Ontario, Canada
I did not read back to see if this was mentioned or even possible in terms of mounting space;

If you connect a 24 VAC step down transformer (typically it would have a 120V AC mains input and 24VAC output), but use one with a center tap output, you can use it as a step down auto-transformer.

Cap off the 120VAC leads, no connection. Connect the two 24VAC leads to your power source. Use the center-tap output wire and ONE of the 24VAC end wires as your power feed to the bridge rectifier.

This will delver 12VAC (roughly) into your DC rectifier and filter, which would be half of the previous arrangement.

It requires finding room for the transformer, of course.

Top
#359617 - 06/09/2013 19:38 Re: 24VAC to 5VDC ? [Re: K447]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Mmm.. the transformer idea is clever, and thanks guys for the MOV tutorials. I'll hunt for a suitable MOV.

For whole-house surge protection, I'd need to have two free spots in the breaker panel -- only have one, so no go on that front.

Cheers

Top
#359618 - 06/09/2013 19:51 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Mmm.. 18V MOV varistors are readily available (and cheap!) on eBay -- any problem with putting two of those in series, across the 28VAC input? (two 18V in series == 36V protection??)

Nevermind .. the ones I saw were for 18VDC, not 18VAC. Not high enough for the DC part.


Edited by mlord (06/09/2013 19:54)

Top
#359619 - 07/09/2013 01:04 Re: 24VAC to 5VDC ? [Re: mlord]
K447
old hand

Registered: 29/05/2002
Posts: 799
Loc: near Toronto, Ontario, Canada
Originally Posted By: mlord
... For whole-house surge protection, I'd need to have two free spots in the breaker panel -- only have one, so no go on that front....
I often solve that problem by replacing four regular breakers with a quad breaker. Quad breakers use two slots but provide four breakers. Typically the center pair are linked to feed a split circuit at 20, 30 or 40 Amps.

I normally select one that has the outer breakers as 15 Amps each. Pull out the stove or clothes dryer breaker, install the Quad. Then move over two 15 Amp single circuits from whatever, and free up the slots.

http://www.homedepot.ca/product/quad-typ...ker-1000/941163

Top
#359620 - 07/09/2013 01:44 Re: 24VAC to 5VDC ? [Re: K447]
larry818
old hand

Registered: 01/10/2002
Posts: 1039
Loc: Fullerton, Calif.
The suppressors that I linked to for the whole house don't use a breaker spot. They would just need to be mounted inside the load center somewhere.

Top
#359621 - 07/09/2013 02:08 Re: 24VAC to 5VDC ? [Re: larry818]
K447
old hand

Registered: 29/05/2002
Posts: 799
Loc: near Toronto, Ontario, Canada
Rather than adapting a DIN type module, there are panel mount suppressor products that fit into a standard wiring hole in the panel and wire into existing breakers.

http://www.amazon.com/Panamax-Whole-Home-Service-Entrance-Protector/dp/B00271MIV4

Top
#359622 - 07/09/2013 10:56 Re: 24VAC to 5VDC ? [Re: K447]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Our panel here is already fully populated with "quad" breakers, so it really is "full" at present.

Here in Canada, I believe the Electrical Code requires dedicated breaker protection for whole house surge suppressors -- all of the cUL approved ones sold here suggest this in the installation instructions.

K447: do you know what Code says for this here?

Cheers

Top
#359623 - 07/09/2013 11:13 Re: 24VAC to 5VDC ? [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
I still find it amazing that a small house like ours manages to fill 39 spots in a 40 breaker panel. That's a consequence of modern kitchen wiring, and a large basement workshop with two 240V circuits and lots of 120V circuits. Plus the Code requirement of no more than 12 devices per 15A circuit.

Top
#359625 - 07/09/2013 16:44 Re: 24VAC to 5VDC ? [Re: mlord]
K447
old hand

Registered: 29/05/2002
Posts: 799
Loc: near Toronto, Ontario, Canada
Originally Posted By: mlord
I still find it amazing that a small house like ours manages to fill 39 spots in a 40 breaker panel. That's a consequence of modern kitchen wiring, and a large basement workshop with two 240V circuits and lots of 120V circuits. Plus the Code requirement of no more than 12 devices per 15A circuit.
I hope it is not one of these;

Federal Pacific Electric (FPE Stab-Lok)

Top
#359626 - 07/09/2013 20:41 Re: 24VAC to 5VDC ? [Re: K447]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
No, not stab-lok thingies. smile

It's a Novaline cabinet, with Westinghouse breakers that clip firmly onto the power rails. I forget the name for the exact connector style, but not stab-lok.

I put it in myself back about 23 years ago.

Edit: I think the current replacement breakers would look like this one: http://www.homedepot.ca/product/plug-in-duplex-quad-replacement-breaker-1-1p-15a-1-1p-30a/943174

Cheers


Edited by mlord (07/09/2013 20:44)

Top
#359630 - 08/09/2013 01:04 Re: 24VAC to 5VDC ? [Re: K447]
larry818
old hand

Registered: 01/10/2002
Posts: 1039
Loc: Fullerton, Calif.
Be happy it's that way. My house essentially had everything on one breaker. Over the years I've added breakers with associated conduit running around the outside.

Top
#359649 - 09/09/2013 15:46 Re: 24VAC to 5VDC ? [Re: mlord]
canuckInOR
carpal tunnel

Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
Originally Posted By: mlord
I still find it amazing that a small house like ours manages to fill 39 spots in a 40 breaker panel. That's a consequence of modern kitchen wiring, and a large basement workshop with two 240V circuits and lots of 120V circuits.

I'm surprised you don't have the basement workshop on a sub-panel...

Top
#359650 - 09/09/2013 17:40 Re: 24VAC to 5VDC ? [Re: canuckInOR]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
One of my regrets. Never thought the 40-breaker panel would fill up -- the original old fusebox had only 12 fuses. Oh well.

However, I have identified a couple of circuits that can be combined onto a single breaker (while still totalling 12 or fewer devices), so I may yet re-plumb things there for a whole house surge suppressor.

Cheers

Top
Page 1 of 3 1 2 3 >