You can change the humidity at which the relay turns on and off in line 20, where it says if (DHT. If the humidity goes above 40%, the program tells the Arduino to output a LOW signal at pin 8, and the light bulb will be switched off. Therefore, the light bulb will be on below 40% relative humidity. FREE delivery Thu, Nov 9 on 35 of items shipped by Amazon. This program takes the humidity data output by the DHT11 and tells the Arduino to output a HIGH signal at pin 8 until the humidity reaches 40% or greater. 5v Relay Module 1 Channel Relay Board for Raspberry Pi with Opto-Isolated High or Low Level Trigger 5v 1 Channel Relay Switch for Arduino. Here’s a diagram that outlines the connections:Īfter making all of the connections, we’re ready to program the Arduino. Upload this program to the board to control the outlet with the DHT11: #include The 5V relay will turn on the current to the outlet whenever it receives a 5V signal from the Arduino. The negative (neutral) wire and the ground wire will be connected directly from the power cord to the outlet. We will install the 5V relay in-line with the positive (hot) wire of the 120-240V power outlet in the normally open configuration. PLEASE PROCEED WITH CAUTION, AND ALWAYS MAKE SURE CIRCUITS ARE UN-PLUGGED BEFORE WORKING ON THEM. It has two relays, each with a maximum current rating of 10A. WARNING!! – THIS PROJECT INVOLVES WORKING WITH HIGH VOLTAGES THAT CAN CAUSE SERIOUS INJURY, DEATH, AND/OR SET YOUR HOUSE ON FIRE. The two-channel relay module is designed to allow your Arduino to control two high-powered devices. Building the Arduino Controlled Power Outlet In this project, we’ll connect a power outlet box to a grounded extension cord and install a 5V relay inside the box so we can control it with the Arduino. That way you can use it for multiple devices without having to re-wire the relay or cut into the device’s power supply. The example we’ll build shows how to control a relay module with an Arduino and a PIR motion sensor. We make a brief introduction to the relay module and build a simple project example with the Arduino. We could always wire the relay directly to the device we want to control, but it’s more practical to go one step closer to the source and switch the power at the outlet. This article shows how to control mains voltage with the Arduino using a relay module. To learn more about the 5V relay and it’s different modes of operation, see our article “ How to Set Up a 5V Relay on the Arduino“. We’ll use the Arduino and a sensor to control when the relay switches. At 150☏ the relay shuts off and the current stops.In this tutorial, we’ll be using a 5V relay to switch the current to a power outlet on and off. In this example, the relay will stay activated and let current flow through the light bulb until the temperature of the thermistor reaches 150☏. Should be connected to an Arduino digital pin. The connections between the relay and the Arduino are really simple: IN1: controls the first relay. The CodeĪfter everything is connected, upload this code to the Arduino: #include See our article on Making an Arduino Temperature Sensor for more information. If you do use a 100K Ω thermistor, you’ll need to change line 7 in the code below to Temp = log(100000.0*((1024.0/RawADC-1))). If you use a 100K Ω thermistor, use a 100K Ω resistor. For example, I’m using a 10K Ω thermistor, so the resistor should be 10K Ω as well. The value of the resistor should be the same order of magnitude as the thermistor. The thermistor part of the circuit is set up as a voltage divider. It’s dangerous to put the relay on the neutral wire, since if the device fails current can still fault to ground when the relay is off. This way the relay is on the hot side, and current is switched before it reaches the light bulb. Connect the side leading to the light bulb to the NO terminal of the relay, and the side leading to the plug to the C terminal. Identify the hot power wire (red wire in the diagram above) in the cord leading to the light bulb and make a cut.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |