This circuit is designed to activate a solenoid using an IR remote control. When the '1' button on the remote is pressed, the Arduino 101 microcontroller activates a relay, which in turn powers the solenoid. The circuit includes an IR receiver to capture signals from the remote, a 12V battery to power the solenoid and relay, and a rocker switch to control the power supply.
Solenoid
Arduino 101
Rocker Switch
Battery 12V
HX1838 Infrared IR Wireless Remote Control
IR Receiver
12V Relay
/*
* This Arduino sketch is designed to activate a relay when the '1' button on
* an IR remote control is pressed. The relay, in turn, activates a solenoid.
*/
#include <IRremote.h>
const int RECV_PIN = 2; // Pin connected to IR receiver DATA pin
const int RELAY_PIN = 4; // Pin connected to relay IN pin
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
pinMode(RELAY_PIN, OUTPUT);
irrecv.enableIRIn(); // Start the IR receiver
}
void loop() {
if (irrecv.decode(&results)) {
if (results.value == 0xFFA25D) { // '1' button on the remote
digitalWrite(RELAY_PIN, HIGH); // Activate relay
delay(1000); // Keep relay on for 1 second
digitalWrite(RELAY_PIN, LOW); // Deactivate relay
}
irrecv.resume(); // Receive the next value
}
}
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used in the microcontrollers.