Live Kit Page
Live now IoT kit

Wheelchair Fall Alert Kit (IoT)

Wheelchair Fall Alert Kit (IoT)

A wheelchair-mounted fall detection device. The motion sensor detects a hard impact or free-fall followed by sustained tilt, sounds a buzzer alarm and starts a 20-second countdown on the OLED display. Press the snooze button and it cancels; ignore it and an alert goes straight to the caregiver phone via Telegram. Sends a daily "device OK" heartbeat so a flat battery is never missed, and runs on a rechargeable 18650 battery so it moves with the chair. Assistive aid, not a medical device.

Intermediate Per project: 60-90 minutes 9 included parts 1 optional add-ons Best for IoT, automation, and smart-system builders Coding included
AED180.00 Complete kit — 9 parts included
Assembled kits in stock (1) · ships in 1–3 working days
You’ll also need (not included)
  • A computer to upload the code (Raspberry Pi) — the full sketch is on this page
  • A stable work surface and time to wire the kit carefully
  • A laptop or desktop to upload code and read Serial/console output
  • A multimeter is recommended for safer first testing and troubleshooting
Back to live kits
Required parts are already included. Optional add-ons you select below will update the total here before adding the kit to cart.
Auto kit diagram

Wheelchair Fall Alert - Wiring Overview

This visual layout is generated from the real linked kit products, so shoppers can see the build map even without a manually uploaded diagram image.

Ready-built and in stock now

We have this kit already assembled, wired and tested — add it to your cart and it ships as one working unit. Prefer to build it yourself? The loose-parts version is below.

1 ready to ship
Ready now · ships in 1–3 days Assembled & tested · we build it

Wheelchair Fall Alert Kit (IoT)

AED250.00
  • Wired, flashed with the code below, and bench-tested
  • Arrives ready to switch on
  • 1 ready to ship now
Parts kit · you build it

Everything you need, unassembled

AED180.00
  • All 9 required parts, shipped loose
  • Full wiring diagram, build steps and code on this page
  • Best if you want to learn how it works
See the parts list

Before you order

What you’ll build, who it’s designed for, what tools you still need, and how to get a custom version if this isn’t quite right.

Project-first buying guide

What you will build

Build a moving robot project that senses, decides, and reacts.

Who this is best for

Best for IoT, automation, and smart-system builders

Tools and preparation

A stable work surface and time to wire the kit carefully A laptop or desktop to upload code and read Serial/console output A multimeter is recommended for safer first testing and troubleshooting

Why order this as a kit

Single kit price Included parts visible Customizable if needed Code and setup guidance Live support available
Ask for a custom version if you need different boards, sensors, quantities, or classroom packs. Use support if you want help choosing between similar kits before ordering. This kit includes a coding path, so support can help you confirm pins, libraries, and first-test workflow.

Included in this kit

Every part in this kit with its quantity. All components ship together at one combined price.

One combined kit price
ESP32U Development Board, WiFi Bluetooth IoT NodeMCU-32 Module, DevKitC with TYPE-C Interface, Development Kit for Electronics Projects ×1

ESP32U Development Board, WiFi Bluetooth IoT NodeMCU-32 Module, DevKitC with TYPE-C Interface, Development Kit for Electronics Projects

SKU: ESP32U

ESP32U - processor + WiFi in one board (replaces Arduino + ESP8266)

GY-521 MPU-6050 6DOF IMU Sensor Module – 3-Axis Gyroscope + 3-Axis Accelerometer, I2C ×1

GY-521 MPU-6050 6DOF IMU Sensor Module – 3-Axis Gyroscope + 3-Axis Accelerometer, I2C

SKU: GY-521

GY-521 MPU6050 - detects impact and tilt (I2C)

0.96" OLED Display Module 128x64 I2C (White) ×1

0.96" OLED Display Module 128x64 I2C (White)

SKU: DIY-003

0.96in OLED status screen - shares the same I2C bus

Active Buzzer Module 5V DC, Plug-and-Play Beeper Sounder Board for Arduino, Simple ON/OFF Alarm Output, 2-Pack Electronic Buzzer for DIY Projects, Sensors, Robotics & Alerts ×1

Active Buzzer Module 5V DC, Plug-and-Play Beeper Sounder Board for Arduino, Simple ON/OFF Alarm Output, 2-Pack Electronic Buzzer for DIY Projects, Sensors, Robotics & Alerts

SKU: DIY-016

Local buzzer alarm - works even without WiFi

Tactile Microswitch Kit 25pcs 12x12x7.3mm Momentary Push Button Switches with Assorted Coloured Caps, Through-Hole 4-Pin PCB Tact Switch Set with Storage Box for DIY Electronics ×1

Tactile Microswitch Kit 25pcs 12x12x7.3mm Momentary Push Button Switches with Assorted Coloured Caps, Through-Hole 4-Pin PCB Tact Switch Set with Storage Box for DIY Electronics

SKU: DIY-158

Snooze / I-am-OK button (from the 25pc tactile switch kit)

18650 Battery Holder Case, Single Cell 3.7V Li-ion Battery Slot, Black Plastic Housing with Pre-Soldered Red/Black Lead Wires, DIY Power Supply Holder for Arduino ESP32 Projects ×1

18650 Battery Holder Case, Single Cell 3.7V Li-ion Battery Slot, Black Plastic Housing with Pre-Soldered Red/Black Lead Wires, DIY Power Supply Holder for Arduino ESP32 Projects

SKU: DIY-020

18650 holder - portable power, no wall adapter

TP4056 Micro USB 5V 1A Li-ion Battery Charger Module with Protection for 1S 3.7V 18650 Cells, Overcharge/Overdischarge/Short-Circuit Safety, DIY Power Bank Charging Board ×1

TP4056 Micro USB 5V 1A Li-ion Battery Charger Module with Protection for 1S 3.7V 18650 Cells, Overcharge/Overdischarge/Short-Circuit Safety, DIY Power Bank Charging Board

SKU: TP4056 Type-MICRO

TP4056 charger - recharge by USB

Male to Male Jumper Wires 40pcs 10cm Breadboard Dupont Cables Ribbon Connector Leads for Arduino Raspberry Pi Prototyping, Multicolor 2.54mm Pin Headers DIY Kit ×1

Male to Male Jumper Wires 40pcs 10cm Breadboard Dupont Cables Ribbon Connector Leads for Arduino Raspberry Pi Prototyping, Multicolor 2.54mm Pin Headers DIY Kit

SKU: DIY-00048

Male-to-male jumper wires

Included part image
×1

BREADBOARD 830 TIE POINT

SKU: DIY-217

830-point breadboard (170pt mini is too small for an ESP32)

Optional add-ons

Once the base build path makes sense, use these extras to expand the project without changing the included kit price. Selecting one will update the live total immediately before checkout.

Transparent ABS Plastic Case Shell Box for Arduino UNO R3 ×1

Transparent ABS Plastic Case Shell Box for Arduino UNO R3

SKU: DIY-00084

Updates kit total when selected

Build diagram

Understand how the included parts connect before you start wiring. Always cross-check with individual component datasheets.

Visual build map
Visual representation only

This diagram is shown for visual understanding only. For exact wiring, calibration, measurements, or scientific correctness, please refer to the individual product manuals.

Published diagram layout

Wheelchair Fall Alert - Wiring Diagram

This admin-approved diagram comes from Preview Studio, so the card positions, connector lines, and auto-filled part copy can be curated before the shopper sees the build map.

Jumper wiring VCC / GND IMU I2C SDA / SCL OLED I2C SDA / SCL Button input SIG / GND Power source VIN / 5V Charging B+ / B- to battery Buzzer output Digital pin
ESP32U Development Board
ESP32U
ESP32U Development Board
ESP32U - processor + WiFi in one board (replaces Arduino + ESP8266)
Qty 1
GY-521 MPU-6050 6DOF IMU Sensor Module…
GY-521
GY-521 MPU-6050 6DOF IMU Sensor Module…
GY-521 MPU6050 - detects impact and tilt (I2C)
Qty 1
Tactile Microswitch Kit 25pcs 12x12x7.3mm…
DIY-158
Tactile Microswitch Kit 25pcs 12x12x7.3mm…
Snooze / I-am-OK button (from the 25pc tactile switch kit)
Qty 1
18650 Battery Holder Case
DIY-020
18650 Battery Holder Case
18650 holder - portable power, no wall adapter
Qty 1
TP4056 Micro USB 5V 1A Li-ion Battery Charger…
TP4056 Type-MICRO
TP4056 Micro USB 5V 1A Li-ion Battery Charger…
TP4056 charger - recharge by USB
Qty 1
0.96" OLED Display Module 128x64 I2C (White)
DIY-003
0.96" OLED Display Module 128x64 I2C (White)
0.96in OLED status screen - shares the same I2C bus
Qty 1
Active Buzzer Module 5V DC
DIY-016
Active Buzzer Module 5V DC
Local buzzer alarm - works even without WiFi
Qty 1
DIY2
DIY-217
BREADBOARD 830 TIE POINT
830-point breadboard (170pt mini is too small for an ESP32)
Qty 1
Male to Male Jumper Wires 40pcs 10cm…
DIY-00048
Male to Male Jumper Wires 40pcs 10cm…
Male-to-male jumper wires
Qty 1
Transparent ABS Plastic Case Shell Box
DIY-00084
Transparent ABS Plastic Case Shell Box
Protective enclosure
Qty 1
This published diagram preview is the current curated build-map layout for this kit.
Start in the center Read the controller or main board first, then move outward to the connected sensors, displays, and outputs.
Use the side cards as real parts Every card in the auto visual diagram is based on the linked kit products, so the shopper sees the actual included pieces instead of a generic mockup.
Optional add-ons stay separate The optional row helps buyers understand what the kit already includes and what can be added later without changing the base build path.

How the wiring flows

Read the project from the controller outward: shared power first, then inputs, then display or output stages.

Base wiring path ESP32U Development Board, WiFi Bluetooth IoT NodeMCU-32 Module, DevKitC with TYPE-C Interface, Development Kit for Electronics Projects shares power, ground, and signal access through Male to Male Jumper Wires 40pcs 10cm Breadboard Dupont Cables Ribbon Connector Leads for Arduino Raspberry Pi Prototyping, Multicolor 2.54mm Pin Headers DIY Kit.
Input linkage ESP32U Development Board, WiFi Bluetooth IoT NodeMCU-32 Module, DevKitC with TYPE-C Interface, Development Kit for Electronics Projects reads GY-521 MPU-6050 6DOF IMU Sensor Module – 3-Axis Gyroscope + 3-Axis Accelerometer, I2C and turns that signal into useful project data.
Feedback path ESP32U Development Board, WiFi Bluetooth IoT NodeMCU-32 Module, DevKitC with TYPE-C Interface, Development Kit for Electronics Projects sends live results to 0.96" OLED Display Module 128x64 I2C (White) so the builder can verify the project visually.
Power approach 18650 Battery Holder Case, Single Cell 3.7V Li-ion Battery Slot, Black Plastic Housing with Pre-Soldered Red/Black Lead Wires, DIY Power Supply Holder for Arduino ESP32 Projects should be connected only after the wiring and polarity have been checked against the diagram.

Best build order

Build in this order so you can isolate mistakes early instead of rewiring the full project later.

Build step Mount or place the controller first so every other connection has a clear reference point.
Build step Create the shared wiring path using Male to Male Jumper Wires 40pcs 10cm Breadboard Dupont Cables Ribbon Connector Leads for Arduino Raspberry Pi Prototyping, Multicolor 2.54mm Pin Headers DIY Kit before you add the modules.
Build step Connect and test one sensor first, then add the second sensor only after the first one behaves correctly.
Build step Add the display after the input side is stable so you can show the readings clearly.
Build step Add the motion or output stage last, after you trust the sensor and controller logic.
Build step Treat optional parts as upgrades and add them only after the base kit is fully working.

Best approach for students and first-time builders

This is the safer workflow to follow before deciding the kit is ready to order and build.

Good practice Start with power and ground rails first, then add one signal connection at a time.
Good practice Test the main board by itself before connecting every sensor and output together.
Good practice Keep the first upload simple: make one module respond, then grow the project step by step.
How to read this diagram Read the diagram as a story: power comes in, the controller thinks, the sensors report, and the output or display shows the result.

Build steps

The exact assembly order we follow when we build this kit, photographed step by step.

10 steps
01

Seat the ESP32U on the breadboard

Place the ESP32U Development Board straddling the breadboard center gap so each header row lands on a separate side. Make sure the USB-C connector is accessible and the board sits flat with no pins bent or missing contact.

02

Build the 3.3V and GND rails

Use jumper wires to connect an ESP32 GND pin to the breadboard ground rail, and connect the ESP32 3V3 pin to the breadboard 3.3V rail. Double-check you are using 3V3 (not VIN/5V) because all logic must be 3.3V and the I2C modules should be powered from 3.3V here.

03

Wire the OLED display to I2C

Connect the OLED module VCC to the 3.3V rail and GND to the ground rail, then connect SDA to ESP32 GPIO21 and SCL to ESP32 GPIO22. Before moving on, confirm the OLED pins are not swapped (SDA/SCL) and that VCC is on 3.3V, not 5V.

04

Wire the MPU-6050 (GY-521) to I2C

Connect GY-521 VCC to the 3.3V rail and GND to the ground rail, then connect SDA to GPIO21 and SCL to GPIO22 (sharing the same I2C bus as the OLED). Check that both I2C devices share the same SDA/SCL lines and that the GY-521 is not powered from 5V.

05

Add the snooze button input

Insert one tactile switch so it straddles the breadboard center gap (so the internal pairs aren’t shorted on the same side), then wire one side of the switch to GND and the opposite side to ESP32 GPIO27. Verify with a quick visual check that pressing the button will connect GPIO27 to GND, and plan to use the ESP32 internal pull-up in software (no external resistor needed).

06

Connect the buzzer module signal safely

Place the active buzzer module on the breadboard and wire its GND to the ground rail, then wire its signal input (often marked IN or SIG) to ESP32 GPIO25. Do not connect the buzzer VCC yet; also confirm you did not choose any of GPIO6–11 and that you’re using an output-capable pin (not GPIO34–39).

07

Power the buzzer from 3.3V (not 5V)

Connect the buzzer module VCC to the 3.3V rail so the ESP32 never has to drive a 5V logic input, and so the module can’t feed 5V back into a GPIO. If your buzzer module is labeled “5V,” it may be quieter at 3.3V, but it is the safe choice for this kit; confirm VCC is on 3.3V and GND is common with the ESP32.

08

Wire the TP4056 charger to the battery holder

With no battery inserted, connect the battery holder red lead to TP4056 B+ and the battery holder black lead to TP4056 B- (polarity matters). Re-check the markings on the TP4056 board before tightening/committing the connections, because reversing B+ and B- can damage the protection circuit and the cell.

09

Provide regulated power to the ESP32 (power last)

Do not connect the TP4056 output to the ESP32 yet; first decide that the ESP32 will be powered by USB-C for initial testing, then later by a proper 3.3V regulator (not included in this parts list). For now, keep the battery and TP4056 electrically isolated from the ESP32 and modules, and only plug in USB-C to power the ESP32 for bring-up.

10

Power up and verify I2C, button, and buzzer

Plug the ESP32 into USB-C and run your test firmware: confirm the OLED shows text, the MPU-6050 is detected on I2C (GPIO21/22), and the button on GPIO27 reads pressed when held (with internal pull-up enabled). Finally, toggle GPIO25 to confirm the buzzer sounds, and if anything behaves oddly, unplug USB immediately and re-check 3.3V vs 5V, SDA/SCL swaps, and all GND connections before continuing.

Code & setup

What to upload first, how the logic is structured, and how to verify the build is working correctly.

Coding needed
Main sketch (wheelchair_fall_alert.ino) arduino · 237 lines
// TARGET BOARD: ESP32 (ESP32U Development Board)

#include <WiFi.h>
#include <WiFiClientSecure.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>

// ----------------------------
// Pin constants (easy to change)
// ----------------------------
// I2C uses default ESP32 pins: SDA=GPIO21, SCL=GPIO22 (shared by OLED + MPU6050)
static const int PIN_BUZZER = 25;     // Active buzzer module input (ON/OFF). Use a safe GPIO output pin.
static const int PIN_SNOOZE = 27;     // Momentary button to GND (uses internal pull-up)

// ----------------------------
// OLED configuration
// ----------------------------
static const int OLED_WIDTH = 128;
static const int OLED_HEIGHT = 64;
static const int OLED_RESET = -1;     // Most 0.96" I2C OLEDs do not use a reset pin
static const uint8_t OLED_ADDR = 0x3C;

// ----------------------------
// MPU6050 configuration
// ----------------------------
static const uint8_t MPU_ADDR = 0x68; // Typical for GY-521 (AD0 low)

// ----------------------------
// WiFi + Telegram configuration (EDIT THESE)
// ----------------------------
static const char* WIFI_SSID = "YOUR_WIFI_SSID";
static const char* WIFI_PASS = "YOUR_WIFI_PASSWORD";

// Telegram bot token from @BotFather, looks like: 123456789:ABCdef...
static const char* TELEGRAM_BOT_TOKEN = "YOUR_BOT_TOKEN_HERE";

// Chat ID to receive alerts (your user ID or a group ID). Example: "123456789" or "-1001234567890"
static const char* TELEGRAM_CHAT_ID = "YOUR_CHAT_ID_HERE";

// ----------------------------
// Behavior tuning (thresholds)
// ----------------------------
// Impact detection: acceleration magnitude spike (m/s^2). 1g ~ 9.81 m/s^2.
// Typical "hard bump" might exceed ~2.5g to 3.5g depending on mounting.
static const float IMPACT_G_THRESHOLD_G = 2.8f; // in g
// Free-fall detection: acceleration magnitude near 0g.
static const float FREEFALL_G_THRESHOLD_G = 0.35f; // in g

// Tilt detection: sustained tilt angle (degrees) after event.
static const float TILT_ANGLE_DEG_THRESHOLD = 55.0f; // degrees from "upright"
// How long tilt must be sustained to confirm (ms)
static const uint32_t TILT_SUSTAIN_MS = 2500;

// Countdown duration before sending Telegram alert (seconds)
static const uint32_t ALERT_COUNTDOWN_S = 20;

// Heartbeat interval (ms): daily "device OK"
static const uint32_t HEARTBEAT_INTERVAL_MS = 24UL * 60UL * 60UL * 1000UL;

// Sensor sampling interval (ms)
static const uint32_t SAMPLE_INTERVAL_MS = 50;

// Debounce for button (ms)
static const uint32_t BUTTON_DEBOUNCE_MS = 35;

// ----------------------------
// Globals
// ----------------------------
Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT, &Wire, OLED_RESET);
Adafruit_MPU6050 mpu;

WiFiClientSecure tlsClient;

// State machine for alert flow
enum AlertState {
  STATE_IDLE = 0,
  STATE_SUSPECTED_EVENT,   // impact/free-fall detected; now checking sustained tilt
  STATE_COUNTDOWN,         // confirmed; buzzer + countdown; snooze cancels
  STATE_SENT,              // alert sent; wait for reset conditions
  STATE_ERROR              // sensor/display init error
};

AlertState state = STATE_IDLE;

uint32_t lastSampleMs = 0;
uint32_t lastHeartbeatMs = 0;

uint32_t eventStartMs = 0;        // when impact/free-fall detected
uint32_t tiltStartMs = 0;         // when tilt first exceeded threshold
uint32_t countdownStartMs = 0;     // when countdown started

bool oledOK = false;
bool mpuOK = false;

// Button handling
bool lastButtonRaw = true;        // pull-up => HIGH when not pressed
bool buttonStable = true;
uint32_t lastButtonChangeMs = 0;

// For display updates
uint32_t lastDisplayMs = 0;

// ----------------------------
// Helper: safe buzzer control (active buzzer: ON/OFF)
// ----------------------------
void buzzerOn() {
  digitalWrite(PIN_BUZZER, HIGH);
}

void buzzerOff() {
  digitalWrite(PIN_BUZZER, LOW);
}

// ----------------------------
// Helper: read snooze button with debounce (returns true when pressed event occurs)
// Wiring: one side to GPIO, other side to GND. Internal pull-up enabled.
// ----------------------------
bool snoozePressedEvent() {
  bool raw = digitalRead(PIN_SNOOZE); // HIGH = not pressed, LOW = pressed

  if (raw != lastButtonRaw) {
    lastButtonRaw = raw;
    lastButtonChangeMs = millis();
  }

  // If stable long enough, accept new stable state
  if ((millis() - lastButtonChangeMs) > BUTTON_DEBOUNCE_MS) {
    if (buttonStable != raw) {
      buttonStable = raw;
      // Detect transition to pressed (LOW)
      if (buttonStable == LOW) {
        return true;
      }
    }
  }
  return false;
}

// ----------------------------
// Helper: OLED text rendering
// ----------------------------
void oledClearAndPrint(const String& line1, const String& line2 = "", const String& line3 = "", const String& line4 = "") {
  if (!oledOK) return;

  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);

  display.println(line1);
  if (line2.length()) display.println(line2);
  if (line3.length()) display.println(line3);
  if (line4.length()) display.println(line4);

  display.display();
}

// ----------------------------
// Helper: connect WiFi (non-blocking-ish with timeout)
// ----------------------------
bool ensureWiFiConnected(uint32_t timeoutMs) {
  if (WiFi.status() == WL_CONNECTED) return true;

  WiFi.mode(WIFI_STA);
  WiFi.begin(WIFI_SSID, WIFI_PASS);

  uint32_t start = millis();
  while (WiFi.status() != WL_CONNECTED && (millis() - start) < timeoutMs) {
    delay(50);
  }
  return (WiFi.status() == WL_CONNECTED);
}

// ----------------------------
// Helper: URL encode minimal set (spaces/newlines mainly)
// ----------------------------
String urlEncode(const String& s) {
  String out;
  out.reserve(s.length() * 3);

  const char* hex = "0123456789ABCDEF";
  for (size_t i = 0; i < s.length(); i++) {
    uint8_t c = (uint8_t)s[i];
    // Unreserved characters per RFC3986
    bool unreserved =
      (c >= 'A' && c <= 'Z') ||
      (c >= 'a' && c <= 'z') ||
      (c >= '0' && c <= '9') ||
      c == '-' || c == '_' || c == '.' || c == '~';

    if (unreserved) {
      out += (char)c;
    } else {
      out += '%';
      out += hex[(c >> 4) & 0x0F];
      out += hex[c & 0x0F];
    }
  }
  return out;
}

