Projects / Two-wheeler indicator reminder

Two-wheeler indicator reminder

Beginner1 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. LM2596

    Set the buck module

    5.0 V on a meter.

  2. PC817

    Build the optocoupler stage

    1 k on the input.

  3. Test on a bench

    Flash a 12 V lamp.

  4. Write the timer

    30 seconds then beep.

  5. Test the reset

    Beeping stops when the lamp stops.

  6. Fit a fuse

    On the supply wire.

  7. Install on the vehicle

    In a sealed, tied-down box.

In short

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

FromToWhy
Fused ignition 12 VLM2596 IN+Power (use a 1 A fuse; chassis ground to IN-)
LM2596 OUT+ and OUT-ATtiny85 pin 8 and pin 45 V supply, set before connecting
Indicator lamp feed1 k resistor to PC817 pin 1 (anode)Sensing, takes very little current
PC817 pin 2 (cathode)Vehicle chassis groundReturn
PC817 pin 4 (emitter)ATtiny85 pin 4 (GND)Output side
PC817 pin 3 (collector)ATtiny85 PB1 (pin 6), 1 k pull-up to 5 VLow while the indicator is lit
Buzzer plus and minusATtiny85 PB0 (pin 5) and GNDAlert

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.

CheckExpected
Indicator flashing 10 sSilent
Flashing over 30 sShort beeps
Indicator offBeeps stop at once
Ignition offEverything 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 →

Ask Lark AI

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.