When you have uploaded the code to your Arduino/Seeeduino board the motor should run one second, stop for another second and repeat the process indefinitely. the loop routine runs over and over again forever:ĭigitalWrite(MotorControl,HIGH) // NO3 and COM3 Connected (the motor is running)ĭelay(1000) // wait 1000 milliseconds (1 second)ĭigitalWrite(MotorControl,LOW) // NO3 and COM3 Disconnected (the motor is not running) the setup routine runs once when you press reset: Int MotorControl = 5 // Digital Arduino Pin used to control the motor Connect the DC motor and Relay Shield as shown in the schematic and figure below: Now that you know how a relay works internally, let us show you how to use the Relay Shield.ġ.Stack the Relay Shield onto the Arduino development board.Ģ.Connect Arduino to your PC using a USB cable.ģ.We will use RELAY3 to control the DC motor. Pins 4, 5, 6, and 7 control relays 4, 3, 2, and 1 respectively. In the case of the Relay Shield, the two “Control Circuit” terminals for each of the four relays are controlled by only one Arduino Digital I/O pin. Some practical relay applications include: control of high voltage using low voltage, motor control, remote control, anti-hearing alarm, automatic temperature alarm, incubators and son on.Ī motor control application with one relay and one motor is shown below: when a voltage and current is applied to the coil), the current and coil create a magnetic field which is able to attract the COM terminal towards the NO terminal, when the control circuit removes the applied voltage and current the COM terminal returns to contact the NC terminal due to a mechanical force (usually a spring). Relays are basically electromagnetic switches: when the relay is energized by the control circuit (i.e. Additionally the 5V and two GND Arduino pins are also required to power up the Relay Shield. Only four Arduino Digital I/O pins, pins 4-7, are required to control the four different relays. ![]() **Terminals J2-4 are similar to J1 except that they control RELAY2-RELAY4 respectively. NO1 (Normally Open): This terminal will be connected to COM1 when the RELAY1 control pin (Digital 7 I/O pin) is set high and disconnected when the RELAY1 control pin is set low. NC1 (Normally Closed): This terminal will be connected to COM1 when the RELAY1 control pin (Digital 7 I/O pin) is set low and disconnected when the RELAY1 control pin is set high. Digital 7 – controls RELAY1’s COM1 pin (located in J1)ĬOM1 (Common Pin) : The relay pin controlled from the digital pin.Digital 6 – controls RELAY2’s COM2 pin (located in J2).Digital 5 – controls RELAY3’s COM3 pin (located in J3).Digital 4 – controls RELAY4’s COM4 pin (located in J4).Do not operate voltage more than 35V DC.This will prevent the relay shield from making contact. Please place 2 layers of electrical tape on the top of the Arduino's usb connector.COM, NO (Normally Open), and NC (Normally Closed) relay pins for each relay. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |