DIY Smart Bike & Helmet Safety System ๐ŸšฒArduino Robotics Project

DIY Smart Bike & Helmet Safety System ๐ŸšฒArduino Robotics Project for Kids
๐Ÿšฒ ROBOTICS FOR KIDS · LEVEL: INTERMEDIATE

Build a Miniature Smart Bike with a Safety Helmet!

Meet Ryder — a miniature Arduino bike that won't start without a helmet, checks for alcohol before riding, flashes automatic turn signals, and brakes itself when something's in the way.

⏱️ 4–5 hours ๐ŸŽ‚ Ages 10+ (with an adult) ๐Ÿ›ก️ 4 Safety Systems in 1

๐Ÿช– Say hi to Ryder, your smart safety bike!

What Is a Smart Bike Safety System, Anyway?

Real motorcycles and scooters are starting to include smart safety features — and you can build a miniature version! Ryder combines four safety ideas in one small Arduino brain: it checks that the rider is wearing a helmet, checks for alcohol before allowing the "engine" to start, automatically flashes turn indicators based on handlebar movement, and uses an ultrasonic sensor to brake before hitting an obstacle.

๐Ÿช– Helmet-Worn Detection ๐Ÿบ Alcohol Sensing ↔️ Automatic Turn Indicators ๐Ÿ›‘ Collision Avoidance
๐Ÿงฐ

What You'll Need

Gather these parts before you start building your smart bike!

x1

Arduino Uno

The brain that runs all four safety systems.

x1

MQ-3 Alcohol Sensor

Mounted near the helmet's chin strap to sniff for alcohol.

x1

IR Proximity Sensor

Detects whether the helmet is actually on someone's head.

x1

Relay Module

Acts as the "ignition switch" that only engages when it's safe.

x1

Small DC Motor

Represents the bike's engine/rear wheel drive.

x1

Ultrasonic Sensor (HC-SR04)

Watches ahead for obstacles to avoid a collision.

x1

SG90 Micro Servo

Acts as an auto-brake, pressing the brake lever when needed.

x2

Micro Push Buttons

Mounted on the handlebar to sense a left or right turn.

x2

Amber LEDs

Left and right automatic turn indicators.

x1

Status LED + Buzzer

Shows system status and warns of obstacles or blocks.

x1

Miniature Bike Model

A toy or 3D-printed bike frame to mount everything on.

~20

Jumper Wires + Breadboard

Connects every sensor and output.

๐Ÿ”Œ

The Circuit Diagram

All four safety systems connect to one Arduino Uno, working together to keep the ride safe.

Arduino Uno UNO A0 — MQ-3 Alcohol Sensor Pin 2 — Helmet-Worn IR Sensor Pin 3 — Relay (Ignition) Pins 4,5 — Ultrasonic Trig/Echo Pin 9 — Brake Servo Pins 6,7 — Left/Right Turn Buttons Pins 10,11 — Turn Indicator LEDs Pin 12 — Status LED Pin 8 — Buzzer 5V GND MQ-3 Alcohol Sensor IR Helmet Sensor Relay + DC Motor Ultrasonic Sensor Brake Servo Turn Buttons + LEDs Buzzer
Alcohol sensor → A0 Helmet IR → pin 2 · Relay → pin 3 Ultrasonic → pins 4, 5 · Brake servo → pin 9 Turn buttons → pins 6, 7 · Indicators → pins 10, 11
๐Ÿ› ️

Step-by-Step Build Instructions

We'll build each safety system one at a time, then combine them. Work with an adult on wiring the relay and motor!

1

Mount the alcohol sensor on the helmet

Position the MQ-3 sensor near the chin strap area of the helmet, facing where a rider's breath would pass, and route its wires down to the bike's Arduino.

๐Ÿ’ก Tip: MQ-3 sensors need a short warm-up time after power-on before readings become stable — wait about 20 seconds before testing.
2

Add the helmet-worn sensor

Mount the small IR proximity sensor inside the helmet so it detects when a head is actually inside, not just resting nearby.

3

Wire the relay and motor "ignition"

Connect the relay between the Arduino and the small DC motor representing the engine. The Arduino will only close the relay (allowing power through) when both safety checks pass.

4

Mount the ultrasonic sensor and brake servo

Attach the ultrasonic sensor facing forward on the handlebars, and mount the servo so its arm can press the brake lever when triggered.

5

Add the turn buttons and indicator LEDs

Mount one small push button on each side of the handlebar grips (pressed automatically when the rider turns the handlebar that direction), and place an amber LED on each side of the bike as the indicator light.

6

Add the status LED and buzzer

Mount the status LED where it's easy to see (green = safe to ride, red = blocked) and the buzzer nearby for collision and safety alerts.

7

Wire everything and test

Double-check every connection against the circuit diagram, upload the code, and test each system one at a time — helmet check, alcohol check, turn signals, then collision braking.

๐Ÿ’ป

The Arduino Code

This code needs the Servo library. Copy it into the Arduino IDE, adjust the alcohol threshold for your sensor, then click Upload.

smart_bike_helmet.ino
// ๐Ÿšฒ๐Ÿค– Ryder the Smart Bike & Helmet Safety System — Arduino Robotics Project
// Combines helmet detection, alcohol sensing, auto turn signals, and collision avoidance

#include <Servo.h>

