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

Arduino 101 and HC-05 Bluetooth Controlled Multi-IR Sensor and LED System

View and Edit Project In Cirkit DesignerImage of Arduino 101 and HC-05 Bluetooth Controlled Multi-IR Sensor and LED System

Circuit Documentation

Summary

This circuit involves multiple IR sensors, an Arduino 101 microcontroller, a Bluetooth module (HC-05), micro servos, LEDs, pushbuttons, a rocker switch, and buzzers. The circuit is designed to detect IR signals, control LEDs and servos, and communicate via Bluetooth. The Arduino 101 microcontroller is the central unit that processes inputs from the IR sensors and pushbuttons and controls the outputs to the LEDs, servos, and buzzers.

Component List

  1. IR Sensor

    • Pins: out, gnd, vcc
    • Description: Infrared sensor used for detecting IR signals.
  2. Arduino 101

    • Pins: A5/SCL, A4/SDA, AREF, GND, D13/SCK, D12/MISO, D11 PWM/MOSI, D10 PWM/SS, D9 PWM, D8, D7, D6 PWM, D5 PWM, D4, D3 PWM, D2, D1/TX, D0/RX, AIN, ioref, RESET, 3V3, 5V, VIN, A0, A1, A2, A3, ICSP MISO, ICSP SCK, ICSP MOSI
    • Description: Microcontroller used for processing inputs and controlling outputs.
  3. Micro Servo 9G

    • Pins: GND, +5V, PWM
    • Description: Small servo motor used for precise control of angular position.
  4. HC-05

    • Pins: STATE, RXD, TXD, GND, VCC, EN
    • Description: Bluetooth module used for wireless communication.
  5. LED: Two Pin (orange)

    • Pins: cathode, anode
    • Description: Orange LED used for visual indication.
  6. LED: Two Pin (green)

    • Pins: cathode, anode
    • Description: Green LED used for visual indication.
  7. Resistor

    • Pins: pin1, pin2
    • Description: Resistor with a resistance of 220 Ohms.
  8. Pushbutton

    • Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
    • Description: Pushbutton used for user input.
  9. Rocker Switch

    • Pins: output, input
    • Description: Rocker switch used for toggling states.
  10. Buzzer

    • Pins: PIN, GND
    • Description: Buzzer used for sound output.

Wiring Details

IR Sensor

IR Sensor

IR Sensor

IR Sensor

Arduino 101

Micro Servo 9G

Micro Servo 9G

HC-05

LED: Two Pin (orange)

LED: Two Pin (green)

LED: Two Pin (orange)

LED: Two Pin (green)

LED: Two Pin (orange)

LED: Two Pin (green)

LED: Two Pin (orange)

LED: Two Pin (green)

Resistor

Pushbutton

Rocker Switch

Buzzer

Buzzer

Documented Code

Arduino 101 (Instance 1)

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Arduino 101 (Instance 2)

#include <SoftwareSerial.h>

SoftwareSerial BT(10, 11); // RX, TX for HC-05

// Define LED pin pairs (OLED and GLED)
const int oledPins[] = {2, 4, 6, 8};  // OLED pins
const int gledPins[] = {3, 5, 7, 9};  // GLED pins
const int numLEDs = 4;

// Define potentiometer pin
const int potPin = A0;  // Potentiometer connected to analog pin A0

void setup() {
  Serial.begin(9600);  // Serial Monitor communication
  BT.begin(38400);     // Bluetooth module baud rate

  // Initialize all pins as OUTPUT
  for (int i = 0; i < numLEDs; i++) {
    pinMode(oledPins[i], OUTPUT);
    pinMode(gledPins[i], OUTPUT);
  }

  // Initialize all LEDs to be OFF
  for (int i = 0; i < numLEDs; i++) {
    digitalWrite(oledPins[i], LOW);
    digitalWrite(gledPins[i], LOW);
  }

  Serial.println("Slave ready...");
}

void loop() {
  if (BT.available()) {
    String command = BT.readStringUntil('\n');
    command.trim();  // Remove any extra spaces

    Serial.println("Received: " + command);

    // Match command and control LEDs accordingly
    if (command == "LED1_ON") {