Difference between revisions of "User:Shardan/PowerBox"

From Let's Control It
Jump to navigation Jump to search
Line 278: Line 278:
  
 
For the low voltage output you're on your choice.<br/>
 
For the low voltage output you're on your choice.<br/>
For development some 2mm or 4mm banana sockets might be best choice.<br/>
+
For development and tinkering some 2mm or 4mm banana sockets might be best choice.<br/>
 
If you want to use this for permanent installation a 4 or 5 pin GX12-type connector is recommended.<br/>
 
If you want to use this for permanent installation a 4 or 5 pin GX12-type connector is recommended.<br/>
 
[Pic connector]<br/>
 
[Pic connector]<br/>

Revision as of 23:02, 24 February 2018

WIP.gifYou may hear some construction noise in the background...

Mains Disclaimer.png

Preface

Far too much issues show up with the widespread cheap power supplies on the market, so i decided to create
a reliable power source for experimenting with ESPEasy (and other similar devices like Arduino of course).

This power supply is not cheap. It won’t be possible to underbid the prices of even good quality power supplies.
But all of them lack the possibility of switching mains circuits if needed and they are not really universal.
The Power Box can be equipped with different power supply modules from a small 3 watts HiLink HLK-PM01 up to a 20 watts MeanWell IRM-20-12.
An optional voltage regulator can be used to provide a lower second voltage.

On top the PCB includes two relays to switch mains circuits.
There are two different PCB layouts, one for mechanical relays made by Schrack or Fujitsu/Takamisawa
and another PCB for two solid state relays like the Mager GJ-5-L or similar.
This way the power supply may be used for development and tinkering in many variations for ESPEasy,
Arduino and similar devices. It can also be used for permanent installation, for example controllers
needing mains switching capabilities.
The PCB's are made for a cheap ABS box available under different names from several distributors.

The Circuit


Shardan PowerBox Schematics-Relay.jpg
Shardan PowerBox Schematics-SSR.jpg
For printout: File:Shardan PowerBox Schematics.pdf

The relay circuit is built from a small FET driving the relay.
The resistor from FET gate to ground gives a defined "low" if the circuit isn't used (open input).
For SSR's there is an additional resistor in series to the relay input. Some relays might need a
current limiting resistor. If your SSR does not need it, place a zero Ohm resistor there.
I’ve used all testing SSR's with 12V and a 47 Ohm resistor successfully.
For mechanical relays there is the usual free-wheeling diode to protect the circuit from the voltage spikes of the relay coil.

On both PCBs you may place a varistor OR a TVS diode in parallel to the mains switch.
This is recommended specially with SSR's as they are very sensitive to high voltage spikes if
switching inductive loads. But even for mechanical relays a varistor or TVS diode can be usefull if
you plan to switch inductive load, for example big transformers, motors or solenoid valves. The spark on
switching off can damage the contact over longer times so a varistor or TVS elongates lifetime of the relays.

 Please note that a varistor OR a TVS diode can be placed, not both at same time.


Types for TVS/Varistor


The P6K400CA (TVS diode bidirectional, 400V) was tested here successfully.
If you chose another type remember it has to be a bidirectional type in any case.
Varistors are zinc oxide types with 350..400V and 0.6 watts.

Relay or SSR?


For the technical differences, advantages and disadvantages of relay types see the wiki. Basics: Relays
Well that depends on what you plan to do.
For switching smaller loads or non-inductive loads a SSR can be used. It is noiseless and avoids contact bumping.
If you plan to switch massive inductive loads a mechanical relay might be the better choice as it is less sensitive to voltage spikes from the inductivities.

Which PS module and Voltage Regulator?


Well, that depends on what you plan to do too.
As the Power Box was designed with variability in mind there are many possible combinations.
(All currents are limit values for one single output! Pulling 2x 1A from a IRM-15-12 will not work...)

Possible Combinations
PS module Module out Voltage regulator Regulator out Comments
HLK-PM03 3.3V 1A n/a n/a Not recommended*, No mechanical relays
HLK-PM01 5V 0.6A n/a n/a Mechanical relay: 5V type
HLK-PM01 5V 0.6A LF-33 3.3V 0.5A Mechanical relay: 5V type, Not recommended*
IRM-10-5 5V 2A n/a n/a Mechanical relay: 5V type
IRM-10-5 5V 2A LF-33 3.3V 1A Mechanical relay: 5V type, Not recommended*
IRM-10-12 12V 0.75A LM7809 9V, 0.75A Mechanical relay: 12V type
IRM-10-12 12V 0.75A LM7805 5V, 0.75A Mechanical relay: 12V type
IRM-10-12 12V 0.75A LF-33 3.3V 0.75A Mechanical relay: 12V type, Not recommended*
IRM-15-5 5V 3A n/a n/a Mechanical relay: 5V type
IRM-15-5 5V 3A LF-33 3.3V 1A Mechanical relay: 5V type, Not recommended*
IRM-15-12 12V 1.25A LM7809 9V, 1A Mechanical relay: 12V type
IRM-15-12 12V 1.25A LM7805 5V, 1A Mechanical relay: 12V type
IRM-15-12 12V 1.25A LF-33 3.3V 1A Mechanical relay: 12V type, Not recommended*
IRM-20-12 12V 1.8A LM7809 9V, 1A Mechanical relay: 12V type
IRM-20-12 12V 1.8A LM7805 5V, 1A Mechanical relay: 12V type
IRM-20-12 12V 1.8A LF-33 3.3V 1A Mechanical relay: 12V type, Not recommended*


 Not recommended* Always prefer to use 5V or 9V and a separate voltage regulator to 3.3V near the ESP! Cables have a voltage loss!
 This might lead to unpredictable behaviour, for example if the ESP starts transmitting data.


