Dealing with mains voltage and high currents
CSA Productions
Posts: 2
Relatively new to the Basic Stamp and have just a few questions.
1) what would be the safest and most durable way to sense the presence of 120V AC with a pin on the BS2. I'm not a stranger to dealing with this type of need, just want to protect the (seemingly) delicate chip -and keeping in mind worst-case scenarios such as lightning surges or large machinery inductive kicks.
2) similar to 1) but in reverse, -how to reliably drive large solid-state relays (30A) with good isolation back to the controller when they fail? Should I use a small mechanical relay to drive the big ones? Should there be an optical isolator?
3) Is there a way to carry a program through a power loss to the BS2? something along the line of "process not completed due to shut-down so resume where we left off when power returns?"
-Thank you for any advice.
1) what would be the safest and most durable way to sense the presence of 120V AC with a pin on the BS2. I'm not a stranger to dealing with this type of need, just want to protect the (seemingly) delicate chip -and keeping in mind worst-case scenarios such as lightning surges or large machinery inductive kicks.
2) similar to 1) but in reverse, -how to reliably drive large solid-state relays (30A) with good isolation back to the controller when they fail? Should I use a small mechanical relay to drive the big ones? Should there be an optical isolator?
3) Is there a way to carry a program through a power loss to the BS2? something along the line of "process not completed due to shut-down so resume where we left off when power returns?"
-Thank you for any advice.
Comments
Grenora?!? Wow, you're way up there!
Optical isolation would certainly be the way to go...and there are a number of Forum members who have used the BS2 in an industrial environment. They'll be chiming in soon, I'm sure.
pull-up from the Vcc line should be around 10k
Ohm Resistor to use on the main, 47k should be OK for 110v and 100k for 220v.
http://www.mouser.com/_/N-scv7?Keyword=PS2505&Ns=Pricing%7c0&FS=True
Thank you, that's just the ticket, -and the 2505-4 gives you four of them in one $2 package -much simpler than some of the methods I was dreaming-up.
How long is the output low-signal at zero-crossing (60Hz) -is it possible to accidentally poll a 0 if you hit it at that moment?
You could read twice slow,and if at least one is high for true...
Or even better read 100 times pretty fast and if 20 or more high = true (software debounce)
Or a RC snubber (a 33k series resistor plus a 1uF cap to gnd) on the line going to the input-pin, to filter out the 2% low state.
In the following code "Compressor" is an input Pin 0