![]() ![]() This 12vdc is also connected to the Arduino VIN input so that both units can be powered by the 12vdc coming in. There is a 2-pin screw terminal for an external 12vdc to power the relay. The Relay is controlled by the Arduino Digital outputs and the DIP Switches are connected to the Arduino Analog inputs. This relay kit will plug directly on top of your Arduino UNO. It also includes a 2-position DIP Switch so that you can add some options to your program. It consists of an Arduino-compatible Shield with a 12v Relay. This combination gives rise to a many possibilities from turning the kettle on when the front door opens (who doesn't want a cup of tea or coffee when they get home), sending an email message (with an attached photograph) to you when someone goes into your workshop, watering your precious vegetable patch when the soil moisture level gets too low, how about an automatic alert to a carer when your blood sugar gets too low? You are only limited by your imagination, budget and (to some degree) the availability of sensors.This is the Arduino-Compatible Relay Shield PCB Kit. On the other side of the circuit, the Arduino is a 5V device and can interact with 5V (and 3.3V) sensors and digital equipment. ![]() Because the relay can handle up to 250V it will be able to control power to any 240V device in the house from lights to audio equipment. This circuit has so many applications in home automation and for internet of things jiggery-pokery. You may (or may not) notice that I disconnected the redundant LED from the circuit. Finally, I provided power to the Arduino and, yay, an 8V lamp blinky was born. The Common lead and the Negative lead were then connected to an 8V lamp (something that I use for circuit testing as it is a good indication of load). I cut another piece of wire and tinned both ends and put it into the common (C) screw terminal on the relay (channel 1). Then I tinned the positive lead and put it into the normally open (NO) screw terminal on the relay (channel 1). To do that, I simply cut the connection from the end of the wall wart, soldered an extension onto the negative lead (to make it longer and with a heat shrink shield). I'll show the relay in action in that later instructable.Īfter a little bit of effort, I cut up an old 5V DC wall wart to make a simple power supply on the relay side of the circuit. I'm going to make a garden watering system for my vegetable patch using this circuit with a 120L/hour pump and a simple hygrometer. unless you change the value of "delayValue" of course.Īs mentioned earlier, this is a very simple instructable without many parts and with a fairly terse description. When you have connected the module to the Arduino, uploaded the sketch and powered it up, you'll get a click a second. When the relay toggles OPEN and CLOSED, there will be an audible *CLICK* for each transition. In this configuration, the relays are not supplying a load, but they are working. The relays can be operated independently, so you can use the 2 Relay Module to control two devices independently, maybe in response to 2 different sensors? In the loop() we are just switching the state from HIGH to LOW for both of the relays. Test your relay and don't just believe that it's either ON or OFF. In setup() the relays are prepared using pinMode:ĭepending on how you are connecting your load to the relay NO = Normally Open or NC = Normally Closed, it's a pretty safe idea to ensure that the relay is initially OFF (in my case, that's HIGH). Note that I am passing A0, A1 as integers. ![]() The two relays are dimensioned in the top of the sketch: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |