No Arduino.
No Code.
Still
Touchless! ✨
Five components. Zero programming. Wire it up, power it on, and wave your hand — the fan turns on like magic using pure circuit logic!
Great news — you absolutely do not need an Arduino to build a touchless switch! In fact, building it without a microcontroller is a fantastic way to understand the pure electronics behind how circuits work. No code, no USB cable, no computer — just components talking to each other directly.
The secret ingredient? A humble little component called a transistor. A transistor is a tiny electronic switch that lets a small signal control a bigger one. The IR sensor's output signal goes straight into the transistor's control pin, which then turns on the relay. It's a beautiful, elegant, 100% hardware chain reaction!
Arduino Version vs No-Arduino Version
Both versions detect your hand and control a fan. Here's how they differ — pick the one that suits your skill level and goals:
How Does It Work Without Code?
Instead of a microcontroller brain reading the sensor and deciding what to do, we build a hardware logic chain — each component directly controls the next one. Here's the chain:
🔌 The Star of the Show: BC547 Transistor
The BC547 transistor has three legs:
🟣 Base (B) — the control leg. Connect the IR sensor output here via a 1kΩ resistor. When the sensor detects your hand (outputs LOW), a tiny current flows into the Base.
🔵 Collector (C) — connects to the relay coil (positive side). This is the "big" current path.
🟢 Emitter (E) — connects to GND.
When a tiny Base current flows, the transistor "opens" its internal switch and lets a much bigger current flow from Collector to Emitter — enough to energise the relay coil and snap its contact closed. The fan gets power!
Only 5 Components Needed!
This is one of the cheapest electronics projects you can build. The total cost is under ₹120 ($2) if you already have a breadboard and jumper wires:
Full Circuit Diagram
Trace every wire before you build. The amber-coloured signal wire is the "brain" of this circuit — it carries the IR sensor's output to the transistor's Base:
Complete Wiring Table
📡 FC-51 IR Sensor Connections
| IR Sensor Pin | Connects To | Wire | Notes |
|---|---|---|---|
| VCC | +5V rail | RED | Module needs 3.3–5V |
| GND | GND rail | BLACK | Common ground |
| OUT | 1kΩ resistor → BC547 Base (B) | AMBER | LOW when hand detected; HIGH when clear |
🔌 BC547 Transistor Connections
| Transistor Leg | Connects To | Wire | Notes |
|---|---|---|---|
| Base (B) | 1kΩ resistor (other end to IR OUT) | PURPLE | 1kΩ protects the Base from excess current |
| Collector (C) | Relay module IN pin | CYAN | This is the "switched" output — drives relay coil |
| Emitter (E) | GND rail | BLACK | Always connects directly to GND for NPN transistors |
⚡ Relay Module Connections
| Relay Pin | Connects To | Wire | Notes |
|---|---|---|---|
| IN | BC547 Collector (C) | CYAN | Transistor drives this — NOT Arduino in this version! |
| VCC | +5V rail | RED | Powers the relay coil circuit |
| GND | GND rail | BLACK | Common ground |
| COM | Fan positive (+) wire | AMBER | Common terminal; always internally connected |
| NO | Power supply positive (+5V) | RED | Normally Open — connects to COM when relay fires |
💡 LED Indicator Connections
| LED Leg | Connects To | Wire |
|---|---|---|
| Anode (+) long leg | 220Ω resistor → +5V rail | RED via 220Ω |
| Cathode (−) short leg | GND rail | BLACK |
Step-by-Step Build Guide
Set Up Power Rails on the Breadboard
Connect your 9V battery connector (or 5V USB power bank) to the breadboard power rails. Red (+) to the top positive rail, black (−) to the bottom negative rail. If using 9V, add a 7805 voltage regulator to step it down to 5V — connect 9V to the regulator IN pin, GND to GND, and take 5V from the OUT pin to your positive rail.
Place and Power the IR Sensor
Push the FC-51 IR sensor module's three pins into the breadboard. Connect VCC to the +5V rail and GND to the −GND rail with jumper wires. Don't connect the OUT pin yet. Power on — the small indicator LED on the sensor should light up, confirming it's working. Wave your hand in front of it and watch the indicator LED flicker!
Insert the BC547 Transistor
Push the BC547 transistor into the breadboard with all three legs in separate columns. Hold it with the flat face toward you — legs are C, B, E from left to right. Connect the Emitter (E) directly to the GND rail with a black wire. Leave the Base (B) and Collector (C) unconnected for now.
Add the 1kΩ Resistor to the Base
Place a 1kΩ resistor (brown-black-red colour bands) between the IR sensor's OUT pin column and the transistor's Base (B) column on the breadboard. This resistor limits the current flowing into the transistor Base — without it, too much current could damage the BC547.
Connect Transistor Collector to Relay IN
Run a cyan wire from the BC547 Collector (C) column to the relay module's IN pin. Connect the relay module's VCC to the +5V rail (red wire) and GND to the GND rail (black wire). Now when the transistor switches on, current flows through the relay coil and you'll hear a satisfying click!
Wire the LED Indicator
Push the LED into the breadboard (long leg = anode = +). Place the 220Ω resistor (red-red-brown) in series with the LED's long leg. Connect the other end of the resistor to the +5V rail. Connect the LED's short leg (cathode) to the GND rail. The LED will now glow whenever power is on — which gives you a power-on indicator too!
For an indicator that only glows when the relay fires, connect the LED + resistor between the relay coil's positive terminal and GND instead.
Connect the Fan to the Relay Output
Connect your 5V USB fan's positive (red) wire to the relay COM terminal and the fan's negative (black) wire to GND. Connect the +5V power supply to relay NO terminal. When the relay fires, COM connects to NO, completing the fan's circuit.
Power On and Test!
Connect the battery or USB power bank. Hold your hand 8–12 cm in front of the IR sensor — you should hear the relay click, see the LED glow, and feel the fan spin up. Remove your hand — relay clicks off, fan stops, LED dims. If nothing happens, check the troubleshooting section below!
Testing Your No-Code Switch
Adjust the IR Sensor Range
The small blue potentiometer on the FC-51 adjusts detection range. Turn it clockwise to increase range. Set it so the sensor detects your hand at 10 cm but ignores objects at 30 cm — this prevents accidental triggers from walls or furniture nearby.
If Relay Doesn't Click — Check Transistor Orientation
The #1 issue is the BC547 inserted backwards. Remove it and reinsert with the flat face facing you. Then check the OUT wire is connected to the Base (B) via the 1kΩ resistor — not the Collector or Emitter.
If Relay Clicks but Fan Doesn't Spin
Check that the fan's positive wire is on relay COM and the power supply positive is on relay NO. Also verify the fan itself works by connecting it directly to 5V momentarily.
If Relay Stays ON Even Without Hand
The transistor may be receiving too much Base current and staying saturated. Increase the base resistor from 1kΩ to 4.7kΩ or 10kΩ. This reduces Base current and makes the transistor more sensitive to when the sensor signal goes high (hand removed).
Add Toggle Behaviour — Still No Code!
Want the wave-once-ON / wave-again-OFF behaviour of the Arduino version, but still without programming? Add a 555 timer IC in bistable mode between the IR sensor and transistor. It's the analogue world's answer to the Arduino's toggle logic!
🎲 What is the 555 Timer?
The NE555 timer IC is one of the most famous chips in electronics history — made since 1972 and still widely used! In bistable (flip-flop) mode, it has two stable states: SET and RESET. Each trigger pulse flips it from one to the other — exactly like our ON/OFF toggle!
You need: 555 timer IC, two 10kΩ resistors, and one 10µF capacitor — about ₹30 extra.
⚙️ How to Wire the 555 Bistable
Pin 8 (VCC) → 5V
Pin 1 (GND) → GND
Pin 2 (TRIGGER) → IR sensor OUT (via 10kΩ pull-up to 5V)
Pin 4 (RESET) → 5V (disable auto-reset)
Pin 3 (OUTPUT) → 1kΩ → BC547 Base
Now each LOW pulse from the IR sensor toggles the 555 output — wave once = ON latched, wave again = OFF latched. Pure hardware toggle!
• Basic (this guide): IR + Transistor + Relay. Hold = ON, Release = OFF. Cheapest, easiest.
• With 555: IR + 555 Bistable + Transistor + Relay. Wave toggle, still no code. ₹30 more.
• With Arduino: Everything + debounce + timer + LCD. Most flexible. Needs coding knowledge.

Comments
Post a Comment