Parcel left at the door alert
Build it step by step
0 of 7 doneBuild the two-plate mat
Load cell between them.
Wire the HX711
Check raw readings change.
Calibrate with a known weight
Work out CAL_FACTOR.
Set the thresholds
200 g and 100 g.
Add Wi-Fi and the alert
With your own address.
Test with a bag
Place and remove it.
Weatherproof it
Before the doorstep.
How do you build a parcel left at the door alert?
A load cell mat at the doorstep notices a parcel being left (or taken) and sends a phone alert. You need ESP32 DevKit V1, Load cell 5 kg (bar type), HX711 load cell amplifier and 5 V 2 A USB adapter. It takes 7 steps and about 120 minutes.
- Level
- Intermediate
- Time
- About 120 min
- Parts
- 4
Parts list
- Development BoardsBuyESP32 DevKit V1 × 1
- SensorsBuy
- SensorsBuy
- PowerBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Load cell red and black | HX711 E+ and E- | Bridge excitation |
| Load cell white and green | HX711 A- and A+ | Bridge signal (swap if weight reads negative) |
| HX711 DT and SCK | ESP32 GPIO16 and GPIO4 | Digital readout |
| HX711 VCC and GND | ESP32 3V3 and GND | Power |
| ESP32 | 5 V adapter on USB | Power |
Code
A load cell is a strain gauge in a bar, and the HX711 turns its tiny signal into a number you can read. Mount the bar between a base plate and a top plate so the weight bends the bar. To calibrate, tare with the mat empty, put on a known weight such as a 1 kg bag, read the raw value with scale.get_value(), and divide by the weight in grams to get CAL_FACTOR. The sketch tells a parcel from a footstep by requiring the extra weight to stay for ten seconds, and it follows slow drift from temperature while the mat is empty. The alert goes to a push-notification address you create yourself; keep that address private, as it is the key to your alerts, and note that setInsecure() skips the certificate check, which is a trade-off acceptable for a harmless alert. Weatherproof the load cell and the electronics, because a doorstep sees rain, and keep mains adapters under cover. Only watch your own doorstep and tell people if the mat records visitors. Arduino IDE with the ESP32 boards package 2.0.x, board "ESP32 Dev Module".
Runs on a virtual ESP32 Dev Module in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// Parcel mat alert: notices a weight left on the mat and sends a push message; another when it is taken.
// Libraries: HX711 (bogde). Board: ESP32. Calibrate CAL_FACTOR with a known weight first (see the notes).
#include <WiFi.h>
#include <WiFiClientSecure.h>
#include <HTTPClient.h>
#include <HX711.h>
const char* WIFI_NAME = "YOUR_WIFI_NAME";
const char* WIFI_PASSWORD = "YOUR_WIFI_PASSWORD";
const char* WEBHOOK_URL = "https://YOUR_NOTIFICATION_URL"; // for example a push service topic you created
const float CAL_FACTOR = 420.0; // counts per gram: replace with your own value
const float ARRIVE_G = 200.0, REMOVE_G = 100.0;
HX711 scale;
float baseline = 0;
bool holding = false;
unsigned long overSince = 0;
void notify(const char* msg) {
WiFiClientSecure client;
client.setInsecure(); // no certificate check: fine for a harmless alert, a trade-off
HTTPClient http;
if (http.begin(client, WEBHOOK_URL)) { http.addHeader("Content-Type", "text/plain"); http.POST(msg); http.end(); }
}
void setup() {
Serial.begin(115200);
scale.begin(16, 4);
scale.set_scale(CAL_FACTOR);
scale.tare();
WiFi.begin(WIFI_NAME, WIFI_PASSWORD);
while (WiFi.status() != WL_CONNECTED) delay(500);
}
void loop() {
float w = scale.get_units(5) - baseline;
if (!holding) {
if (w > ARRIVE_G) { // must stay heavy for 10 s, so a passing foot is ignored
if (overSince == 0) overSince = millis();
if (millis() - overSince > 10000) { holding = true; notify("A parcel was left at the door"); }
} else {
overSince = 0;
if (fabs(w) < 50) baseline += w * 0.01; // slowly follows drift when the mat is empty
}
} else if (w < REMOVE_G) {
holding = false; overSince = 0;
notify("The parcel at the door was taken");
}
delay(500);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Place 500 g on the mat | Alert after about 10 seconds |
| Step on and off quickly | No alert |
| Remove the weight | Second alert |
| Empty mat for hours | Reading stays near zero |
If it does not work
Weight reads negative
Swap the A+ and A- wires.
Reading drifts
Keep the cell out of sun and let it warm up.
No alert
Check the Wi-Fi and the notification address.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the parcel left at the door alert?
ESP32 DevKit V1, Load cell 5 kg (bar type), HX711 load cell amplifier and 5 V 2 A USB adapter.
How long does the parcel left at the door alert take to build?
About 120 minutes for a intermediate maker, in 7 steps.
How do I know the parcel left at the door alert works?
Place 500 g on the mat: Alert after about 10 seconds. Step on and off quickly: No alert. Remove the weight: Second alert.
Weight reads negative: what should I check?
Swap the A+ and A- wires.
Reading drifts: what should I check?
Keep the cell out of sun and let it warm up.
No alert: what should I check?
Check the Wi-Fi and the notification address.
