Two-wheeler indicator reminder
Build it step by step
0 of 7 doneSet the buck module
5.0 V on a meter.
Build the optocoupler stage
1 k on the input.
Test on a bench
Flash a 12 V lamp.
Write the timer
30 seconds then beep.
Test the reset
Beeping stops when the lamp stops.
Fit a fuse
On the supply wire.
Install on the vehicle
In a sealed, tied-down box.
How do you build a two-wheeler indicator reminder?
A buzzer reminds the rider when the turn signal has been left on for more than 30 seconds. You need ATtiny85-20PU microcontroller, Optocoupler PC817, Active buzzer 5 V, Resistor 1 kΩ × 2 and LM2596 Buck Module. It takes 7 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 5
Parts list
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Fused ignition 12 V | LM2596 IN+ | Power (use a 1 A fuse; chassis ground to IN-) |
| LM2596 OUT+ and OUT- | ATtiny85 pin 8 and pin 4 | 5 V supply, set before connecting |
| Indicator lamp feed | 1 k resistor to PC817 pin 1 (anode) | Sensing, takes very little current |
| PC817 pin 2 (cathode) | Vehicle chassis ground | Return |
| PC817 pin 4 (emitter) | ATtiny85 pin 4 (GND) | Output side |
| PC817 pin 3 (collector) | ATtiny85 PB1 (pin 6), 1 k pull-up to 5 V | Low while the indicator is lit |
| Buzzer plus and minus | ATtiny85 PB0 (pin 5) and GND | Alert |
Code
Indicators flash about once a second, and the reminder works by noticing that the flashing has gone on for too long. The optocoupler lets the sketch sense the 12 V indicator without any electrical connection between the vehicle's wiring and the ATtiny: the light inside the optocoupler turns on with the lamp feed, and the output side pulls a pin low. The timer starts at the first flash, the buzzer begins after 30 seconds, and the timer stops as soon as there has been no flash for two and a half seconds. The buck module lowers the 12 V to 5 V for the chip, so set it with a meter before connecting. Take the supply from a fused, ignition-switched wire, never straight from the battery, and keep the box dry and tied down. Use only the indicator feed and a chassis ground; do not cut into the vehicle's main wiring or anything that affects brakes or lights. If you are unsure about the wiring, ask a mechanic. The reminder is an aid, not a safety system. Programming needs ArduinoISP or a USBasp programmer.
Runs on a virtual ATtiny85 in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// Indicator reminder: beeps if the turn signal has been flashing for more than 30 seconds, and stops when it stops.
// Core: ATTinyCore, chip ATtiny85, clock 1 MHz internal. The optocoupler pulls PB1 low whenever the indicator lamp is lit.
const byte SENSE = 1, BUZZER = 0;
const unsigned long LIMIT_MS = 30000UL; // reminder after 30 seconds
const unsigned long GAP_MS = 2500UL; // no pulse for this long means the indicator is off
unsigned long startMs = 0, lastPulse = 0;
bool active = false;
void setup() {
pinMode(SENSE, INPUT);
pinMode(BUZZER, OUTPUT);
}
void loop() {
if (digitalRead(SENSE) == LOW) { // lamp lit: a pulse
lastPulse = millis();
if (!active) { active = true; startMs = millis(); }
}
if (active && millis() - lastPulse > GAP_MS) { active = false; digitalWrite(BUZZER, LOW); }
if (active && millis() - startMs > LIMIT_MS) {
digitalWrite(BUZZER, (millis() / 200) % 2 ? HIGH : LOW); // short beeps until the indicator is cancelled
}
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Indicator flashing 10 s | Silent |
| Flashing over 30 s | Short beeps |
| Indicator off | Beeps stop at once |
| Ignition off | Everything off |
If it does not work
Always beeping
Check the pull-up and the optocoupler direction.
Never beeps
Check the lamp feed reaches the optocoupler.
Resets
Check the 5 V supply and add a capacitor across it.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the two-wheeler indicator reminder?
ATtiny85-20PU microcontroller, Optocoupler PC817, Active buzzer 5 V, Resistor 1 kΩ × 2 and LM2596 Buck Module.
How long does the two-wheeler indicator reminder take to build?
About 60 minutes for a beginner maker, in 7 steps.
How do I know the two-wheeler indicator reminder works?
Indicator flashing 10 s: Silent. Flashing over 30 s: Short beeps. Indicator off: Beeps stop at once.
Always beeping: what should I check?
Check the pull-up and the optocoupler direction.
Never beeps: what should I check?
Check the lamp feed reaches the optocoupler.
Resets: what should I check?
Check the 5 V supply and add a capacitor across it.