// ----------------------------
// Helper: send Telegram message via HTTPS (no extra libraries)
// Uses api.telegram.org with a simple GET request.
// Note: This uses setInsecure() to avoid certificate management in a kit.
// ----------------------------
bool telegramSendMessage(const String& text) {
  if (!ensureWiFiConnected(8000)) {
    Serial.println("WiFi not connected; cannot send Telegram message.");
    return false;
  }

  tlsClient.setInsecure(); // Simplifies TLS for kits; acceptable for DIY but not best practice.

  const char* host = "api.telegram.org";
  const int httpsPort = 443;

  if (!tlsClient.connect(host, httpsPort)) {
    Serial.println("TLS connect to Telegram failed.");
    return false;
  }

  String url = "/bot";
  url += TELEGRAM_BOT_TOKEN;
  url += "/sendMessage?chat_id=";
  url += TELEGRAM_CHAT_ID;
  url += "&text=";
  url += urlEncode(text);

  // Basic HTTP/1.1 GET
  tlsClient.print(String("GET ") + url + " HTTP/1.1\r\n" +
                  "Host: " + host + "\r\n" +
                  "User-Agent: ESP32-FallAlertKit\r\n" +
                  "Connection: close\r\n\r\n");
Install: WiFi, WiFiClientSecure, Wire, Adafruit GFX Library, Adafruit SSD1306, Adafruit MPU6050, Adafruit Unified Sensor — Set your WiFi SSID/PASSWORD, Telegram BOT token and CHAT_ID, and confirm the buzzer/button GPIO pins match your wiring before uploading.
Raspberry Pi Intermediate Python

What you will need to do

This robotics kit needs a controller loop that reads sensors and converts them into movement safely.

Adafruit SSD1306 + Adafruit GFX Python 3 plus the GPIO/sensor packages that match your exact module SSD1306 / OLED Python library
01
Upload a small sensor-only test first and confirm the readings make sense.
02
Add the motor driver or servo control only after the sensors behave correctly.
03
Start with slow movement values so the robot is easy to control while debugging.
04
Tune thresholds, motor direction, and delays on the real build surface before calling the project finished.
01
In a robotics kit, the code loop keeps repeating: read the world, decide what to do, then move.
02
Never debug motors and sensors at the same time if you are stuck. Get one layer working first.
03
Keep your first robot logic simple, then improve it after the chassis behaves safely.

Full project code

This is the main working code for the kit. Read the diagram, connection map, and setup steps first, then use this as the primary sketch or script for the project.

main.py · Python
import time

DRIVE_DELAY_SECONDS = 0.05

def read_inputs():
    # Replace this with your sensor reads.
    return {
        "front_clear": True,
        "left_clear": True,
        "right_clear": True,
    }

def decide_motion(inputs):
    if not inputs["front_clear"]:
        return {"mode": "stop", "left_speed": 0.0, "right_speed": 0.0}
    if not inputs["left_clear"]:
        return {"mode": "turn_right", "left_speed": 0.35, "right_speed": 0.6}
    if not inputs["right_clear"]:
        return {"mode": "turn_left", "left_speed": 0.6, "right_speed": 0.35}
    return {"mode": "forward", "left_speed": 0.6, "right_speed": 0.6}

def drive_outputs(command):
    # Replace with motor-driver or servo calls.
    pass

def stop_outputs():
    # Make the robot safe before exiting.
    pass

def main():
    try:
        while True:
            inputs = read_inputs()
            command = decide_motion(inputs)
            drive_outputs(command)
            print({"inputs": inputs, "command": command})
            time.sleep(DRIVE_DELAY_SECONDS)
    except KeyboardInterrupt:
        stop_outputs()

if __name__ == "__main__":
    main()
How the code works Inputs tell the controller what is happening around the robot.
How the code works The decision section decides whether to move, stop, or turn.
How the code works The driver or servo section performs the physical action.
Motor driver pin labels and enable-jumper behavior can vary, so always compare the code with the actual L298N or driver board on your table.

First-test checklist

Run this checklist before you move from bench testing into the full project logic.

Before upload Test each sensor on the bench first.
Before upload Verify motor direction before placing the robot on the floor.
Before upload Tune movement values on the real surface you plan to use.

Quick first-test sketch

Use this smaller code block only when you want to bench-test one sensor or output before moving to the full project code above. Once the wiring is confirmed, return to the main full code.

main.py · Python
import time

def read_inputs():
    return {
        "front_clear": True,
        "left_clear": True,
        "right_clear": True,
    }

while True:
    print(read_inputs())
    time.sleep(0.1)

Common questions

The things people usually ask before ordering this kit.

Straight answers
Do I need to know how to write code?
Some coding is involved, but you do not have to write it. The complete, tested Python code for this project is published on this page — copy it, upload it to the board, and it runs. You only need to edit it if you want to change how the project behaves.
How hard is it, and how long does it take?
Intermediate — you should be comfortable following a wiring diagram and connecting jumper wires. It is not a first-ever project, but no advanced skills are needed. Typical build time: Per project: 60-90 minutes.
What exactly arrives in the box?
The 9 required parts listed under “Included in this kit” below, shipped loose so you assemble them yourself. Optional add-ons are only included if you tick them before adding to cart. Every part is a real product from our catalogue — you can click each one to see it.
Can you build it for me instead?
Yes. This kit is also sold ready-built — we wire it, upload the code and bench-test it before it ships, so it arrives working. See the buying options at the top of this page.
What if I get stuck during the build?
Ask for a custom version if you need different boards, sensors, quantities, or classroom packs. Use support if you want help choosing between similar kits before ordering. This kit includes a coding path, so support can help you confirm pins, libraries, and first-test workflow.
Can I change the design or swap a part?
Yes. Every part is sold separately, so you can order the kit and substitute components later. If you want a different version built from the start — a bigger battery, a different display, an extra sensor — use the request button and we will quote it.

What each component does

Plain-language explanations of each part’s role and why it’s included in this build.

ESP32U Development Board, WiFi Bluetooth IoT NodeMCU-32 Module, DevKitC with TYPE-C Interface, Development Kit for Electronics Projects

Included · Qty 1

ESP32U Development Board, WiFi Bluetooth IoT NodeMCU-32 Module, DevKitC with TYPE-C Interface, Development Kit for Electronics Projects is the main board that runs the code and coordinates the rest of the kit.

GY-521 MPU-6050 6DOF IMU Sensor Module – 3-Axis Gyroscope + 3-Axis Accelerometer, I2C

Included · Qty 1

GY-521 MPU-6050 6DOF IMU Sensor Module – 3-Axis Gyroscope + 3-Axis Accelerometer, I2C gives the kit real-world readings it can react to.

0.96" OLED Display Module 128x64 I2C (White)

Included · Qty 1

0.96" OLED Display Module 128x64 I2C (White) shows live status, menu text, or measured values directly on the build.

Active Buzzer Module 5V DC, Plug-and-Play Beeper Sounder Board for Arduino, Simple ON/OFF Alarm Output, 2-Pack Electronic Buzzer for DIY Projects, Sensors, Robotics & Alerts

Included · Qty 1

Active Buzzer Module 5V DC, Plug-and-Play Beeper Sounder Board for Arduino, Simple ON/OFF Alarm Output, 2-Pack Electronic Buzzer for DIY Projects, Sensors, Robotics & Alerts gives the kit real-world readings it can react to.

Tactile Microswitch Kit 25pcs 12x12x7.3mm Momentary Push Button Switches with Assorted Coloured Caps, Through-Hole 4-Pin PCB Tact Switch Set with Storage Box for DIY Electronics

Included · Qty 1

Tactile Microswitch Kit 25pcs 12x12x7.3mm Momentary Push Button Switches with Assorted Coloured Caps, Through-Hole 4-Pin PCB Tact Switch Set with Storage Box for DIY Electronics gives the user a direct manual input for control, settings, or interaction.

18650 Battery Holder Case, Single Cell 3.7V Li-ion Battery Slot, Black Plastic Housing with Pre-Soldered Red/Black Lead Wires, DIY Power Supply Holder for Arduino ESP32 Projects

Included · Qty 1

18650 Battery Holder Case, Single Cell 3.7V Li-ion Battery Slot, Black Plastic Housing with Pre-Soldered Red/Black Lead Wires, DIY Power Supply Holder for Arduino ESP32 Projects provides the main power path for the kit or one of its higher-draw parts.

TP4056 Micro USB 5V 1A Li-ion Battery Charger Module with Protection for 1S 3.7V 18650 Cells, Overcharge/Overdischarge/Short-Circuit Safety, DIY Power Bank Charging Board

Included · Qty 1

TP4056 Micro USB 5V 1A Li-ion Battery Charger Module with Protection for 1S 3.7V 18650 Cells, Overcharge/Overdischarge/Short-Circuit Safety, DIY Power Bank Charging Board provides the main power path for the kit or one of its higher-draw parts.

Male to Male Jumper Wires 40pcs 10cm Breadboard Dupont Cables Ribbon Connector Leads for Arduino Raspberry Pi Prototyping, Multicolor 2.54mm Pin Headers DIY Kit

Included · Qty 1

Male to Male Jumper Wires 40pcs 10cm Breadboard Dupont Cables Ribbon Connector Leads for Arduino Raspberry Pi Prototyping, Multicolor 2.54mm Pin Headers DIY Kit gives you a fast no-solder area to assemble and test the main circuit.

BREADBOARD 830 TIE POINT

Included · Qty 1

BREADBOARD 830 TIE POINT gives you a fast no-solder area to assemble and test the main circuit.

Transparent ABS Plastic Case Shell Box for Arduino UNO R3

Optional · Qty 1

Transparent ABS Plastic Case Shell Box for Arduino UNO R3 is the main board that runs the code and coordinates the rest of the kit.