Build it step by step
0 of 7 doneWire the three request buttons
D2, D3 and D4 to GND.
Wire the reset button
D5 to GND.
Wire the two LEDs and the buzzer
D8, D9 and D10.
Upload and open the serial monitor at 9600
It says Ready.
Press any request button
Both lamps light and one chime plays.
Press the other request buttons
Nothing more happens.
Press reset
The sign clears.
How do you build a model bus stop request sign?
A row of request buttons along a toy bus lights a Stopping sign and rings a soft chime once, as on a real bus. A reset button clears it when the bus stops. A friendly model for learning about latching signals. You need Arduino Nano, Tactile push button 6 mm × 4, LED 5 mm red × 2, Resistor 220 Ω × 2, Passive buzzer, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 50 minutes.
- Level
- Beginner
- Time
- About 50 min
- Parts
- 7
Parts list
- Development BoardsBuyArduino Nano × 1
- SwitchesBuy
- SemiconductorsBuyLED 5 mm red × 2
- PassivesBuyResistor 220 Ω × 2
- Motors & ActuatorsBuyPassive buzzer × 1
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Request button 1 | Nano D2 and GND | Pressing joins D2 to ground |
| Request button 2 | Nano D3 and GND | Pressing joins D3 to ground |
| Request button 3 | Nano D4 and GND | Pressing joins D4 to ground |
| Reset button (driver) | Nano D5 and GND | Pressing joins D5 to ground |
| Stopping sign LED long leg | Nano D8 through a 220 ohm resistor, short leg to GND | The passengers' sign |
| Driver lamp LED long leg | Nano D9 through a 220 ohm resistor, short leg to GND | The driver's lamp |
| Passive buzzer + and - | Nano D10 and GND | The chime |
Code
On a bus, the first passenger to press a stop button lights a sign for everybody, and more presses do nothing until the bus has stopped. In programming terms the sign is latched: once it turns on it stays on by itself. The sketch has two states, waiting and stopping. In the waiting state it looks at the three request buttons, and the first press lights the passenger sign and the driver's lamp and plays one two-note chime. In the stopping state it ignores the request buttons and watches only the driver's reset button. Test it with all three buttons pressed together and listen for just one chime. This is a model for learning about latches and states. Think about what else a real bus does, such as a wheelchair request that uses a different chime, and try adding it with a fourth request button.
Runs on a virtual Arduino Nano 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).
const uint8_t REQUEST_PINS[3] = {2, 3, 4};
const uint8_t RESET_PIN = 5;
const uint8_t SIGN_LED = 8;
const uint8_t DRIVER_LED = 9;
const uint8_t BUZZER_PIN = 10;
bool stopping = false;
void chime() { // a soft two-note ding-dong
tone(BUZZER_PIN, 880, 200);
delay(250);
tone(BUZZER_PIN, 660, 300);
delay(350);
}
void setup() {
for (int i = 0; i < 3; i++) pinMode(REQUEST_PINS[i], INPUT_PULLUP);
pinMode(RESET_PIN, INPUT_PULLUP);
pinMode(SIGN_LED, OUTPUT);
pinMode(DRIVER_LED, OUTPUT);
pinMode(BUZZER_PIN, OUTPUT);
Serial.begin(9600);
Serial.println("Ready.");
}
void loop() {
if (!stopping) {
for (int i = 0; i < 3; i++) {
if (digitalRead(REQUEST_PINS[i]) == LOW) { // the first press latches the sign
stopping = true;
digitalWrite(SIGN_LED, HIGH);
digitalWrite(DRIVER_LED, HIGH);
chime(); // only one chime, however many presses
Serial.print("Stop requested from button ");
Serial.println(i + 1);
break;
}
}
} else if (digitalRead(RESET_PIN) == LOW) { // the driver clears it
stopping = false;
digitalWrite(SIGN_LED, LOW);
digitalWrite(DRIVER_LED, LOW);
Serial.println("Sign cleared.");
delay(300);
}
delay(20);
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
Ready.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Waiting | Both lamps off |
| First request | Lamps on and a single chime |
| More requests | Ignored |
| Reset button | Lamps off, ready again |
| Serial monitor | Names the button that was pressed |
If it does not work
No chime
Check you have a passive buzzer on D10.
Chime plays more than once
Check the latch logic, buttons should be ignored while stopping.
Sign never clears
Check the reset button goes to D5 and GND.
LED stays dark
Check its direction and its resistor.
Nothing happens at all
Check each button goes to its pin and GND.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the model bus stop request sign?
Arduino Nano, Tactile push button 6 mm × 4, LED 5 mm red × 2, Resistor 220 Ω × 2, Passive buzzer, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the model bus stop request sign take to build?
About 50 minutes for a beginner maker, in 7 steps.
How do I know the model bus stop request sign works?
Waiting: Both lamps off. First request: Lamps on and a single chime. More requests: Ignored.
No chime: what should I check?
Check you have a passive buzzer on D10.
Chime plays more than once: what should I check?
Check the latch logic, buttons should be ignored while stopping.
Sign never clears: what should I check?
Check the reset button goes to D5 and GND.
LED stays dark: what should I check?
Check its direction and its resistor.
