GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsThe motion sensor on the housing reads the vibration. Above 1.5 g the buzzer sounds and an SMS goes to your phone, a hint to stop the machine and check the bolts and belts.
Fix the sensor while the machine is stopped, and keep wires clear of moving parts.
Put your own number in PHONE before uploading. The project needs a SIM with SMS credit on a network that still offers 2G where you live.
Tick anything you already have and the total updates.
Connects the Uno to your computer to upload code and power it
Six-axis motion sensor: a three-axis accelerometer that feels gravity and bumps, and a three-axis gyro that measures how fast it turns.
A small 2G phone module: with a SIM card it sends and receives SMS, so the project can alert you or take commands from anywhere with mobile coverage.
Active buzzer with a built-in oscillator: apply power and it beeps at about 2.3 kHz.
1 kΩ + 2 kΩ divider on the RXD line from a 5 V board; 1 kΩ + 2 kΩ divider for the 3.3 V input
Raises the cell's 3.0–4.2 V to a steady 5 V for the board
Follow the colours: red is power, dark grey is ground, blue is a signal.
The SIM800L runs straight from the 18650 cell (VCC and GND), never from the board's 5 V pin. Join the cell − to the board GND. A capacitor of 470–1000 µF across the module's VCC and GND stops resets. Set the boost converter to 5.0 V with a multimeter before connecting the board. Cell + → boost IN+, cell − (TP4056 OUT−) → boost IN−, then boost OUT+ → board 5V pin and OUT− → GND. A bare 18650 (3.0–4.2 V) cannot run a 5 V board by itself.
sms_machine_vibration_alert.inoVerify & upload in Electrolark// Machine vibration SMS alert
// Geekobot project library · board: Arduino Uno
// Wiring diagram, parts list and build steps: Geekobot project page "sms-machine-vibration-alert"
#include <Wire.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <SoftwareSerial.h>
// ---- pins ----
const uint8_t GSM_RX = 2;
const uint8_t GSM_TX = 3;
const uint8_t BUZZER_PIN = 4;
Adafruit_MPU6050 mpu;
sensors_event_t accEvt, gyrEvt, tmpEvt;
// ---- latest readings ----
float pitchDeg = 0;
float rollDeg = 0;
float shakeG = 0;
SoftwareSerial gsm(GSM_RX, GSM_TX);
const char PHONE[] = "+91XXXXXXXXXX"; // your mobile number, with the country code
const unsigned long MIN_GAP_MS = 30 * 60000UL; // never more than one SMS in this time
bool alarm = false;
unsigned long lastSms = 0, lastRead = 0;
bool sentOnce = false;
void readImu() { mpu.getEvent(&accEvt, &gyrEvt, &tmpEvt); }
float pitchDegNow() { return atan2(accEvt.acceleration.x, sqrt(accEvt.acceleration.y * accEvt.acceleration.y + accEvt.acceleration.z * accEvt.acceleration.z)) * 57.3f; }
float rollDegNow() { return atan2(accEvt.acceleration.y, accEvt.acceleration.z) * 57.3f; }
float shakeGNow() { float a = sqrt(accEvt.acceleration.x * accEvt.acceleration.x + accEvt.acceleration.y * accEvt.acceleration.y + accEvt.acceleration.z * accEvt.acceleration.z) / 9.81f; return fabs(a - 1.0f); }
float gyroZNow() { return gyrEvt.gyro.z * 57.3f; } // turning speed in degrees per second
void setBuzzer(bool on) { digitalWrite(BUZZER_PIN, on ? HIGH : LOW); }
void sendSms(const String& text) {
gsm.println(F("AT+CMGF=1")); delay(300);
gsm.print(F("AT+CMGS=\"")); gsm.print(PHONE); gsm.println('"'); delay(500);
gsm.print(text); gsm.write(26); // Ctrl+Z sends the message
delay(4000);
while (gsm.available()) Serial.write(gsm.read());
Serial.print(F("SMS sent: ")); Serial.println(text);
}
void setup() {
Serial.begin(115200);
if (!mpu.begin()) Serial.println(F("MPU6050 not found"));
mpu.setAccelerometerRange(MPU6050_RANGE_4_G);
mpu.setGyroRange(MPU6050_RANGE_500_DEG);
mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
pinMode(BUZZER_PIN, OUTPUT);
setBuzzer(false);
gsm.begin(9600);
delay(3000); // give the module time to find the network
gsm.println(F("AT+CMGF=1")); delay(300); // SMS in text mode
gsm.println(F("AT+CNMI=2,2,0,0,0")); delay(300); // print new SMS straight to the serial line
}
void loop() {
while (gsm.available()) Serial.write(gsm.read()); // show the module's replies
if (millis() - lastRead < 1000) return;
lastRead = millis();
shakeG = shakeGNow();
if (!alarm && (shakeG > 1.5)) {
alarm = true;
if (!sentOnce || millis() - lastSms > MIN_GAP_MS) { sendSms(String("Machine vibrating hard (") + String(shakeG) + ")"); lastSms = millis(); sentOnce = true; }
} else if (alarm && (shakeG < 1.0)) {
alarm = false; Serial.println(F("Back to normal"));
}
setBuzzer(alarm);
}
The sketch above runs here on a simulated Arduino Uno. Move the sliders for the sensors and buttons it reads, and watch the Serial monitor, display and outputs change.
Check SDA and SCL are not swapped. An I²C scanner should show 0x68 (0x69 if AD0 is tied high).
Keep I²C wires short, add a 100 nF capacitor across VCC and GND, and mount the board away from motor wires.
The supply sags during transmit bursts. Use a good 18650 cell, short thick wires and a large capacitor.
Once every 3 seconds means registered. If it never registers, the SIM's network may have switched 2G off in your area.
Low-triggered module: invert the logic in setBuzzer().
Open the Serial Monitor at 115200 baud and check for messages. Make sure you chose the right board and port in the Arduino IDE.
Close other programs using the serial port, try another USB cable (some are charge-only) and press reset just before uploading.
Yes. Most of the code works unchanged on an ESP32 with the ESP32 board package. Watch for 5 V modules: ESP32 pins are 3.3 V, so 5 V output signals need a resistor divider.
Use a 5 V USB phone charger or a power bank into the board's USB port.
11 parts: Uno R3 CH340G ATmega328p Compatible Development Board, Arduino USB-A to USB-B Data Cable for UNO/MEGA, GY-521 MPU6050 6-Axis Gyro and Accelerometer Module, SIM800L GPRS GSM Module Core Board with Antenna, Active Buzzer Module 3.3–5V, Resistor Assortment Kit (30 Values), 18650 Battery Holder, 18650 Li-ion Rechargeable Cell 2600mAh, MT3608 Mini Boost Converter Module, Solderless Breadboard (830 points), plus 1 more. Tools: Digital Multimeter and Wire Stripper and Cutter. 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 9 steps.
No. This page has the complete, tested code (sms_machine_vibration_alert.ino). Install these libraries first: Adafruit MPU6050 and Adafruit Unified Sensor.
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 ₹1,133 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.
AT commands and SMS; Accelerometers, gyros and tilt angles; Active vs passive buzzers.
Fix the sensor while the machine is stopped, and keep wires clear of moving parts. Put your own number in PHONE before uploading. The project needs a SIM with SMS credit on a network that still offers 2G where you live.
Ideas that reuse this build: Workshop machine vibration health alarm and Wi-Fi machine vibration monitor. 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.