This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
digispark:tutorials:relay [2012/12/18 23:33] digistump created |
digispark:tutorials:relay [2016/06/09 12:03] (current) |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| [[https://s3.amazonaws.com/digispark/images/m/relay1.jpg|{{https://s3.amazonaws.com/digispark/images/t/relay1.jpg}}]][[https://s3.amazonaws.com/digispark/images/m/relay7.jpg|{{https://s3.amazonaws.com/digispark/images/t/relay7.jpg}}]][[https://s3.amazonaws.com/digispark/images/m/relay6.jpg|{{https://s3.amazonaws.com/digispark/images/t/relay6.jpg}}]] | [[https://s3.amazonaws.com/digispark/images/m/relay1.jpg|{{https://s3.amazonaws.com/digispark/images/t/relay1.jpg}}]][[https://s3.amazonaws.com/digispark/images/m/relay7.jpg|{{https://s3.amazonaws.com/digispark/images/t/relay7.jpg}}]][[https://s3.amazonaws.com/digispark/images/m/relay6.jpg|{{https://s3.amazonaws.com/digispark/images/t/relay6.jpg}}]] | ||
| - | The Relay Shield Kit connects a Omron G5Q relay to the Digispark development board. This allows the Digispark to turn AC and DC loads on and off up to 250VAC. The relay is rated for 3A@125VAC, 3A@250VAC, and 5A@30VDC. | + | The Relay Shield Kit connects a Omron G5Q relay to the Digispark development board. This allows the Digispark to turn AC and DC loads on and off up to 250 VAC. The relay is rated for 3 A @125 VAC, 3 A @250 VAC, and 5 A @30 VDC. |
| This is an unassembled kit and requires basic soldering. This is designed for use with the Digispark development board, which is not included. | This is an unassembled kit and requires basic soldering. This is designed for use with the Digispark development board, which is not included. | ||
| - | |||
| =====Parts:===== | =====Parts:===== | ||
| Line 16: | Line 15: | ||
| | 3.5mm pitch 2-pin screw terminal|1| | | | 3.5mm pitch 2-pin screw terminal|1| | | ||
| | 2N3904 NPN Transistor|1| | | | 2N3904 NPN Transistor|1| | | ||
| - | | 10k Ohm 1/4W 5% Resistor|1| Brown - Black - Orange| | + | | 1k Ohm 1/4W 5% Resistor (previously 10k)|1| Brown - Black - Red | |
| | 1N4001 Diode|1| | | | 1N4001 Diode|1| | | ||
| | 1x40pin male 0.1" pitch header| 9 pins worth| | | | 1x40pin male 0.1" pitch header| 9 pins worth| | | ||
| Line 23: | Line 22: | ||
| Soldering Basics (http://www.sparkfun.com/tutorials/106) and Soldering Crash Course from the folks at Sparkfun (http://www.sparkfun.com/tutorials/354). | Soldering Basics (http://www.sparkfun.com/tutorials/106) and Soldering Crash Course from the folks at Sparkfun (http://www.sparkfun.com/tutorials/354). | ||
| How to solder from the Curious Inventor: http://store.curiousinventor.com/guides/How_to_Solder | How to solder from the Curious Inventor: http://store.curiousinventor.com/guides/How_to_Solder | ||
| + | |||
| + | Adafruit has this excellent guide that starts with the tools needed and then shows detailed pictures, including some of the common problems that beginners experience (http://learn.adafruit.com/adafruit-guide-excellent-soldering) | ||
| **We assume for these assembly instructions that you know the basics of thru-hole soldering. If you don't check out the links above, these boards are very easy to solder - we promise!** | **We assume for these assembly instructions that you know the basics of thru-hole soldering. If you don't check out the links above, these boards are very easy to solder - we promise!** | ||
| Line 67: | Line 68: | ||
| <code> | <code> | ||
| - | void setup() { | + | void setup() { |
| - | // initialize the relay pin as output | + | // Initialize the relay pin as output |
| - | pinMode(5, OUTPUT); | + | pinMode(5, OUTPUT); |
| } | } | ||
| void loop() { | void loop() { | ||
| - | digitalWrite(5, HIGH); // turn the relay on | + | digitalWrite(5, HIGH); // Turn the relay on |
| - | delay(1000); // wait for a second | + | delay(1000); // Wait for a second |
| - | digitalWrite(5, LOW); // turn the relay off | + | digitalWrite(5, LOW); // Turn the relay off |
| - | delay(1000); // wait for a second | + | delay(1000); // Wait for a second |
| } | } | ||
| </code> | </code> | ||
| + | |||