Guides · 10 min read

Anti Sleep Alarm Arduino: IR Eye Blink Sensor, Buzzer, Vibration

Anti sleep alarm with Arduino: an IR eye blink sensor on glasses, buzzer and vibration when the eye stays closed, a threshold table, alignment and a Nano build.

An anti sleep alarm with Arduino uses a small infrared (IR) sensor attached to the frame of a pair of glasses to measure how long your eye stays closed, and warns you with vibration and sound when that time is longer than a normal blink. The idea is simple: a blink lasts between a tenth and a third of a second, while the eye of someone nodding off stays closed for more than half a second. An Arduino can measure that difference to the millisecond.

In this guide you'll see step by step why the IR sensor gives different readings with the eye open and closed, which warning to give at which time threshold, and how to align the sensor on the glasses. We'll start with a simple alarm using a ready-made eye blink module with a digital output, then write an advanced version with a bare TCRT5000 sensor that cancels ambient light, calibrates itself and produces a one-minute fatigue summary. In the last section we'll work through a small, battery-powered, head-worn design with an Arduino Nano, numbers included.

This is a toy and experiment project; it does not replace a real driver safety system. The sensor can slip, be affected by sunlight, or the battery can run out. If you feel tired or sleepy, don't rely on the alarm: stop somewhere safe and rest. Never build, adjust or test the circuit while the vehicle is moving; do your experiments at a desk or while parked.
TCRT5000 infrared reflective sensor
TCRT5000: an IR LED and a phototransistor share one housing and measure the light reflected from the eyelid.

An IR eye blink sensor consists of an infrared LED and a phototransistor sitting side by side. The invisible light around 940 nm sent by the LED hits the eye and part of it is reflected back. With the eye open, much of the light enters through the pupil or is scattered elsewhere by the cornea; with the eye closed, the light returns more evenly from the skin of the eyelid. So the amount of light reaching the phototransistor changes as the eye opens and closes. Ready-made eye blink modules turn this change into a digital HIGH/LOW signal with a comparator (usually an LM358), and you set the threshold with the trimmer on the board. With a bare TCRT5000 you read the signal as analog and set the threshold in software. The direction of the change can differ with face shape and sensor angle, which is why our advanced code finds it by itself through calibration.

Eye closure time: the threshold table

A healthy, alert person blinks 15–20 times a minute, and each blink lasts 100–400 milliseconds. As fatigue builds up, blinks get longer and more frequent, and moments when the eye stays closed for more than half a second are a sign of microsleep. What that means on the road is striking: a vehicle at 90 km/h covers 25 metres per second, so during a 1.5 second eye closure it travels 37.5 metres blind. That's why a graded warning table matters: a gentle reminder for slightly long blinks and a strong alarm for long closures. The percentage of time the eyes are closed within a minute (known in research as PERCLOS) is also a good indicator of fatigue; a commonly used threshold is about 15 percent.

Eye closure timeMeaningResponse in the project
100–400 msNormal blinkNo response
400–800 msLong blink, sign of fatigueCounted; a short beep if 3 or more per minute
800–1500 msPossible start of microsleepVibration motor runs
Over 1500 msDangerously long closureVibration + pulsing buzzer until the eye opens
Closed more than 15% of a minuteClear fatigue (PERCLOS)Warning beep at the end of the minute

Parts list

  • Arduino Nano (the most practical choice thanks to its size and USB)
  • IR eye blink module (digital output) or a bare TCRT5000 sensor, plus 220 Ω and 10 kΩ resistors
  • Active buzzer (5 V, the type with its own oscillator)
  • Vibration motor module (a ready board with transistor and diode) or a 10 mm coin vibration motor
  • A glasses frame with or without lenses, hot glue and thin flexible wire
  • For the battery version: a 3.7 V 500 mAh LiPo, a TP4056 charger module (with protection) and an MT3608 boost converter
  • Optional: a push button for recalibration

Wiring table: Arduino Nano

PartPin / connectionArduino NanoNote
Eye blink moduleVCC / GND / DO5V / GND / D2Simple version
TCRT5000 IR LEDAnode (+)D7, through 220 ΩCathode to GND; (5 − 1.2) / 220 ≈ 17 mA
TCRT5000 phototransistorCollectorA0 + 10 kΩ to 5VEmitter to GND
Active buzzer+ / −D8 / GNDA type drawing under 30 mA
Vibration moduleIN / VCC / GNDD9 / 5V / GNDThe module's transistor drives the motor
Calibration buttonBoth legsD4 and GNDInternal pull-up is used
Battery (MT3608 output)+5 V / GND5V / GNDTo the 5V pin, not VIN
A vibration motor draws 60–100 mA and produces a voltage spike when switched off; never connect it directly to an Arduino pin. If you're not using a ready module, drive the motor with an NPN transistor (BC337 or 2N2222) and a 1 kΩ base resistor, and put a 1N4148 diode in reverse across the motor's terminals. For choosing a transistor see the transistor tool, and for the IR LED resistor the LED resistor calculator. Don't drive the IR LED above 20 mA, and never use a laser module.

Sensor alignment: placing it correctly on the glasses

  1. Tape the sensor temporarily to the lower inner edge of the glasses frame, near the outer corner of the eye.
  2. Point the sensor at the eyelid from about 10–15 mm away, angled slightly upwards; it mustn't block your view.
  3. Upload the alignment sketch below and open Tools > Serial Plotter in the Arduino IDE.
  4. Blink slowly a few times and watch the jumps on the 'yansima' (reflection) line; the difference should be at least 30–50 units.
  5. If the difference is small, change the sensor's angle by a few degrees or move it a little closer; find the position with the biggest jump.
  6. Once you've found it, fix the sensor with hot glue and run the wire along the temple of the glasses towards the back of your ear.
C++ (Arduino IDE)
1// Hizalama testi: Seri Çizici'de göz açık/kapalı farkını gör / alignment test: see open vs closed in the Serial Plotter
2const int IR_LED = 7;      // TCRT5000 IR LED anodu, 220 Ω üzerinden / IR LED anode through 220 Ω
3const int SENSE = A0;      // fototransistör + 10 kΩ pull-up / phototransistor + 10 kΩ pull-up
4
5void setup() {
6  Serial.begin(115200);
7  pinMode(IR_LED, OUTPUT);
8}
9
10void loop() {
11  digitalWrite(IR_LED, LOW);
12  delayMicroseconds(500);
13  int ambient = analogRead(SENSE);       // yalnız ortam ışığı / ambient light only
14  digitalWrite(IR_LED, HIGH);
15  delayMicroseconds(500);
16  int lit = analogRead(SENSE);           // ortam + yansıyan IR / ambient + reflected IR
17  digitalWrite(IR_LED, LOW);
18
19  int reflect = ambient - lit;           // yansıma arttıkça gerilim düşer / more reflection, lower voltage
20  Serial.print("ortam:");                // Seri Çizici etiketleri / Serial Plotter labels
21  Serial.print(ambient);
22  Serial.print(" yansima:");
23  Serial.println(reflect);
24  delay(20);                             // yaklaşık 50 örnek/sn / about 50 samples per second
25}
26

The trick in this sketch is the two-step reading. First it reads the sensor with the IR LED off; that value only reflects ambient light (sun, street lights, car interior lights). Then it lights the LED for half a millisecond and reads again. The difference between the two gives only the LED light reflected from the eye, independent of ambient light. Sunlight is a strong IR source and easily fools single-reading circuits; this difference method removes most of that error. Because the phototransistor is wired with a 10 kΩ pull-up, the voltage on A0 drops as reflection increases, so the 'ambient − lit' formula produces a positive number for reflection. You'll find the TCRT5000 basics in the TCRT5000 guide.

Slide a 1 cm piece of black heat-shrink tube around the sensor to block side sunlight and noticeably increase the signal difference. For people who wear glasses, put the sensor on the inside of the frame rather than behind the lens; the lens surface can bounce the IR light straight back and fool the sensor.

