703
edits
(Created page with "A relais is a switch which can be triggered by a voltage (and current flowing). Most relais consist of an electromagnet which pulls or pushes on magnetic components in the relais...") |
No edit summary |
||
Line 29: | Line 29: | ||
== Using relais on Arduino (logic level outputs) == | == Using relais on Arduino (logic level outputs) == | ||
The coil of most relais can't be directly connected to a microcontroller's output as they don't have sufficient power (Arduino: 20mA and 5V per pin - most | The coil of most relais can't be directly connected to a microcontroller's output as they don't have sufficient power (Arduino: 20mA and 5V per pin - most relays use 40 mA and more). So amplification is necessary, for example using transistors or darlington-Arrays like ULN2003 or similar. Also since we are switching a coil it is necessary to add a freewheeling (fly back) diode to protect the circuit. | ||
=== switching 230V without danger === | |||
Relais are a good solution to interface with high voltages like AC mains voltages. However there still remain problems like properly connecting wires, insulation, having a box to put it in - and everything has to be safely done to prevent fire or electric shocks. In many cases a switchable mains plug is sufficient, for example to switch some 230V equipment on or off via Arduino. Luckily the industry built something for us which does exactly what we need: USB master/slave plugs. They have an USB connector which usually goes into an USB socket of a computer and 4 sockets which are switched on and off via a relay inside the socket. The relay's coil is simply powered by the USB port of the computer - which means it runs on 5V - so whenever the computer turns on the USB port will be powered with 5V and the relay switches the 4 sockets on. | |||
To use the Master/Slave powerboard with your circuit you can either use the USB plug but then you need a USB-socket for it - or simply cut the USB plug. There will be 2 wires - their polarity is important as there's a fly back diode already installed in parallel to the relay. Simply measure which cable went to pin 1 (negative) and pin 4 (positive) of the USB plug you have cut (see [[Wikipedia:Usb]] for the pinout). Don't trust the color coding of the cable, they often differ from standards. | |||
== Links == | == Links == | ||
Different | Different cheap USB triggered 230V Sockets: | ||
* http://www.google.com/search?q=B004UW2VFQ | |||
* http://www.google.com/search?q=B000KPS3FY | |||
* http://www.google.com/search?q=B004UVKBDG | |||
* http://www.google.com/search?q=B005X4IW3A | |||
Schematics and explanation: logic level outputs and relais (German): | |||
http://www.mikrocontroller.net/articles/Relais_mit_Logik_ansteuern | http://www.mikrocontroller.net/articles/Relais_mit_Logik_ansteuern | ||
[[Category:Electronics]] | [[Category:Electronics]] | ||
[[Category:Martin Schied]] | [[Category:Martin Schied]] |
edits