Touchless Switch WITHOUT Arduino

Touchless Switch WITHOUT Arduino | IR Sensor + Transistor + Relay | No Code Needed! | Kids Electronics
⚡ Robo Circuit Labs — Episode 13B · No-Code Edition

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!

🚫 No Arduino 🚫 No Code 📡 IR Sensor 🔌 BC547 Transistor ⚡ Relay Module 💡 LED ⏱️ 45 Minutes 🎓 Ages 8+ 💰 ~₹120 / $2
FC-51 IR VCC GND OUT B C E BC547 1kΩ RELAY COIL COM NO IN VCC GND 220Ω LED FAN 🚫 NO ARDUINO! Hold! HAND → IR DETECTS → TRANSISTOR OPENS → RELAY CLICKS → FAN + LED ON!

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!

⚖️ Which Should You Build?

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:

🟣 With Arduino

YES Toggle ON/OFF with each wave
YES Debounce control in software
YES Timer, LCD, Wi-Fi upgrades
YES Serial Monitor debugging
NO Needs coding knowledge
NO Needs USB + Arduino IDE
Cost: ~₹350 | Time: 1.5–2 hrs
VS

🟠 No Arduino (This Guide!)

YES Hold hand = ON, remove = OFF
YES Zero programming needed
YES Works instantly on power-on
YES Cheaper — only 5 components
YES Great for pure electronics learning
NO No toggle (needs 555 IC add-on)
Cost: ~₹120 | Time: 45 min
💡
Our RecommendationBuild this no-Arduino version first — it teaches you how transistors and relays actually work at a circuit level, which makes the Arduino version much easier to understand afterwards. Think of it as learning to walk before you run!
⚡ Pure Circuit Logic

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:

📡
IR Sensor
Detects hand → outputs LOW (0V)
🔌
BC547 Transistor
LOW signal at Base → closes switch
Relay Module
Current through coil → contact closes
🌀
Fan + LED
Power reaches fan → spins!

🔌 The Star of the Show: BC547 Transistor

B C E NPN small current big current

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!

🧠
Wait — the IR sensor outputs LOW when it sees a hand?Yes! The FC-51 uses active-low logic. When it detects an object, its OUT pin pulls DOWN to 0V (LOW). In our circuit, we wire this LOW signal (via 1kΩ resistor) to the transistor's Base — and on our transistor circuit, LOW at the Base means the transistor is actually OFF. So we flip the logic using the relay module's own inverter. See the wiring section for the neat trick!
The Key Difference from the Arduino VersionWith Arduino, the code reads the sensor and decides to TOGGLE (wave 1 = ON, wave 2 = OFF). In this hardware version, the behaviour is continuous: hand present = fan ON, hand removed = fan OFF. It's like holding a physical button rather than clicking one. You'll see a 555 timer trick at the end of this guide to add toggle behaviour without any code!
🧰 Shopping List

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:

📡
FC-51 IR Obstacle Sensor
3-pin module (VCC, GND, OUT) — same as the Arduino version
🔌
BC547 NPN Transistor
The star of this circuit! Also works: 2N2222, BC548, S8050
🔲
1kΩ Resistor
Protects the transistor Base from too much current (look for brown-black-red bands)
🔲
220Ω Resistor
Current-limiter for the LED indicator (red-red-brown bands)
💡
LED (any colour)
Visual indicator that the relay has triggered
5V 1-Channel Relay Module
Same module as the Arduino version; includes onboard flyback diode
🌀
5V USB Fan (small DC fan)
Safe for beginners — no mains voltage; can also use an LED strip
🔋
9V Battery + Connector
Or 5V USB power bank; powers the whole circuit
🍞
Breadboard + Jumper Wires
Half-size breadboard and ~15 male-to-male jumper wires
🎉
Even Cheaper OptionInstead of a relay module, you can use just the BC547 transistor to directly switch a small DC motor or LED strip (if the load draws less than 100mA). That drops the parts list to just: IR sensor + BC547 + 1kΩ resistor + fan/LED. Three components total!
🔌 The Circuit

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:

+ 5V GND FC-51 IR SENSOR TX RX POT VCC GND OUT 1kΩ BC547 NPN B C E 1N4148 RELAY MODULE COIL 5V relay COM NO NC IN VCC GND IN LED INDICATOR LED 220Ω + (via 220Ω) − (GND) FAN (5V USB / DC Motor) +red → Relay COM −black → GND Power supply → Relay NO terminal Amber=IR Signal · Blue=Transistor C → Relay · Cyan=LED · Yellow=Fan Power · Red=VCC 5V · Black=GND
IR signal → Transistor Base Transistor C → Relay IN Fan power via relay VCC 5V GND
🛠️ Wire by Wire

Complete Wiring Table

📡 FC-51 IR Sensor Connections

IR Sensor PinConnects ToWireNotes
VCC+5V railREDModule needs 3.3–5V
GNDGND railBLACKCommon ground
OUT1kΩ resistor → BC547 Base (B)AMBERLOW when hand detected; HIGH when clear

🔌 BC547 Transistor Connections

