GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsShops, farm sheds and godowns often have no Wi-Fi but do have mobile coverage. A 4G LTE modem with a SIM card lets an ESP32 send SMS alerts. A reed switch on the door triggers the message, with a short delay to avoid repeats.
Test that alerts arrive before relying on the alarm.
Tick anything you already have and the total updates.
4G LTE modem board with antenna; takes a nano SIM
Door contact: closed when the magnet is near
Follow the colours: red is power, dark grey is ground, blue is a signal.
The modem draws short peaks of 1 to 2 A when transmitting: use a 5 V 2 A supply, not the ESP32's 5 V pin.
sms_door_alarm.inoVerify & upload in Electrolarkconst char* PHONE = "+91XXXXXXXXXX"; // your mobile number
const int REED = 4;
HardwareSerial modem(2);
unsigned long lastSms = 0;
bool wasOpen = false;
String at(const char* cmd, int wait = 1000) {
modem.println(cmd);
unsigned long t = millis(); String r;
while (millis() - t < wait) while (modem.available()) r += (char) modem.read();
Serial.print(cmd); Serial.print(" -> "); Serial.println(r);
return r;
}
void sms(const char* text) {
at("AT+CMGF=1"); // text mode
modem.print("AT+CMGS=\""); modem.print(PHONE); modem.println("\"");
delay(500);
modem.print(text);
modem.write(26); // Ctrl+Z sends the message
delay(5000);
}
void setup() {
Serial.begin(115200);
modem.begin(115200, SERIAL_8N1, 16, 17);
pinMode(REED, INPUT_PULLUP);
delay(8000); // let the modem register on the network
at("AT"); at("AT+CSQ"); at("AT+CREG?");
}
void loop() {
bool open = digitalRead(REED) == HIGH;
if (open && !wasOpen && millis() - lastSms > 60000UL) {
sms("Door opened");
lastSms = millis();
}
wasOpen = open;
delay(50);
}
The sketch above runs here on a simulated ESP32. Move the sliders for the sensors and buttons it reads, and watch the Serial monitor, display and outputs change.
Swap TX and RX, check the baud rate (some modems start at 115200, others auto-baud) and the shared ground.
Check the SIM has credit and the number includes the country code.
The supply cannot give the current peaks; use a stronger 5 V supply and short, thick wires.
Yes, ATD+91XXXXXXXXXX; dials the number.
No, SMS works without a data pack.
Yes, any ESP32 input, such as a PIR or a water sensor.
6 parts: ESP32-WROOM-32 38-Pin Development Board, SIM A7670C 4G LTE Development Board w/ Flex Antenna, MC-38 Wired Door Window Magnetic Sensor Alarm Switch – Normally Closed, 30cm Cable, IPEX1 to SMA Female Connector Cable 30cm RG1.13, Solderless Breadboard and Dupont Jumper Wires (40 pcs). 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 (sms_door_alarm.ino).
Yes. The Run it panel under the code runs this exact sketch on a simulated board. Move the sliders or press the buttons for the sensors it reads, and the Serial monitor, display and outputs react as they will on the real build. It is a simulation, so real readings depend on your parts and wiring.
About ₹2,417 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
AT commands for SMS; Powering a cellular modem (current peaks); Debouncing and rate-limiting alerts.
Test that alerts arrive before relying on the alarm.
Ideas that reuse this build: Off-grid LoRa messenger. They are listed under Take it further on this page.
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.
Learning project. Check every circuit and the datasheet of each part before you power it up.
A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.