A bit of peer review of this schematic, for me, please?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

A bit of peer review of this schematic, for me, please?

Postby minerva » Sun Feb 19, 2012 6:32 am

Hi everyone,

If I could get a bit of peer-review of this schematic, to help ensure that it will work as intended, that would be awesome

https://github.com/lukeweston/stuff/blo ... r/plug.pdf

(Tip for the GitHub uninitiated: click on "raw")

Yes, this design is based on a transformerless power supply running from 240VAC. Yes, I understand what the implications of transformerless power supplies are in terms of isolation and safety. Yes, the unit will be completely enclosed in a plastic box during operation with no external cables or interfaces, only the RF link.

Basically, this little unit will be connected in series with a 240VAC load device (a household device with a current draw of less than 10A).

It will be interfaced to a remote controller wirelessly using an XBee 802.15.4 module (which will provide perfectly sufficient air gap isolation from the zappy bits, with no optocouplers, and no wired interfaces!)

It contains a relay which will be used to turn on and off the power to the load, and it also contains the ability to measure to sample the load current waveform via a shunt resistor, so power use can be measured, and the voltage waveform too.

I'm not going to use a dedicated energy acquisition chip like the ones you can get from Analog and Microchip etc, because I'd like something simple and cheap, even if it's not quite as accurate. So, basically, I'm just going to shove voltage and current waveforms into the AVR's ADC and try to construct a power measurement in the firmware. Maybe if everything goes according to plan I may even be able to do things like power factor measurement in the firmware. Yes, I know it won't be as accurate as a fancy energy DAQ chip.

I have designed the Transformerless Power Supply for an output current of about 80 mA, which is relatively high for a transformerless power supply. This is why the capacitor is a relatively large 2.2 uF.

The current budget breakdown looks something roughly like this:

XBee module = 50 mA
Relay coil = 16.7 mA
AVR = 5 mA
Margin for error = 8.3 mA
Total = 80 mA

There are non-isolated headers for ISP programming and serial debugging/programming - I might use an Arduino bootloader layer to make firmware development a bit easier.

The XBee module will be unplugged during flashing - this means it won't stuff up if the programmer is injecting a 5V Vcc rail to the target.

It goes without saying that all programming/flashing will always be done with mains disconnected!

I have one of the XBee GPIO pins throwing a low reset pulse to the AVR, so hopefully the XBee radio link can be used to remotely reflash the firmware (via the Arduino bootloader layer) without the need to unscrew the case while the live hardware is online.

I'm not 100% sure if the voltage/current sampling circuits will work as intended. These are a part of the system where I would especially like a bit of peer-review to help me check.

What I'm aiming to do is turn both the voltage and current samples into sine waves that are scaled appropriately so the peak-to-peak amplitude corresponds to 3.3V when the load current is a bit more than 10Arms and when the voltage is a bit more than 240Vrms for the current and voltage waveforms respectively.

These will be going into the AVR's ADC, with a reference voltage which is just Vcc, 3.3V, and I'm aiming to have them offset by +1.65V so that they're in the middle of the usable single-ended ADC range.

Also, I don't want to introduce any phase distortion if I can help it, because that would mean we basically lose the potential ability to make power factor measurements, which I hopefully want to do.

There are also a couple of temperature and light sensors sending back their readings to the remote side.

The intended way that I've designed the current shunt amplifier to work goes something like this:
(Note that this may be incorrect... you tell me.)

(Note that the rail labelled as 12V is actually more like 12.4V, it's the 13V Zener voltage minus the 0.6V or so across the 1N4004.)

Vshunt = 12.4 V - (I * 0.01 ohms)
Op-amp Vout = 138.3818 - (11.0280 Vin)
Op-amp Vout = -11.0 * (Vin - 12.4) + 1.65
Op-amp Vout = (0.11 * I) + 1.65
Peak-to-peak amplitude = 3.11 V at 10A rms load current.

The voltage waveform is acquired by the voltage divider consisting of R17 and R19, AC coupled, and then re-biased to 1.65V by a voltage divider.

Thoughts or comments?

Cheers :)
minerva
 
Posts: 54
Joined: Sun Dec 06, 2009 10:12 pm

Re: A bit of peer review of this schematic, for me, please?

Postby neutron spin » Sun Feb 19, 2012 10:46 am