With mechanical relays the most reliable combination is a 12V-module with a 9V or 5V regulator at the power supply.
This keeps the spikes from the relays off the ESP voltage.

 Beware: For full load it is necessary to mount a heat sink to the voltage regulator. Watch the hight, the case is small! 


I've used a standard U-shaped heatsink and cut it to fit.

 Remember: The HLK-PM types do not offer much power, it's definitely the bottom end of possible modules.
 It's just enough for an ESP. If you plan to use many or power consuming sensors you should use the IRM-types.


Fuses

All fuses are time-lag types.
Use a 0.5A fuse for the module.
For relay circuit use a 4A fuse for the SSR relays or a 6.3A fuse for mechanical relays.
Prefer isolated fuse holders if possible for better security.

The PCBs


Shardan Powerbox PCBs.jpg
Left: Mechanical relay version, right: SSR version. Top: Frontside. Bottom: Backside.

The PCB's are double sided with vias so it needs a professional service for producing the PCBs.
Ask the author for the files or premanufactured PCB’s.
In some countries the security policies demand a minimum distance of 10 mm copper - to – copper
between low voltage and high voltage tracks. If 10 mm is not possible there must be a milled out gap
between the tracks. Both PCBs do have these gaps as you can see on the drawing.

The Case


The PCBs are made for a nice small isolating box manufactured by "Donau" [[1]].
It's sold as "Eurobox" at Reichelt [[2]] or "Euro-Gehäuse" at Voelkner [[3]] with a size of 95 x 135 x 45 mm³ for around 3 EUR here.

Of course you may mount the PCB in any other case, even together with your ESP device.

 Always use an isolating case!
 If you use another case; do not use metal screws through the case. Use plastic screws and spacers instead.
 Remember the power module, SSR's and the voltage regulator get hot! Use a vented case.


Shardan Powerbox-CaseMount.jpg

Populating the PCB


First solder all SMD parts. Place all resistors, then capacitors and at last the transistors and diodes if using mechanical relays.

If you solder free hand, first put some solder on one pad of the SMD part.
Then place the part holding it with tweezers and heat up the solder again.
As soon as the part is aligned nicely solder the other pad(s).

A hint for those who solder SMD parts more often:
On the market there is now and then a special glue called “Fuji Red Glue”. Fill some of this glue in a
syringe with a 0,25mm needle. This glue does not harden at room temperature so you can align parts easily.
Put a very, really VERY little drop of glue between the soldering pads of the SMD resistors and
capacitors on one side. Place all parts, then put the PCB into an oven for two minutes at about 130..140°C.
Watch out to not shift any part when carrying the PCB into the oven.

This done you should repeat the procedure with the other side for double sided PCB's.
The parts are fixed now so soldering them gets really much easier.

After the SMD parts you may solder all other parts.
Check all soldering points!

 A weak solder point on a mains voltage circuit may set the device on fire!

Check for unwanted "bridgings" between solder points.
A steel needle or a sharp cutter knife can help. If needed use desoldering wick to get rid of bridgings.

Testing


It's tempting to test the power supply just lying on the desktop. But that is dangerous!
Touch a wire or the board accidentally, it starts to slip and you might grab it instinctively….

Always mount the PCB into a case shell at least to avoid accidental contact to mains voltage.


Connect the power supply to mains - no fuse blown? You're lucky :)

Carefully check voltage at the output pin header using a voltmeter.
If everything is OK you may test the relay circuits.
You may easily use a male/female DuPont jumper cable. Put it on a + voltage outlet pin
and touch the channel inputs for the relay.

With the mechanical relays just switch them - you should hear the "click" from the relay.

With the SSR's you need to connect an external load, a desktop light for example.

 It's not possible to just check with a voltmeter as SSRs leak a minimal current even if switched off!

Due to the leackage current a voltmeter will show voltage on switched off outputs.

Mounting


Use cord grips for power cables.
Use protection earth! It’s there for a reason!
All input/output screw terminals offer L, N and PE.

For the low voltage output you're on your choice.
For development and tinkering some 2mm or 4mm banana sockets might be best choice.
If you want to use this for permanent installation a 4 or 5 pin GX12-type connector is recommended.
[Pic connector]
Anyways a cable with cord grip will do the job too.

 Be careful when placing sockets and cord grips - the case is smaller then you think!

Watch out no plug or cord grip gets in conflict with mounted PCB parts inside.

The PCB uses 4 of the 7 mount points inside the case shell.
Unused mountpoints should be removed with a side cutter for example.

If all this is done you’ll own a reliable universal power source for your devices and testing.

Shardan Powerbox-CaseMount2.jpg