I'm trying to build a circuit to switch a 5v relay that will operate an appliance plugged into the wall, but am having trouble understanding the schematic shown in the playground:
I am trying to run the circuit from the blink example (to check i've got the circuit right before worrying about the code), but nothing happens. I've tried various wiring configurations. The relay works fine when all other components are removed, and attached to pin13/gnd or 5v/gnd.
I tried to attach a photo, but just got 'img', so here is my circuit at the moment:
5V-RESISTOR-TRANSISTOR BASE
FROM TRANSISTOR: EMITTER TO GROUND, COLLECTOR-DIODE-RELAY-GROUND
Both transistor and relay are grounded to the GND pin next to 5V on the Arduino.
Excuse my ignorance, but am not sure what is meant by 'in parallel'.
I had changed the circuit to:
5V-Relay-Diode-Collector(Emitter to GND)-Base-Resistor-Digital Out and it seemed to be working fine.
Should it instead go:
5V-Relay AND Diode-Collector(Emitter to GND)-Base-Resistor-Digital Out? This works fine too. Is this better? In Parallel? Less likely to blow something up?
If so, am I ok to go ahead and attach the Live wire from a three core extension cable to the relay, ignoring the ground and neutral?
That's brilliant, guys. Thank you both. This circuit has been driving me crazy. I'm in England, so will have to have a look to see if I can find one of those power switches to fit a 3 pin 240v socket. Looks just what I need.
Ben ------
It is real real really easy if you use a PowerSwitchTail (by Adafruit for $20). Don't hesitate to call me at 951-461-0757.
------ nickynichols
to use the arduino to switch an extension lead connected to 240vac)
The contacts are only rated for 1A at this voltage so an extension lead no, it is possible to plug 13A into it and that would weld the contacts shut or cause a fire. Look for contacts rated at least 20A if you want to switch 13A. It will be a much bigger relay than this.
You shouldn't be messing about with mains if you have to ask these questions.
Don't worry. I'm not a moron. I'm not going to connect the mains until I know what I'm doing. I want to get the components together before I go back to uni and can get a hand from the workshop technician.
Good! But one never knows who's going to read these posts... after all... half the world is of below average intelligence. And only half the world... 1 in 10... understands binary.
ANYWAY... besides getting the right components, it is also important to get the physical assemblage of them right. Fires start from the most IMPROBABLE things. Probable or not... they happen. Not you you, if you get the right advice!
(This posted not just for bngllghr, but for the many, we hope, people who will visit the thread in the future)