Try bread boarding the design first....plus the 12 volts on the input to the regulator is really too high and should be between 6 and 9 volts max...also you may want to run the design in Spice before you try to smoke your parts....Of course the design violates anything that would get the UL seal of approval and could cause a fire and mass destruction of anything around it that would burn...just kidding of course!...good luck.. :)
neutron spin
 
Posts: 162
Joined: Sat Apr 03, 2010 5:11 pm

Re: A bit of peer review of this schematic, for me, please?

Postby philba » Sun Feb 19, 2012 12:35 pm

My first thought when looking that schematic was "likes to live dangerously!". I'll gladly buy you a beer sometime. Maybe a smoked beer...

I think using a shunt isn't best way to go. At least for safety. Why not use a current transformer to gain some measure of isolation? You could wind your own to keep the cost down.

Your transformerless PS scares me. Especially when the only ones I've seen trypically deliver 10-15 mA. It just seems like an unreasonable risk. You can get a small 100 mA transformer and build a very simple linear power supply for not much money. This will also allow you to pull a voltage sense tap.

As for 12 to 3.3V, at 60 mA we are talking around 500 mW which in an enclosed box is likely to be running at 75C or more under full load. The LD1117 has a thermal resistance of 50 C/W. Not the end of the world but, personally, I'd design it to run cooler. If you can vent the box that may help but it will always be around 30C above ambient. You can get 5V relays with contacts rated at 10A or more though they pull more coil current. Have you considered an SSR? The xbee is your worst current offender though so starting lower is good idea. Of course if the xbee runs at a low duty cycle, it is a moot point
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 5:59 pm

Re: A bit of peer review of this schematic, for me, please?

Postby westfw » Sun Feb 19, 2012 4:36 pm

The transformerless power supply rectification and regulation looks weird, compared to other supplies I've seen, for example: http://electroschematics.com/3752/trans ... er-supply/ Does it even have rectification? Are you trying to get double-use out of the Zener for rectification AND regulation at the same time?

I'm with other people: by the time you get to the size and expense of moderate current transformerless power supplies, you might as well have stuck in one of those Nth-party iPhone chargers.
User avatar
westfw
 
Posts: 1328
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: A bit of peer review of this schematic, for me, please?

Postby EasternStarGeek » Sun Feb 19, 2012 5:37 pm

Please think about adding some transient protection (MOV, etc) and possibly an RFI filter. The Mains is a jungle out there, and fast rise-time transients will not be deterred by the big series capacitor.
EasternStarGeek
 
Posts: 251
Joined: Mon Dec 13, 2010 12:39 pm
Location: Upper Eastern Tennessee

Re: A bit of peer review of this schematic, for me, please?

Postby minerva » Mon Feb 20, 2012 4:33 am

neutron spin wrote:Of course the design violates anything that would get the UL seal of approval and could cause a fire


That's not true. There's nothing dangerous about a transformerless power supply, unless you do something stupid, eg. taking an off-the-shelf device with a transformerless power supply and trying to hack into it and wiring it up to your PC with no isolation or something.

There's no reason at all why a device with this kind of transformerless power supply cannot meet UL compliant requirements. (Although I have not checked this specific design to see if it does. It's largely dependent on PCB considerations such as track thickness as well as electrical considerations.)

There are plenty of mass-produced safe, effective consumer electronics products that are all based on capacitive transformerless power supplies, like the Kill-a-Watt for example and similar energy measurement devices on the market.

Those kinds of devices are very small and very cheap because they are using transformerless power supplies and current-measurement shunt resistors.

If you go down the route of using a conventional isolated transformer power supply plus a current transformer then that just blows your physical size of the unit and the cost right up.

westfw wrote:The transformerless power supply rectification and regulation looks weird, compared to other supplies I've seen, for example: http://electroschematics.com/3752/trans ... er-supply/ Does it even have rectification?


It's actually a pretty typical, common transformerless mains supply architecture. There is a 1N4004 rectifier diode in the circuit, as you can see. It doesn't have to be a You might find Microchip AN954 interesting, it provides a detailed description of these sorts of circuits.

http://ww1.microchip.com/downloads/en/a ... 00954A.pdf
minerva
 
Posts: 54
Joined: Sun Dec 06, 2009 10:12 pm


Return to General Project help

Who is online

Users browsing this forum: No registered users and 5 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [113]

Raspberry Pi[81]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]