User Tools

Site Tools


digispark:tutorials:relay

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

digispark:tutorials:relay [2013/03/29 06:57]
PeterMortensen [Programming:] Copy edited [8]. Replaced TABs with spaces to ease formatting, etc.
digispark:tutorials:relay [2016/06/09 12:03]
Line 1: Line 1:
-======Relay Shield Kit Tutorial====== 
- 
-=====Product Description:​===== 
-[[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 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. 
- 
-=====Parts:​===== 
- 
-^ Part       ^ Quantity ​         ^Identification^ 
-| Relay Shield PCB|1| | 
-| Omron G5Q Relay|1| | 
-| 3.5mm pitch 2-pin screw terminal|1| | 
-| 2N3904 NPN Transistor|1| | 
-| 10k Ohm 1/4W 5% Resistor|1| Brown - Black - Orange| 
-| 1N4001 Diode|1| | 
-| 1x40pin male 0.1" pitch header| 9 pins worth| | 
- 
-**Soldering:​** If you are new to soldering we recommend the following tutorials: 
-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 
- 
-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!** 
- 
- 
-=====Assembly:​===== 
- 
-Empty kit bag (or if using a raw PCB, aquire parts) and verify contents. ​ 
-**Note for Kickstarter Backers and Pre-orders:​** Headers are not included in each kit bag, but the entire order came with more than enough headers for all kits. 
- 
-[[https://​s3.amazonaws.com/​digispark/​images/​m/​relay1.jpg|{{https://​s3.amazonaws.com/​digispark/​images/​t/​relay1.jpg}}]] 
- 
-Insert resistor and diode - the diode goes on the bigger outline with the line on one side. Be sure the direction line on the diode is on the same side as the line printed on the board. Solder the leads and clip off the excess. ​ 
- 
-[[https://​s3.amazonaws.com/​digispark/​images/​m/​relay2.jpg|{{https://​s3.amazonaws.com/​digispark/​images/​t/​relay2.jpg}}]] 
- 
-Insert the transistor, matching the shape with the printing on the board. Solder the leads and clip off excess. 
- 
-[[https://​s3.amazonaws.com/​digispark/​images/​m/​relay3.jpg|{{https://​s3.amazonaws.com/​digispark/​images/​t/​relay3.jpg}}]] 
- 
-Insert the 2-pin screw terminal with the hookup openings facing outward. Solder the two pins. 
- 
-[[https://​s3.amazonaws.com/​digispark/​images/​m/​relay4.jpg|{{https://​s3.amazonaws.com/​digispark/​images/​t/​relay4.jpg}}]] 
- 
-Insert the the relay and solder all pins. 
- 
-[[https://​s3.amazonaws.com/​digispark/​images/​m/​relay5.jpg|{{https://​s3.amazonaws.com/​digispark/​images/​t/​relay5.jpg}}]] 
- 
-Cut a length of male headers 6 pins long and one 3 pins long. Insert into corresponding positions (on the bottom of the board) and solder each pin. 
- 
-[[https://​s3.amazonaws.com/​digispark/​images/​m/​relay6.jpg|{{https://​s3.amazonaws.com/​digispark/​images/​t/​relay6.jpg}}]] 
- 
-**Tip:** Inseting the headers into a breadboard and then placing the board on top can make this process easier. 
- 
-**Note:** If you are using stackable headers, use them here instead of the standard male headers. 
- 
-**CAUTION:​** Care must be used with working with live AC loads, Digistump LLC takes no responsability for injury, damage, or death that may result from imporper connection of the relay shield. ​ 
- 
-=====Programming:​===== 
- 
-The relay can be turned on and off by simply setting P5 high or low (just like blinking the LED in the blink demo). The relay is normally open, so it will be off unless P5 is set high. 
- 
-The relay can also be connected to P2 by cutting the thin trace between the solder number next to P5 and bridging the other solder jumper with solder. 
- 
-<​code>​ 
-void setup() { 
-    // Initialize the relay pin as output 
-    pinMode(5, OUTPUT); 
-} 
- 
-void loop() { 
-    digitalWrite(5,​ HIGH); ​   // Turn the relay on 
-    delay(1000); ​             // Wait for a second 
-    digitalWrite(5,​ LOW);     // Turn the relay off 
-    delay(1000); ​             // Wait for a second 
-} 
-</​code>​ 
  
digispark/tutorials/relay.txt · Last modified: 2016/06/09 12:03 (external edit)