Hello all! Please could I get your advice on this ... ?
I would like to control ten anglepoise lamps that I've acquired with my Arduino - specifically, to turn them all on and off independantly, according to a sequence I want to write in my Arduino code. I'm not turning them on and off very fast (perhaps the smallest time period being 1 second?) and all the lamps have energy-saving lightbulbs in, so I'm gussing this amount of switching won't kill the bulbs as much as if they were filament bulbs. Now I think about it, I'd have to warm the bulbs up first, to get them to max brightness! But anyway...
Ideally, I'd like to have my circuit element sitting in between the mains plug and the lamp itself,. So I need to control 240V AC with the arduino's 5V digital output. I've tried to research relays, opto-isolators, SCRs and triacs, but am getting v.confused with all the options out there.
The world of relays seem v.confusing, and I'm not sure the transistor-based output of opto-couplers would work with an alternating voltage (i.e. when the voltage swings negative, won't the transistor block the current?)
Well the simplest device to use is a solid state relay. They can be driven directly by an Arduino output pin and control the switching of AC voltage on it's output.
You need to shop around to find the best price as they are priced according to their AC current capacity and you won't require more then 1 amp if your just switching light bulbs on and off.
Here is an example of a nice deal making them about $5 each including shipping within the US, not that it helps you in the UK
You need a 12 DC power supply. This can be from the same mains source.
I did this recently like you for the first time (a couple of weeks ago) with a 240v to 12v Transformer, a Bridge rectifier and a 12v Voltage regulator.
I then have a TIP120 power transistor triggered by the arduino which releases the ground pin of the relay coil to ground.
You need to be sure that your transformer is powerful enough for your relay and your relay's consumption largely depends on how much power (Amps) it's going to switch.
I wouldn't use energy saving bulbs under any circumstances for the job you are thinking of. They are not designed to be switched rapidly. They take time to warm up and each time you switch them they draw quite a lot of power initially. Better to stick with incandescent and warm them up first too.
Wow ok I didn't realise its THAT simple with these relays. Great! Except that my usual retailer, rapid electronics, sells these at £9.15 per relay ... ouch!
"Pack of 10 solid state relays SMT 2000 / 4 3 -32vdc operation and will switch up 240vac at 4A" ~£18
Sounds like a bargain! Do I take the specs to mean I need to switch on the relay by applying between 3 and 32 volts DC across the input terminals ... to make some solid-state magic happen* and therby short the two output pins, completing the lamp circuit ...?
Also, the arduino-side of the circuit and the lamp-side of the circuit being isolated, I take it that I definately should not connect arduino ground the my mains supply ground ... ? just checking!
Yes, those 10 pack are a very good deal. And you connect the input + to the Aurduino output pin the - input to the Aurduino ground (common) and the relay's two output pins go in series with the load's hot wire. And of course you DO NOT hook the AC neutral or ground in anyway to the Aurduino. The solid state relay uses an internal opto-isolator to insure there is no direct connection between control and load.
So don't fool around much longer and pull the trigger on that bargain
D'oh missed everyone elses replies when posting my own.
Ideally I'd like to keep this simple as possible, to prevent too many things going wrong! Jim H, that seems a lot more complicated than the solid state relay method - what are the pros of using a 12V DC power supply to achieve this?
Hmm whether to use energy-saving bulbs or filament bulbs ... the context for this project is that I'm shooting a music video for a friend, and the 'stage' is going to be a ring of 10 angle poise lamps surrounding the artist, flashing in time with the music (done with a lookup table, nothing fancy with beat-detection just yet!). I'm using anglepoise lamps because each room in my college dorm comes with one as standard - I can easily get hold of about 12 for my use, and they all come with energy-saving bulbs fitted as standard, so it'd be nice to use them, as its free. I'd hate to buy new filament bulbs on top of all this extra hardware. ... perhaps I'll do some tests on the lamp in my own dorm room, switch it about a bit, see how much abuse it can take before I blow up all my friend's lamps! If it really doesn't work with these energy saving bulbs I'll bite the bullet and go incandescent.
"If you open up the transmitter you can probably get the Arudino to close the contacts using an opto-coupler. "
Do you think each transmitter is on a unique frequency? He wants to control ten lamps in a timed sequence.
Those AC remote control device send a signal that includes a device address, the one linked is designed to address 12 separate devices. And the chip it uses actually has 12 bit addressing, so thousands can theoretically be controlled.
But I agree that the Solid State Relay deal seems a good way to go for this project. Just be careful about the 240 volt wiring