// ---- Safety sensors ----
const int alcoholPin   = A0;
const int helmetPin    = 2;
const int relayPin     = 3;
const int alcoholLimit = 400;   // tune this after testing your sensor

// ---- Collision avoidance ----
const int trigPin = 4, echoPin = 5;
const int safeDistanceCM = 20;
Servo brakeServo;
const int brakeServoPin = 9;

// ---- Turn indicators ----
const int leftButtonPin  = 6;
const int rightButtonPin = 7;
const int leftLEDPin     = 10;
const int rightLEDPin    = 11;

// ---- Status ----
const int statusLEDPin = 12;
const int buzzerPin    = 8;

void setup() {
  pinMode(helmetPin, INPUT);
  pinMode(relayPin, OUTPUT);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(leftButtonPin, INPUT_PULLUP);
  pinMode(rightButtonPin, INPUT_PULLUP);
  pinMode(leftLEDPin, OUTPUT);
  pinMode(rightLEDPin, OUTPUT);
  pinMode(statusLEDPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);

  brakeServo.attach(brakeServoPin);
  brakeServo.write(0);   // brake released

  Serial.begin(9600);
  Serial.println("Warming up alcohol sensor...");
  delay(20000);  // MQ-3 sensors need time to warm up
}

void loop() {
  bool safeToRide = checkStartConditions();
  digitalWrite(relayPin, safeToRide ? HIGH : LOW);
  digitalWrite(statusLEDPin, safeToRide ? HIGH : LOW);

  if (safeToRide) {
    handleTurnSignals();
    handleCollisionAvoidance();
  }
}

// Checks helmet + alcohol before allowing the ignition relay to engage
bool checkStartConditions() {
  bool helmetOn = (digitalRead(helmetPin) == HIGH);
  int alcoholLevel = analogRead(alcoholPin);
  bool sober = (alcoholLevel < alcoholLimit);

  if (!helmetOn) {
    Serial.println("Blocked: put on your helmet!");
    return false;
  }
  if (!sober) {
    Serial.println("Blocked: alcohol detected!");
    tone(buzzerPin, 500, 500);
    return false;
  }
  return true;
}

// Lights the matching indicator LED automatically when a turn button is pressed
void handleTurnSignals() {
  digitalWrite(leftLEDPin, digitalRead(leftButtonPin) == LOW ? HIGH : LOW);
  digitalWrite(rightLEDPin, digitalRead(rightButtonPin) == LOW ? HIGH : LOW);
}

// Measures distance ahead and auto-brakes if something is too close
void handleCollisionAvoidance() {
  long distance = readDistanceCM();

  if (distance > 0 && distance < safeDistanceCM) {
    tone(buzzerPin, 1200, 150);
    brakeServo.write(90);   // press the brake lever
  } else {
    brakeServo.write(0);    // release the brake
  }
}

// Measures distance using the ultrasonic sensor
long readDistanceCM() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  long duration = pulseIn(echoPin, HIGH, 20000);
  return duration * 0.034 / 2;
}
๐Ÿง 

How Does Ryder Actually Work?

Here are the big robotics ideas hiding inside this project:

๐Ÿšซ

Safety Interlocks

The relay only lets power through when both the helmet check and alcohol check pass — a real interlock system won't let the "engine" run unless every safety condition is met.

๐Ÿ‘ƒ

Gas Sensing

The MQ-3 sensor's internal material changes resistance when it detects alcohol vapor, giving a higher analog reading — the code just compares that number to a safe limit.

↔️

Reactive Automation

The turn indicators don't need a separate "on/off" toggle — they simply mirror whatever the turn buttons are doing in real time, every loop.

๐Ÿ›‘

Distance-Triggered Braking

The same ultrasonic-distance trick used in parking sensors and robot vacuums is used here to decide, moment by moment, whether it's safe to keep moving.

๐Ÿง‘‍๐Ÿ”ฌ Safety First!

  • Build with an adult, especially when wiring the relay, motor, and alcohol sensor.
  • This is a scaled-down learning model using a small motor — it is not a certified vehicle safety system and should never be relied on for a real bike or motorcycle.
  • MQ-3 sensors get warm during use — avoid touching the sensor element directly.
  • Keep fingers clear of the servo brake arm and motor while powered on.
  • Never test the alcohol sensor with real alcohol — household rubbing alcohol fumes from a safe distance are enough to demonstrate the concept, with adult supervision.

Frequently Asked Questions

What counts as "automatic road sign indicator" in this project?

This build focuses on automatic turn indicators that respond to handlebar movement. Reading actual road signs would need a camera and image recognition — a bigger project on its own that pairs well with this one!

How do I find the right alcohol threshold?

Watch the raw sensor values in the Serial Monitor in clean air first to find a normal baseline, then set alcoholLimit a bit above that baseline so it only triggers on a real change.

Can the turn signals auto-cancel like a real bike?

Yes! Add a timer using millis() that turns the LED off automatically a few seconds after the button is released, instead of following it exactly.

What age group is this project good for?

Because it combines several safety-critical sensors and a relay, this project is best suited for kids around age 10+ working closely with an adult.

๐ŸŽ‰ Excellent work — you just built a real multi-sensor safety robot! Put on the helmet, stay sober, and watch Ryder handle the rest.

⬆️ Back to Materials List

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