Wawa:
If the SSR only needs >=2.4volt and <15mA, why the transistor. Why not drive it directly from an Arduino output.
Leo..
Yes, perhaps a link to the data sheet for the SSR would help?
Russell.
Wawa:
If the SSR only needs >=2.4volt and <15mA, why the transistor. Why not drive it directly from an Arduino output.
Leo..
Yes, perhaps a link to the data sheet for the SSR would help?
Russell.
russellz:
Yes, perhaps a link to the data sheet for the SSR would help?
40A version of this :
http://www.fotek.com.hk/solid/SSR-1.htm
Change that 43k into the more common 47k.
According to my calculations you still will be well under 5volt analogue in.
And that 100k resistor will protect you to ~25volt on the main cap anyway (1mA input protection diode current).
The SSR datasheet tells me that driving it from the Arduino pin is ok.
Leo..
Hi,
Is there any reason why you cannot use a double 9V secondary, one to supply electronics, the other to give a representation of the mains voltage.
If the transformer is 5VA you will probably find most have 2 secondaries.
Tom.....
TomGeorge:
I have drawn both concepts.
Hi Tom
Thank You for your input.
I have two questions about the second design that concern me.
question 1.
The Schottky diode. It looks like that is only going to be reading '1 side' of the 9VAC ( not sure if it is 1/2 voltage or 1/2 current, but it looks like it would be 1/2 something ) Would this require the voltage divider resistor values to be changed to account for a different value range ?
question 2.
the other side of that first transformer winding is pointing to ground ?
Surely it could not be correct to connect this to the ground circuit. Or am I not understanding the drawing and the wire does not actually go anywhere at all ?
OK. Having done some reading on the half wave rectifier from AC to DC, it now makes sense. Many Thanks for taking the time to make the drawing.
I like the idea of using a transformer with 2 secondary coils and am looking at parts now.
Although I don't currently need to measure the mains voltage after the SSR has been activated, it may serve a purpose at a later date. The cost difference in the transformers with 1 or 2 secondary coils is extremely low compared to the rest of the project.
Regards
Dave
Hi Tom
Looking for components now, I have found this Schottky Diode.
Could I please bother you to confirm that the specs of the diode are OK for this application ?
DIODE SKY AXL 20V 1A
SCHOTTKY BARRIER DIODE AXIAL LEADED
Vf=0.45V
V_RRM = 20 V
V_RMS = 14 V
V_DC = 20 V
Io = 1.0 A
datasheet :
Hi,
That should be fine current rating, a higher Vrmm might be better, say 30V or higher.
Tom....
Do you want the arduino to work when the power supply is off ?
I'd be looking to run the arduino off a battery ( good for at least two hours ), and charge the battery with a battery charger when the power is on.
michinyon:
Do you want the arduino to work when the power supply is off ?
No. This Arduino is only required to run and determine the mains voltage IF there is any mains voltage.
On startup there will be an automatic 5 seconds delay before checking the voltage.
I will also be adding a 4N25 opto to the circuit so that an external unit can identify if the unit is active.
TomGeorge:
That should be fine current rating, a higher Vrmm might be better, say 30V or higher.
Thanks Tom.
The same datasheet also has a 1N5819 version, with :
V_RRM = 20 V 40 V
V_RMS = 14 V 28 V
V_DC = 20 V 40 V
Io = 1.0 A 1.0 A
Would I be correct to assume that if the Vf=0.60V at 1A DC, then the voltage drop would differ, depending on the current passing through the diode ?
If this is the case, and I am using a separate ( second ) secondary coil from the 9VAC transformer ( used only for the diode > voltage divider > analog input pin ), that the voltage drop over the diode should remain constant, as the current should remain the same, even if the voltage from the transformer fluctuates ?
Or should I still get it connected to an oscilloscope to determine the analog readings for each voltage range ?
Dave
There is no need to use a Shottky diode in that application. A cheap and cheerful 1N4001 will do just fine and will give a pretty constant voltage drop of just under 0.5 V.
Tom is being a bit over cautious with his capacitor values. A quick calculation gives ripple of 10 mV on the 100 uF reservoir capacitor leading to only 5 uV on the Analog input. The ripple on the 4700 is about 40 mV with the SSR energised. All three of those capacitor values could be reduced by a factor of ten with no problem.
Russell.
I agree about the lack of need for a Shottky. You don't really care about the voltage drop across that diode as long as it's constant. It's not the drop that will cause problems, it's changes in the drop that will cause problems. The difference between a 0.7 volt drop and a 0.45 volt drop can be taken care of in software. As long as it's constant.
Something that might bear more scrutiny, however, is the fact that you have built essentially a peak detector with your diode and the 100 uF caps. That peak detector is charged by a low impedance source (the transformer and forward biased diode) and discharged by a high impedance source (lots of resistance and the input current to the microcontroller A/D).
Are you sure you're going to get the response time you need? The RC for the first 100uF discharged through your 143K is over 14 seconds. The voltage into your A/D is going to go up fast, but decay slowly. I'm thinking you might have complete outages on the 220 line and never know it.
HACF:
Are you sure you're going to get the response time you need? The RC for the first 100uF discharged through your 143K is over 14 seconds. The voltage into your A/D is going to go up fast, but decay slowly. I'm thinking you might have complete outages on the 220 line and never know it.
Hi HACF
Not sure if that 14 secs is based on 143K or 43K ?
Either way, it shouldn't make any difference, as once the mains outage occurs, the power to the Arduino also dies, so nothing will be watching the voltage divider until the mains resumes again.
Hi,
The value of the RC will have to be tweaked, any suggestions to circuit design are welcome.
I haven't even bread boarded it, but have repaired many power monitors that use this method with one transformer and two secondaries.
Yes it is peak detector, if you want the true RMS, either divide by 1.414 or go to the trouble of sampling the waveform and doing an analysis.
Tom....
No. This Arduino is only required to run and determine the mains voltage IF there is any mains voltage.
On startup there will be an automatic 5 seconds delay before checking the voltage.
It seems to me, you need to give some thought to the order in which things happen when the power comes back on.
You need to make sure your SSR will always be in the "off" state when the power comes back on, until the arduino has checked the quality of the power.
You need to make sure that the signal from the Arduino to the SSR, cannot appear in the "on" condition while the arduino is powering up.
Sorry. I don't think I was clear enough about potential response time issues. Completely losing the line voltage was an extreme to make a point. I was thinking more along the lines of brown-outs or wild swings.
What happens if the line voltage is unstable and is varying voltage, sometimes too high, and sometimes too low? This circuit will hold the "highest peak" (redundant) until the stored charge is bled out of the caps through the resistors plus whatever current the A/D input pin draws.
For example, if the line voltage swings to 230VAC. for even a short period of time, it will charge the caps proportionally and the A/D will read that high input voltage. But if the line voltage then drops back to a lower level, say 190VAC. Questions are things like:
How quickly will the charge on the caps be bled down through the resistors and the A/D pin?
How long will it take the A/D to register the below spec input voltage?
Is that fast enough?
Picture the situation where the line voltage spends one second in spec at 230VAC and then ten seconds below spec at 160VAC. Will the A/D ever provide a reading that would indicate the line voltage dropped below spec? If not, is that OK?
There have been plenty of other threads in which people have complained that their motors jiggle or their servos move, or their leds flash, when their arduino is powered on. If you read the atmel spec, it will tell you somewhere that the state of the outputs is not controlled during the first 50 milliseconds ( or whatever it is ), after it is powered up.
The risk that you have, is that during this time, a spurious high signal on the arduino output which is controlling the SSR, might turn it on. This is unlikely to be good for your other computers or whatever it is that you are trying to protect.
Picture the situation where the line voltage spends one second in spec at 230VAC and then ten seconds below spec at 160VAC. Will the A/D ever provide a reading that would indicate the line voltage dropped below spec? If not, is that OK?
If you have a rectifier with a big capacitor, and you had a brief interruption of the power, the capacitor would discharge relatively slowly, and the A/D might not detect it.
However, if you have a rectifier with a big capacitor, and the power comes on for one second only, and then fades away, then the capacitor would not have been properly charged up in the first place.
michinyon:
You need to make sure your SSR will always be in the "off" state when the power comes back on, until the arduino has checked the quality of the power.You need to make sure that the signal from the Arduino to the SSR, cannot appear in the "on" condition while the arduino is powering up.
Agreed. A pull down resistor on either :
a) the digital output from the arduino to the transistor, and even a pull-up on the ground line between the transistor and the SSR, or
b) if no transistor used, then a pull down resistor on the arduino to SSR positive line
should take care of the power-up process.
The rest of the delay is in the code.