Transistor LegConnects ToWireNotes
Base (B)1kΩ resistor (other end to IR OUT)PURPLE1kΩ protects the Base from excess current
Collector (C)Relay module IN pinCYANThis is the "switched" output — drives relay coil
Emitter (E)GND railBLACKAlways connects directly to GND for NPN transistors

⚡ Relay Module Connections

Relay PinConnects ToWireNotes
INBC547 Collector (C)CYANTransistor drives this — NOT Arduino in this version!
VCC+5V railREDPowers the relay coil circuit
GNDGND railBLACKCommon ground
COMFan positive (+) wireAMBERCommon terminal; always internally connected
NOPower supply positive (+5V)REDNormally Open — connects to COM when relay fires

💡 LED Indicator Connections

LED LegConnects ToWire
Anode (+) long leg220Ω resistor → +5V railRED via 220Ω
Cathode (−) short legGND railBLACK
⚠️
Identify the BC547 Legs Correctly!Hold the BC547 with the flat face toward you and the legs pointing down. From left to right, the legs are: Collector (C), Base (B), Emitter (E). Getting these wrong is the #1 mistake in transistor circuits! Double-check the datasheet for your specific transistor as different manufacturers sometimes vary the pinout.
🔧 Build It!

Step-by-Step Build Guide

1

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.

💡
Simplest Power OptionUse a 5V USB power bank with a USB-A breakout module — this gives you a clean 5V directly with no regulator needed. Plug into the breadboard rails and you're ready to go!
2

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!

3

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.

4

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.

🔍
Reading Resistor Colour Bands1kΩ = Brown · Black · Red · Gold. 220Ω = Red · Red · Brown · Gold. Hold the gold band on the right when reading left to right.
5

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!

6

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.

7

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.

⚠️
Adults Only for Mains Fans!If connecting a 220V AC ceiling fan or wall fan, the relay COM and NO terminals will have dangerous mains voltage. Only a qualified adult should wire this section. For safe testing, always use a 5V USB fan first.
8

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 & Fixes

Testing Your No-Code Switch

A

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.

B

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.

C

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.

D

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).

🔁 No-Code Toggle

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!

🏆
Which Version Should You Build?
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.
❓ Questions!

Frequently Asked Questions

Can you really make a touchless switch without any Arduino?
Yes, completely! The FC-51 IR sensor already has a built-in comparator chip that outputs a clean digital signal. A BC547 NPN transistor reads that signal and switches the relay coil on and off. The whole circuit works through pure hardware logic — no microcontroller, no programming language, no USB cable needed at all.
Why does this circuit use a transistor instead of connecting the IR sensor directly to the relay?
The FC-51's OUT pin can only source or sink about 15–20mA of current. A 5V relay coil typically needs 60–80mA to energise. If you connected the sensor directly to the relay, either the relay wouldn't fully activate (producing an unreliable chattering click) or the sensor chip could overheat and burn out. The BC547 transistor acts as a current amplifier — a tiny 1mA Base current controls up to 100mA through the Collector, easily driving any relay coil.
What is the difference between this and the Arduino version?
The biggest difference is behaviour: the no-Arduino version is a "hold switch" — hold your hand in front = fan ON, remove hand = fan OFF, continuously. The Arduino version toggles: one wave = ON (latched), next wave = OFF (latched). The Arduino also adds debounce (ignoring rapid repeated triggers), adjustable timing, LCD display, and endless upgrade paths via code. Both versions use the same IR sensor and relay — only the control logic differs.
Can I use a different transistor instead of BC547?
Yes! The BC547 is common and cheap, but any NPN transistor with sufficient current gain will work: BC548, BC337, 2N2222, S8050, or 2N3904 are all direct substitutes. Check that your transistor can handle at least 100mA collector current and has a gain (hFE) of 100 or more at low currents. The pin order (C-B-E) may differ between transistors, so always check the datasheet!
How do I add toggle behaviour without Arduino?
Add a 555 timer IC wired in bistable (flip-flop) mode between the IR sensor output and the transistor Base. Each LOW pulse from the IR sensor causes the 555 to flip its output from HIGH to LOW or LOW to HIGH — creating a perfect ON/OFF latch with no programming required. You need the 555 IC (~₹10), two 10kΩ resistors, and a 10µF capacitor — about ₹30 total extra.
Why do I need a 1kΩ resistor on the transistor Base?
Without a resistor, the Base-Emitter junction of the transistor behaves like a forward-biased diode and would draw unlimited current from the IR sensor — potentially burning out the sensor's output pin or the transistor itself. The 1kΩ resistor limits Base current to a safe 3–5mA, which is more than enough to saturate the transistor and activate the relay, while protecting both components.

⚡ Pure Hardware Magic!

You just built a working contactless switch using only transistors and a relay — the same fundamental building blocks that all electronics, including Arduino itself, are made from. Understanding this circuit means you understand the heart of every smart device around you.

Next step: add a 555 timer for toggle, or replace the BC547 with an L293D to control a motor both directions. The circuit world has no end!

⚠️ Mains voltage (220V/110V AC) in the relay output section is dangerous. Always use a low-voltage DC fan or LED for testing. Adults must supervise all mains connections.

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
Young inventors love it!
🖨️
3D Print
All parts
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course