Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Uno IR Remote Control with Pushbutton Interface

View and Edit Project In Cirkit DesignerImage of Arduino Uno IR Remote Control with Pushbutton Interface

Circuit Documentation

Summary

This circuit is designed to read the voltage from a voltage divider network formed by pushbuttons and resistors. When a button is pressed, the corresponding voltage level is read by an Arduino Uno R3, which then generates an IR code using an IR transmitter. The circuit includes multiple pushbuttons, resistors, an IR transmitter, and an Arduino Uno R3 microcontroller.

Component List

  1. IR Transmitter

    • Pins: DAT, VCC, GND
    • Description: Transmits infrared signals.
    • Purpose in Circuit: Sends IR codes based on the input from the Arduino.
  2. Arduino Uno R3

    • Pins: D8, D9, D10, D11, D12, D13, GND, AREF, SDA, SCL, D0/RX, D1/Tx, D2, D3, D4, D5, 6, D7, A5/SCL, A4/SDA, A3, A2, A1, A0, Vin, 5V, 3.3V, RESET, IOREF, NONE, USB Jack, Power Jack
    • Description: Microcontroller board based on the ATmega328P.
    • Purpose in Circuit: Reads voltage levels from the voltage divider network and sends corresponding IR codes.
  3. Pushbutton

    • Pins: Pin 2, Pin 1, Pin 3, Pin 4
    • Description: Mechanical switch that can be pressed to make or break a connection.
    • Purpose in Circuit: Forms part of the voltage divider network to provide different voltage levels when pressed.
  4. Resistor

    • Pins: pin1, pin2
    • Description: 200 Ohms resistor.
    • Purpose in Circuit: Forms part of the voltage divider network to provide different voltage levels.

Wiring Details

IR Transmitter

Arduino Uno R3

Pushbuttons

Resistors

Code Documentation

/*
 * This Arduino sketch reads the voltage from pin A0, which is connected to a
 * voltage divider network formed by pushbuttons and resistors. When a button
 * is pressed, the corresponding voltage level is read, and the Arduino
 * generates an IR code using the IR transmitter connected to pin D2.
 */

#include <IRremote.h>

const int irPin = 2; // IR Transmitter connected to pin D2
const int analogPin = A0; // Voltage divider network connected to pin A0
IRsend irsend;

void setup() {
  pinMode(irPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  int analogValue = analogRead(analogPin);
  Serial.print("Analog value: ");
  Serial.println(analogValue);

  if (analogValue < 100) {
    // Button 1 pressed
    irsend.sendNEC(0xFFA25D, 32); // Example IR code
  } else if (analogValue < 200) {
    // Button 2 pressed
    irsend.sendNEC(0xFF629D, 32); // Example IR code
  } else if (analogValue < 300) {
    // Button 3 pressed
    irsend.sendNEC(0xFFE21D, 32); // Example IR code
  } else if (analogValue < 400) {
    // Button 4 pressed
    irsend.sendNEC(0xFF22DD, 32); // Example IR code
  } else if (analogValue < 500) {
    // Button 5 pressed
    irsend.sendNEC(0xFF02FD, 32); // Example IR code
  }

  delay(100); // Debounce delay
}

This code reads the voltage from pin A0, which is connected to a voltage divider network formed by pushbuttons and resistors. When a button is pressed, the corresponding voltage level is read, and the Arduino generates an IR code using the IR transmitter connected to pin D2.