Wiring the Light and Relay
Caution!!! In this section we will be working with 120v AC (wall outlets) DO NOT touch exposed wire when circuits are attached to power Be mindful of which sections of the relay are low voltage vs. high voltage as miss-wiring may result in shorted out devices or electric shock
Relays 101 Relays come in two types: Mechanical and Solid State We will use a mechanical relay Mechanical relays use a magnet to switch the circuit This allows for low voltage to control high voltage circuits We will be using the JZV-11F relay Datasheet available on course site
Analyzing the Datasheet We can see on page 3 that there are 5 pins The 2 at the bottom are attached to the magnet. According to the sheet they rated for 12V The 3 pins are the switch One side is normally open while the other is normally closed This refers to the state when the magnet is not energized The diagram shows us that the lone pin is the common while the two diagonal are the switched pin We want to connect our lamp to the normally open pin (the top one) so that the light will default to being off
The relay
Stock puck light
Add 2 prong plug to the end of the cable
Slide on the cover to push wire on pins
Test the lamp Plug the two prong plug into the outlet The light should turn on It is important to test the lamp before introducing the relay to the circuit to make debugging issues easier
Cut off the extra wire leaving about 6 inch long leads from the light
Strip about ½ inch from the ends
Slide 1” of heat shrink tubing on each wire
Prep the socket from the power supply so the black and white wires have free ends
Strip ½ inch from the end of the black and white wires
Pass the white wire through the square socket hole (since the socket goes on the outside and the lamp on the inside)
Twist the white wire with one of the leads on the lamp, solder the connection, then cover with heat shrink tubing
Twist the black wire to a 6” piece of extra wire and solder (not the second lead of the lamp!)
Cover with heat shrink
Solder a wire to each of the low voltage pins (a picture of a coil appears above them). Take the extension to the black wire and place it on the common pin of the relay. Be sure to place a piece of heat shrink on the wire before making the connection.
Solder the connection and place the tubing over the joint Solder the connection and place the tubing over the joint. Also place a piece of heat shrink tubing on the normally closed pin to insulate it
Solder the second lead from the lamp to the open pin on the relay (again remember to put heat shrink on the wire before connecting)
After soldering and heat shrinking the final connection, wrap the plug in electrical tape covering all connections
Do the same for the relay
Mount the plug back to the power supply
Adhere the lamp to the chamber bottom using hot glue Adhere the lamp to the chamber bottom using hot glue. Be sure to leave space for the small internal breadboard when positioning
Testing Time We will be using our Arduino as a 5 volt supply and the wall outlet for the 120 volt source When energizing the relay (completing the circuit between the 5 volt output and ground with the low voltage leads) one should hear a clicking sound. This is normal and is the sound of the magnet moving the bar which completes the circuit
Power Cable
Attached to 120 Source
Ground Lead attached to Arduino
Connecting the other lead to the 5 volt port will turn the relay on and control the lamp (remove either lead to turn it off)