GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsThe ESP-M3 module is built on the ESP8285, an ESP8266 with 1 MB of flash inside the chip, so the module is tiny. It still needs a 3.3 V supply and the same boot pins as an ESP8266. A reed switch on the door frame closes when the magnet on the door is near. The sketch counts openings and serves a status page on your network.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
5 V USB supply into the AMS1117.
door_sensor.inoVerify & upload in Electrolark#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
const char* SSID = "your-wifi";
const char* PASS = "your-password";
const int REED = 4;
ESP8266WebServer web(80);
int opens = 0; bool wasOpen = false; unsigned long lastChange = 0;
void setup() {
Serial.begin(115200);
pinMode(REED, INPUT_PULLUP);
WiFi.begin(SSID, PASS);
while (WiFi.status() != WL_CONNECTED) delay(300);
Serial.println(WiFi.localIP());
web.on("/", [] {
String s = "<meta name=viewport content='width=device-width'><meta http-equiv=refresh content=5>";
s += wasOpen ? "<h1>Door OPEN</h1>" : "<h1>Door closed</h1>";
s += "<p>Opened " + String(opens) + " times since start</p>";
web.send(200, "text/html", s);
});
web.begin();
}
void loop() {
bool open = digitalRead(REED) == HIGH; // magnet away = switch open = HIGH
if (open != wasOpen && millis() - lastChange > 50) {
lastChange = millis(); wasOpen = open;
if (open) opens++;
}
web.handleClient();
}
The magnet is too far from the reed switch; bring it closer.
Raise the debounce time from 50 ms.
Pick ESP8285 with 1 MB flash, and check GPIO0 and GPIO15.
Yes with deep sleep, waking on the reed switch through the reset pin.
Yes, add a call to a push service or Telegram bot when the door opens.
A reed switch knows the door itself moved; a PIR only sees people.
7 parts: DOIT ESP-M3 Ultra-Small ESP8285 Serial WiFi Module, AMS1117 Fixed Regulator Module, Generic Reed Switch 2×14mm Normally Open Magnetic Sensor (Pack of 10), Moresense USB to TTL UART Tool MS58-2020D13M4, Resistor Assortment Kit (30 Values), Solderless Breadboard and Dupont Jumper Wires (40 pcs). Tools: Solder Wire 60/40 Rosin Core. On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 2 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (door_sensor.ino).
About ₹436 for the parts at the prices on this page, plus tools if you do not have them. Quantity price breaks lower the cost when you build several.
How a reed switch works; Debouncing an input; Using the ESP8285 in the Arduino IDE.
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Records where you went every five seconds, ready to open on a map.
Two boards, two radios: press the button at the gate and it rings indoors.
Check temperature, humidity and pressure from any phone on your Wi-Fi.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.