I am looking for information on how to interface an arduino to control o22 switches. Has anyone done this? If so I would appreciate the details or a link to where to find the information. The point I am having trouble wrapping my head around is the AC and the momentary contact to throw the switch. I have read other articles about controlling AC and from the readings they all seem to say to keep the arduino and the ac isolated from each other.
Replies sorted oldest to newest
The Arduino should have a relay output board. You can switch the AC with the relay contacts using a separate circuit. Momentary contact can also be done with capacitor discharge,either into the switches themselves or into a relay coils which in turn will thrown the switches with it's contacts. The logic part of the unit would use a filtered DC power supply.
Dale H
I was investigating using a relay shield (8 relays to the board). I would use the ARDUINO to set the relay for 1 second then turn it off. This would leave the switch in the correct position. The next problem would be to determine the setting of the switches after a power reset of the ARDUINO. Would attaching an LED to the ARDUINO from each side of the switch and checking for a high work?
022 switches do provide an indication of their position, so you could wire up some inputs. I'd probably use opto-isolation from the switch before I connected it to an Arduino input port.
I don't know what the LED will do for you, one presumes you want to know where the switches are when you come up, right?
Stan, you can detect the position of 022 switches, no need to switch them at power-up. After all, you might not want it to switch them unexpectedly.
You're right about I/O pins, even though the chip has quite a few. They do run out quickly. There are some nice SPI interface chips that would work well and give you lots of I/O pins for minimal wiring.
GRJ, I think you need to draw a picture for the OP of your detection wiring. Are you saying put an opto-coupler across each bulb? And if so, what part number and resistors would you suggest.
If an opto is used to sense AC voltage (such as across a bulb), I'd think you'd have to filter the AC voltage ripple whether with a capacitor or in the code - even for an AC-input opto. Otherwise you would occasionally get a false switch reading. OTOH, suppose you aimed a photo-transistor right at the incandescent position bulbs. The steady glow from the incandescent filaments might eliminate the need for filtering; it would be impractical to implement but I thought would illustrate the ripple issue.
As I'm sure you know, the 022 lights the bulb indicating where the switch is positioned. For that matter, so to Fastrack switches, though they just have a bi-polar DC signal to indicate switch position.
That being the case, it's clearly possible to sense where the switch actually is, and that can be very useful. If you throw a switch, and something malfunctions, you'll know that the command wasn't successful, for instance. Also, as you mentioned, powering up you'll know where the switches are without changing the layout configuration, which may not be desirable.
In it's simplest form, you could probably go with an AC opto-isolator and a resistor for sensing which lamp is on. The Lite-on LTV-8441 is a quad channel part that would be good for four lamps. You'd likely have to filter the output to eliminate the ripple and get a solid DC signal for the digital input to the Arduino. I use the single channel LTV-8141 for my motion sensor to detect motor voltage.