Ready-made IR eye blink modules usually consist of a small sensor head that clips onto the glasses frame and a board with a comparator. The board sets the DO output HIGH or LOW when the eye is closed; which one depends on the model, so set the CLOSED_LEVEL constant in the code to match your module. Turn the trimmer so that the output LED is off with the eye open and on when you close it. Because the code is built on millis(), it never waits anywhere and measures eye closure to the millisecond.

C++ (Arduino IDE)
1// Sürücü uyku alarmı: dijital çıkışlı IR göz kırpma modülü / anti-sleep alarm: IR eye blink module with digital output
2const int EYE_PIN = 2;          // modül DO çıkışı / module DO output
3const int BUZZER_PIN = 8;       // aktif buzzer / active buzzer
4const int VIBRO_PIN = 9;        // titreşim motoru modülü / vibration motor module
5const int CLOSED_LEVEL = HIGH;  // göz kapalıyken modülün seviyesi; seninki LOW ise değiştir / module level with the eye closed
6
7const unsigned long LONG_BLINK_MS = 400;   // bunun altı normal kırpma / shorter is a normal blink
8const unsigned long VIBRO_MS = 800;        // titreşim uyarısı / vibration warning
9const unsigned long ALARM_MS = 1500;       // buzzer + titreşim / buzzer + vibration
10const unsigned long OPEN_CONFIRM_MS = 60;  // kısa parazitler gözü "açmasın" / short glitches don't count as open
11
12bool eyeClosed = false;
13unsigned long closedSince = 0, openSince = 0, minuteStart = 0, chirpUntil = 0;
14int longBlinks = 0;
15
16void setOutputs(bool vibro, bool buzzer) {
17  digitalWrite(VIBRO_PIN, vibro ? HIGH : LOW);
18  digitalWrite(BUZZER_PIN, buzzer ? HIGH : LOW);
19}
20
21void setup() {
22  Serial.begin(115200);
23  pinMode(EYE_PIN, INPUT);
24  pinMode(BUZZER_PIN, OUTPUT);
25  pinMode(VIBRO_PIN, OUTPUT);
26  setOutputs(false, false);
27}
28
29void loop() {
30  unsigned long now = millis();
31  bool closedNow = (digitalRead(EYE_PIN) == CLOSED_LEVEL);
32
33  if (closedNow) {
34    openSince = now;
35    if (!eyeClosed) { eyeClosed = true; closedSince = now; }   // göz kapandı / eye closed
36  } else if (eyeClosed && now - openSince >= OPEN_CONFIRM_MS) { // göz gerçekten açıldı / eye really opened
37    eyeClosed = false;
38    unsigned long dur = openSince - closedSince;
39    if (dur >= LONG_BLINK_MS) longBlinks++;
40    Serial.print(F("Kapali / Closed: "));
41    Serial.print(dur);
42    Serial.println(F(" ms"));
43  }
44
45  if (eyeClosed) {
46    unsigned long dur = now - closedSince;
47    if (dur >= ALARM_MS) setOutputs(true, (now / 150) % 2);   // kesik buzzer + titreşim / pulsing buzzer + vibration
48    else if (dur >= VIBRO_MS) setOutputs(true, false);
49    else setOutputs(false, false);
50  } else {
51    setOutputs(false, (long)(chirpUntil - now) > 0);          // yorgunluk bip'i / fatigue chirp
52  }
53
54  if (now - minuteStart >= 60000) {       // dakikada 3+ uzun kırpma = yorgunluk / 3+ long blinks a minute = fatigue
55    if (longBlinks >= 3) chirpUntil = now + 300;
56    longBlinks = 0;
57    minuteStart = now;
58  }
59}
60

The moment the eye closes, closedSince stores the time and the closure duration is recalculated on every loop: past 800 ms the vibration starts, and past 1,500 ms the buzzer joins in, pulsing about three times a second. OPEN_CONFIRM_MS stops short glitches from splitting a long closure in two: the eye only counts as open after reading open for 60 ms. When the eye opens, the duration is printed to the Serial Monitor and, if it was longer than 400 ms, the long blink counter goes up. At the end of each minute, if there were three or more long blinks, a 300 ms fatigue beep sounds; that beep is also produced with a millis() comparison, without waiting.

Advanced version: TCRT5000, calibration and fatigue tracking

The second sketch works with a bare TCRT5000 and needs no trimmer adjustment. At power-up you hear one beep: keep your eyes open and look ahead for three seconds. When you hear two beeps, close your eyes and wait for three beeps. The code chooses the exact midpoint of the two averages as the threshold, and also works out whether the closed eye reflects more or less. If the difference is below 20 units, a long beep sounds and the Serial Monitor asks you to realign the sensor. You can recalibrate any time by pressing the button on D4; it's a good idea after taking the glasses off and putting them back on.

C++ (Arduino IDE)
1// Sürücü uyku alarmı: TCRT5000 + ortam ışığı telafisi + kalibrasyon / anti-sleep alarm: TCRT5000 + ambient rejection + calibration
2const int IR_LED = 7;           // IR LED, 220 Ω üzerinden / IR LED through 220 Ω
3const int SENSE = A0;           // fototransistör, 10 kΩ pull-up / phototransistor, 10 kΩ pull-up
4const int BUZZER_PIN = 8;
5const int VIBRO_PIN = 9;
6const int CAL_BTN = 4;          // basınca yeniden kalibre et (GND'ye) / press to recalibrate (to GND)
7
8const unsigned long LONG_BLINK_MS = 400, VIBRO_MS = 800, ALARM_MS = 1500, OPEN_CONFIRM_MS = 60;
9
10int threshold = 0;
11bool closedIsHigher = true;     // kapalı göz daha çok mu yansıtıyor? / does the closed eye reflect more?
12bool eyeClosed = false;
13unsigned long closedSince = 0, openSince = 0, minuteStart = 0, closedTotal = 0, lastSample = 0, chirpUntil = 0;
14int longBlinks = 0;
15float smooth = 0;
16
17int readReflect() {             // LED kapalı ve açık okuma farkı / difference between LED off and on
18  digitalWrite(IR_LED, LOW);
19  delayMicroseconds(400);
20  int dark = analogRead(SENSE);
21  digitalWrite(IR_LED, HIGH);
22  delayMicroseconds(400);
23  int lit = analogRead(SENSE);
24  digitalWrite(IR_LED, LOW);    // LED çoğu zaman kapalı: pil ve göz için iyi / LED mostly off: good for battery and eye
25  return dark - lit;
26}
27
28void beep(int count, int ms) {
29  for (int i = 0; i < count; i++) {
30    digitalWrite(BUZZER_PIN, HIGH); delay(ms);
31    digitalWrite(BUZZER_PIN, LOW); delay(ms);
32  }
33}
34
35long averageFor(unsigned long ms) {
36  long sum = 0; int n = 0;
37  unsigned long start = millis();
38  while (millis() - start < ms) { sum += readReflect(); n++; delay(10); }
39  return sum / n;
40}
41
42void calibrate() {
43  beep(1, 200);                                 // 1 bip: gözler açık, ileri bak / 1 beep: eyes open, look ahead
44  long openVal = averageFor(3000);
45  beep(2, 150);                                 // 2 bip: gözleri kapat / 2 beeps: close your eyes
46  delay(500);
47  long closedVal = averageFor(2500);
48  beep(3, 80);                                  // 3 bip: bitti / 3 beeps: done
49  closedIsHigher = closedVal > openVal;
50  threshold = (openVal + closedVal) / 2;
51  smooth = openVal;
52  Serial.print(F("Acik / Open: ")); Serial.print(openVal);
53  Serial.print(F("  Kapali / Closed: ")); Serial.print(closedVal);
54  Serial.print(F("  Esik / Threshold: ")); Serial.println(threshold);
55  if (abs(closedVal - openVal) < 20) {
56    Serial.println(F("Fark cok kucuk: sensoru yeniden hizala / difference too small: realign the sensor"));
57    beep(1, 1000);
58  }
59}
60
61void setOutputs(bool vibro, bool buzzer) {
62  digitalWrite(VIBRO_PIN, vibro ? HIGH : LOW);
63  digitalWrite(BUZZER_PIN, buzzer ? HIGH : LOW);
64}
65
66void setup() {
67  Serial.begin(115200);
68  pinMode(IR_LED, OUTPUT);
69  pinMode(BUZZER_PIN, OUTPUT);
70  pinMode(VIBRO_PIN, OUTPUT);
71  pinMode(CAL_BTN, INPUT_PULLUP);
72  calibrate();
73  minuteStart = millis();
74}
75
76void loop() {
77  unsigned long now = millis();
78  if (digitalRead(CAL_BTN) == LOW) { setOutputs(false, false); calibrate(); return; }
79  if (now - lastSample < 10) return;            // 100 örnek/sn / 100 samples per second
80  lastSample = now;
81
82  smooth = 0.6 * smooth + 0.4 * readReflect();  // hafif yumuşatma / light smoothing
83  bool closedNow = closedIsHigher ? (smooth > threshold) : (smooth < threshold);
84
85  if (closedNow) {
86    openSince = now;
87    if (!eyeClosed) { eyeClosed = true; closedSince = now; }
88  } else if (eyeClosed && now - openSince >= OPEN_CONFIRM_MS) {
89    eyeClosed = false;
90    unsigned long dur = openSince - closedSince;
91    closedTotal += dur;
92    if (dur >= LONG_BLINK_MS) longBlinks++;
93  }
94
95  if (eyeClosed) {
96    unsigned long dur = now - closedSince;
97    if (dur >= ALARM_MS) setOutputs(true, (now / 150) % 2);
98    else if (dur >= VIBRO_MS) setOutputs(true, false);
99    else setOutputs(false, false);
100  } else {
101    setOutputs(false, (long)(chirpUntil - now) > 0);   // engellemeyen yorgunluk bip'i / non-blocking fatigue chirp
102  }
103
104  if (now - minuteStart >= 60000) {             // dakikalık özet / one-minute summary
105    float perclos = 100.0 * closedTotal / 60000.0;   // gözün kapalı geçtiği süre yüzdesi / % of time with eyes closed
106    Serial.print(F("Uzun kirpma / Long blinks: ")); Serial.print(longBlinks);
107    Serial.print(F("  Kapali sure / Closed time: %")); Serial.println(perclos, 1);
108    if (longBlinks >= 3 || perclos > 15) chirpUntil = now + 400;   // yorgunluk uyarısı / fatigue warning
109    longBlinks = 0; closedTotal = 0; minuteStart = now;
110  }
111}
112
FeatureIn the codeWhy it matters
Ambient light rejectionreadReflect(): LED off − LED onThe same threshold works in sunlight and at night
Automatic calibrationcalibrate(): open and closed averagesThe right threshold for every face and pair of glasses
Direction detectionclosedIsHigherWorks even if the sensor angle changes
Smoothingsmooth = 0.6 × old + 0.4 × newReduces jumps caused by vibration
Pulsed LEDThe LED is on for only ~0.5 ms every 10 msAverage LED current drops to about 1 mA
Fatigue summarylongBlinks and perclosShows the minute-by-minute trend, non-blocking beep

A small, battery-powered build with the Arduino Nano

On a head-worn device, weight and the number of wires are everything. The suggested layout: only the sensor on the glasses, the vibration motor and buzzer behind the ear, and the Nano with the battery in a small box clipped to your collar or pocket. A 3.7 V 500 mAh LiPo is charged over USB with a TP4056 module, and an MT3608 boost converter set to 5.0 V feeds the Nano's 5V pin. Let's work out the consumption: the Nano draws about 20 mA, the pulsed IR LED 1 mA on average, and a comparator module a few mA more; about 25 mA in total, or 125 mW at 5 V. The battery holds 500 mAh × 3.7 V = 1,850 mWh; with the converter's 85 percent efficiency about 1,570 mWh is usable. 1,570 / 125 ≈ 12.5 hours. While the alarm is going off the vibration motor draws an extra 60–100 mA, but only during the warning. You can do the maths for your own battery with the battery life tool.

  • Smaller board: The 3.3 V / 8 MHz version of the Arduino Pro Mini, which has no USB chip, runs straight from the LiPo, needs no boost converter and uses less than half the current.
  • Remove the power LED: The power LED on the Nano alone wastes 2–5 mA; over long use that adds up.
  • Charging safety: Use the protected version of the TP4056 (with the DW01 chip, 6 pins) and take the LiPo off the glasses while charging. See the TP4056 guide for details.
  • Where the vibration goes: Glue the motor to the end of the temple behind the ear; vibration carried through the skull is felt far more clearly than on the wrist or in a pocket.
  • Wire: Use thin, multi-strand silicone wire and fix it to the temple with heat-shrink; stiff jumper wires break over time.
  • Pinout: To check the Nano's pins, see the Arduino Nano pinout article.

Project ideas with the anti sleep alarm

  • Study alertness reminder: A desk version that wakes you with a gentle vibration when you start dozing off while studying at night.
  • Blink counter: Measure blinks per minute at the computer and give a break reminder against dry eyes if you're blinking too little.
  • Blink control: Detect two quick blinks as a command and switch an LED or relay; an assistive technology experiment for people with limited mobility.
  • Science fair experiment: Record volunteers' blink durations in the morning and evening and chart how they relate to tiredness.
  • Reaction time test: Turn it into a game that measures blink or button reaction when the buzzer sounds.
  • Logging: Write long blinks with timestamps to an SD card to plot a fatigue curve over the day.

Common mistakes and fixes

SymptomLikely causeFix
Alarm never goes offSensor can't see the eyelid, or CLOSED_LEVEL is invertedAlign with the Serial Plotter; check the module LED lights with the eye closed and switch CLOSED_LEVEL to LOW if needed
Alarm sounds with my eyes openThreshold too sensitive, or sunlightAdjust the trimmer; recalibrate in the advanced version and add a black sleeve to the sensor
False alarms when I turn my headThe glasses slip and the sensor angle changesSecure the glasses with nose pads or an elastic strap
Arduino resets when the vibration motor runsThe motor's current and voltage spikeUse a transistor + diode or a ready module, and add a 100 µF capacitor on the 5V line
'Difference too small' during calibrationSensor too far away or at the wrong angleMove it to 10–15 mm and point it at the middle of the eyelid
Battery runs down faster than expectedPower LED, USB chip and an IR LED that's always onRemove the power LED, use the pulsed LED code or switch to a Pro Mini
When you try the project for the first time, test the alarm thresholds at your desk by deliberately closing and opening your eyes and note the durations in the Serial Monitor. That way you can shift the 400, 800 and 1,500 ms thresholds by a few hundred milliseconds to suit your own blinking habits; everyone's normal blink is a little different.

The anti sleep alarm is a purely experimental project that teaches sensor alignment, timing, calibration and battery maths all in one. If you'd like to try this project's building blocks one by one, such as the buzzer, the infrared sensor and the button, the buzzer and TCRT5000 projects in the BlueGrays app walk you through the circuit diagram and ready-made code step by step, and you can then combine them all in this alarm.

Frequently asked questions

Can an Arduino anti sleep alarm replace a real driver safety system?

No. This is a toy and experiment project; the sensor can slip, be affected by sunlight or the battery can run out. When you feel tired, the only right answer is to stop somewhere safe and rest. Use the project to learn about electronics and sensor logic.

How does an eye blink sensor work?

The sensor consists of an infrared LED and a phototransistor. The LED's light hits the eye and is reflected back, and the amount of reflected light differs with the eye open and closed. The Arduino reads that difference, either as analog or from the module's digital output, and measures when the eye closes and how long it stays closed.

How long does the eye have to stay closed to count as sleep?

A normal blink lasts 100–400 ms. Closures longer than 500 ms are considered a sign of microsleep, and closures of 1–2 seconds are dangerous. In this project anything over 400 ms counts as a long blink, vibration starts at 800 ms and the buzzer joins in at 1.5 seconds.

Can an IR eye blink sensor harm the eye?

The low-power IR LEDs used in this project are not lasers and, driven with a few milliamps in short pulses, don't strain the eye. Still, keep the LED current below 20 mA, pulse the LED rather than keeping it on, and stop using it if your eye feels uncomfortable. Never use a laser module under any circumstances.

Which Arduino is best for an anti sleep alarm?

The Arduino Nano is the most practical choice thanks to its small size, USB and 5 V logic. For a lighter, lower-power design, a 3.3 V / 8 MHz Arduino Pro Mini runs straight from a LiPo battery. The sketches work unchanged on both with the same pins; to program the Pro Mini you need a USB-TTL adapter.

Can a TCRT5000 detect eye blinks?

Yes, if it's aligned properly. The TCRT5000 is really designed for distances of a few millimetres, so at 10–15 mm from the eye the signal difference is small. A difference measurement that cancels ambient light, a black sleeve to block side light and software calibration make that small difference reliable.

See all projects
Using a Buzzer
AR-13Beginner

Using a Buzzer

Ever wondered how a doorbell or an alarm makes its sound? The Arduino makes a small buzzer beep at short intervals: beep, pause, beep, pause.

4.7(93)
180
Reading Reflection (Proximity) with TCRT5000
AR-77Intermediate
Premium

Reading Reflection (Proximity) with TCRT5000

With a small sensor that sends out invisible light and measures how much bounces back, you can detect the surface in front of it.

4.6(33)
43
TCRT5000 Black and White Surface Detection
AR-78Intermediate
Premium

TCRT5000 Black and White Surface Detection

With the little sensor that acts as the eye of line-following robots, you can tell whether the floor is black or white.

4.7(40)
49
Frequency Setting with Buzzer
AR-14Intermediate

Frequency Setting with Buzzer

You control the sound of a buzzer with four buttons: one starts the sound, one silences it, and the other two make it higher or lower.

4.6(69)
124
Arduino Reaction Time Test with Sound Cue: Measure Your Reflexes in Milliseconds (LCD + Buzzer + 3 LEDs)
AR-95Intermediate
Premium

Arduino Reaction Time Test with Sound Cue: Measure Your Reflexes in Milliseconds (LCD + Buzzer + 3 LEDs)

How fast are your reflexes? Press the button: the red LED says get ready, the yellow LED says steady and a random wait of 1.5 to 3.5 seconds begins. The moment the green LED lights up and the buzzer beeps, press again; your reaction time appears on the I2C LCD in milliseconds, with your session best and average below it. Press before green and the screen shows TOO EARLY! with a losing sound. Hold the button for a new player, so everyone races the same wait order.

4.6(34)
51
Laser Warning System
AR-22Intermediate
Premium

Laser Warning System

You set up an invisible beam fence, just like in the movies. A laser shines onto a light sensor on the other side; the moment someone walks through and breaks the beam, the LED lights up and the…

4.8(65)
83
Measuring Light Intensity with an LDR
AR-11Beginner

Measuring Light Intensity with an LDR

Want to see how bright your room is as a number? The LDR, a small part that reacts to light, measures the light around it, and the Arduino writes the value to your computer screen every half second.

4.5(86)
154
HC-SR04 Distance Measurement (Serial Display)
AR-27Beginner

HC-SR04 Distance Measurement (Serial Display)

The HC-SR04 sensor works just like a bat finding its way in the dark: it sends out a sound you cannot hear, listens for the echo and measures how far away the object in front of it is.

4.6(52)
94