Shop OBEX P1 Docs P2 Docs Learn Events
Dealing with mains voltage and high currents — Parallax Forums

Dealing with mains voltage and high currents

CSA ProductionsCSA Productions Posts: 2
edited 2012-12-31 12:47 in BASIC Stamp
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.

Comments

  • davejamesdavejames Posts: 4,047
    edited 2012-12-28 08:35
    CSA - welcome to the Forum!

    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.
  • tonyp12tonyp12 Posts: 1,950
    edited 2012-12-28 11:55
    A PS2505 is the way to go.
    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
    623 x 632 - 78K
  • ercoerco Posts: 20,256
    edited 2012-12-28 12:39
    A less sophisticated 120VAC detector could be as simple as a NE-2 neon bulb and a photocell.
  • CSA ProductionsCSA Productions Posts: 2
    edited 2012-12-28 12:45
    tonyp12 wrote: »
    A PS2505 is the way to go.
    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|0&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?
  • tonyp12tonyp12 Posts: 1,950
    edited 2012-12-28 13:11
    >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.
  • willembadwillembad Posts: 47
    edited 2012-12-31 12:47
    I built one for my project to detect if a compressor was running or not. Used a 120VAC LED designed as an appliance ON indicator light and heat-shrinked it to a photodiode. Had to poll multiple times since the stamp is fast enough to catch 50 Hz off.

    AutoEANx-1.jpg


    In the following code "Compressor" is an input Pin 0
    [FONT=arial][COLOR=#333333]SysCheck:[/COLOR]
    FOR Counter2 = 1 TO 10
       Run = Run + Compressor
    NEXT
    IF Run = 0 THEN ShutDown
    Run = 0
    IF CurrentMix > 380 THEN ShutDown
    [COLOR=#333333]RETURN
    [/COLOR][/FONT]
    
    1024 x 620 - 85K
Sign In or Register to comment.