Lesson 1: Button & OLED Countdown
Wire the OLED screen and a button, then make a 20-second countdown that a press starts and a second press cancels.
Everything for the bench, in the order you need it: set up the computer and the board, then the lessons. Keep this page open while you build.
Follow these 7 steps before Lesson 1. They take about 45-60 minutes, most of it the one-time ESP32 download, and prove your computer, cable and ESP32 work - so if something goes wrong later, you know it is the wiring, not the setup.
Lessons 1-4 need only the kit, a computer and a USB-C data cable. Lesson 4 needs the buzzer module, an optional add-on - without it, Lesson 5 still works, silently. Lessons 3 and 5 also need a cushion and a small box or book from home. Lesson 5 is an experiment on a padded bench - never on a person or a wheelchair.
Safety: Small parts: keep them away from young children and pets.
Photos are the catalogue pictures of each part. Your parts may differ slightly in colour - go by the shape, the pins and the labels.
You should see: You have the 6 items listed below - plus the buzzer module if you added it (it is optional).
| Something is missing or broken | Send us a photo with your order number on WhatsApp. |
| You also need (not in the box) | For | Note |
|---|---|---|
| A computer (Windows, macOS or Linux) where you can install the free Arduino IDE 2 and the ESP32 tools | All lessons | |
| A USB-C data cable - not a charge-only cable | All lessons | The ESP32U has a USB-C socket |
| An internet connection, for the IDE, the ESP32 tools and the libraries | Start here, Lesson 1 | |
| A small light box or book, and tape, as a test platform | Lessons 2, 3 and 5 | |
| A cushion or foam pad | Lessons 3 and 5 | Tests only on a padded, unoccupied platform |
| Soldering, by an adult | Only if the GY-521 or OLED pins arrive loose | Adult only |
| A multimeter | Optional | No lesson needs one. Useful for an adult checking 3.3 V and GND. |
You should see: You have a computer, a USB-C data cable, an internet connection and an adult nearby.
You should see: Tools → Board now has an "esp32" section.
| The download or install is blocked | School and work computers often block installs. Ask an adult or use a home computer. |
| "esp32 by Espressif Systems" is not listed | Check the Preferences address is pasted exactly, then close and reopen the Boards Manager. |
Safety: Put the ESP32 on a dry table, away from coins, paper clips and other metal - they can touch the pins underneath and cause a short.
You should see: A small red power light on the ESP32 lights up.
| No light at all | Push the plug fully in. Try another USB port, then another cable. |
You should see: The bottom of the IDE window shows "ESP32 Dev Module" and your port.
| The Port menu is empty | Many USB cables only charge. Use a data cable. |
| Windows shows an unknown device | Look at the small chip next to the USB socket: CP2102 or CH340. The computer needs the free driver for that chip - ask us on WhatsApp for the link. |
| Linux: "permission denied" on the port | Ask an adult to add your user to the dialout group (sudo usermod -a -G dialout $USER), then log out and back in. |
You should see: Every 3 seconds the Serial Monitor prints the chip model (ESP32-D0WD…), its revision and the number of cores.
Try it: Change delay(3000) to delay(1000) and upload again. The lines appear every second. Now you know you can change code and upload it.
| The upload stops at "Connecting....____" | Hold down the BOOT button on the ESP32 when "Connecting" appears, and let go when the percentage starts. |
| "Failed to connect" or "port is busy" | Close the Serial Monitor and any other program using the port, choose the port again (step 5) and retry. |
| A red "Compilation error" | Check Tools → Board is ESP32 Dev Module. Close the example without saving and open it again. |
| The Serial Monitor shows strange symbols | Set the speed to 115200 baud. Press the EN (reset) button to start the sketch again. |
You should see: You are ready to build.
Open Lesson 1 → Printable manualEvery lesson runs on screen with the same code and pins. It is a good way to check your code - but it is not the real breadboard:
Most problems are one wire in the wrong hole. Check these first:
Open the troubleshooting table for this step →
Hi DIY KIT, I'm stuck on the ESP32 Fall-Detection Learning Prototype. Lesson: __ Step number: __ What should happen: __ What happens instead: __ Error message (copied exactly): __ I'll attach a photo of my wiring.
Every one is built from the parts in the box, plus the basics listed under You'll also need.
Free with this kit · print or PDF The complete kit manual Everything on this page, ready for the bench: a parts checklist, wiring tables and step-by-step instructions for every project. 5 step-by-step guides Parts checklist QR to every project Open the manualWire the OLED screen and a button, then make a 20-second countdown that a press starts and a second press cancels.
Add the motion sensor. It learns which way is "upright", then the OLED shows how many degrees you have tilted it.
Draw the total g-force on a live graph and count every jolt and every drop - the two signals the main build looks for.
Add the buzzer and build an alert that beeps until you press the button - and stops by itself after 15 seconds.
Put it all together: a jolt or drop followed by staying tipped over starts a beeping 20-second countdown that the button cancels. A learning experiment on the bench - not a safety device.
No projects in that group.
Start here installs the ESP32 tools. Then 5 lessons build one bench experiment step by step: a button and screen, a tilt angle, jolt and drop data, a buzzer alert (the buzzer is an optional add-on), and finally the fall-detection rule. Every lesson page has a connection diagram, a wiring table, numbered steps, the code, what you should see and a fix-it table.
Read an accelerometer over I2C, work out a tilt angle from a baseline, and see free fall and impacts in g.
A debounced button, a countdown on the OLED and a buzzer alert that can be acknowledged and times out.
A state machine that needs a jolt and staying tipped over, handles faults clearly, and is tested for false alarms and misses.
| Step | What must happen | Named in the code |
|---|---|---|
| 1. Calibrate | Kept still for 3 seconds: the sensor learns "upright" | 150 samples |
| 2. Candidate | Total above 2.5 g (jolt) or below 0.45 g (drop) | IMPACT_G, FREEFALL_G |
| 3. Confirm | Within 5 s, tipped more than 55° from upright for 1.5 s | CANDIDATE_MS, TILT_DEG, TILT_HOLD_MS |
| 4. Countdown | 20 seconds, a beep each second; the button cancels | COUNTDOWN_MS |
| 5. Local alert | Beeps until the button acknowledges - nothing is sent | - |
These are starting values for an experiment, not validated fall criteria.
| Screen | Meaning | What to do |
|---|---|---|
| KEEP STILL AND LEVEL | Learning "upright" for 3 seconds | Do not move the platform |
| MONITORING | Reading the sensor; shows total g and the event count | Start your controlled tests |
| POSSIBLE EVENT | The rule matched; the countdown is running | Press the button to cancel |
| NO EVENT | A jolt or drop, but it did not stay tipped over within 5 seconds | Nothing - monitoring resumes |
| CANCELLED / ACKNOWLEDGED | You pressed the button | Monitoring resumes |
| LOCAL ALERT | The countdown ran out | Press to acknowledge - no message was sent |
| FAULT - POWER OFF | A device is missing, calibration failed or reads failed | Unplug USB and check the wiring |
| Part | ESP32 pin (printed label) | Lessons |
|---|---|---|
| OLED and GY-521 SDA / SCL | GPIO21 / GPIO22 | All |
| OLED, GY-521 and buzzer VCC | 3V3 (never 5V) | All |
| Push button | GPIO26 and GND | All |
| Buzzer I/O | GPIO27 | 4, 5 |
| On-board LED (if fitted) | GPIO2 | 1, 5 |
All 5 sketches compile for the ESP32 Dev Module (ESP32 core 3.3.11) with no warnings and run in the kit simulator. The complete physical build, the thresholds and the detection have not been bench-tested. Parts may differ slightly from the photos - go by the labels printed on your parts.
Tick steps off as you go — your place is kept on this device.
One sketch per project, written for the boards in this kit. Open a project to read it with its wiring, or copy it there.
We use cookies that the shop needs to work — signing in, your cart, form security. We also measure how the shop is used so we can stock the right parts and fix what is broken. Choose “Only essential” and we will not load Google Analytics or the Meta pixel, and will not record your visit. Read more.