You’ll need to cut your live AC line and connect one end of the cut wire (coming from the wall) to COM and the other to NC or NO, depending on what you want your device’s initial state to be. You’ll also need to connect the relay module to the AC-powered device you want to control, in this case, a lamp. We will only be using one relay for our experiment, so connect digital pin #6 to the IN1 input pin. Therefore, it is intended for people who are familiar with and knowledgeable about HIGH AC voltage.īegin by connecting the module’s VCC pin to the Arduino’s 5V pin and the GND pin to ground. Improper or incorrect use could result in serious injury or death. Warning: This board interacts with HIGH AC voltage. Now that we know everything about the relay module, it’s time to put it to use! Let’s wire up our relay module to operate a lamp. Wiring a Two-Channel Relay Module to an Arduino NO terminal is normally open, unless you activate the relay that connects it to the COM terminal. NC terminal is normally connected to the COM terminal, unless you activate the relay, which breaks the connection. Output Terminals:ĬOM terminal connects to the device you intend to control. Keep this pin disconnected if you remove the jumper. VCC pin is shorted to the JD-VCC pin with the jumper cap on. Without the jumper cap, you’d have to connect it to a separate 5V power source. When the jumper is in place, JD-VCC is shorted to VCC, allowing the electromagnets to be powered by the Arduino’s 5V line. JD-VCC provides power to the relay’s electromagnet. These are active low pins, which means that pulling them LOW activates the relay and pulling them HIGH deactivates it. VCC pin provides power to the built-in optocouplers and, optionally, the relay’s electromagnet (if you keep the jumper in place). Here’s a small animation showing how a relay links two circuits together. A relay can be thought of as an electric lever you turn it on with a relatively small current, and it turns on another device with a much larger current. How Do Relays Work?Īt the core of a relay is an electromagnet (a wire coil that becomes a temporary magnet when electricity is passed through it). This tutorial will walk you through setting up the relay module to turn on a lamp or other device, but first, a quick primer on relays. The only downside is that, because these are electro-mechanical devices, they are more prone to wear and tear over time. These well-contained modules are inexpensive, simple to connect, and ideal for home-brew projects that require switching modest amounts of AC or DC power. This is where relay modules come into play. However, because the Arduino runs on 5 volts, it cannot directly control these high-voltage appliances. In your upcoming project, you might want to use your Arduino to control a high-voltage device, like a lamp, fan, or other household appliance.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |