Arduino Nano ESP32 - Secure Your Belongings: Detect Theft and Send Email Alerts
In this guide, we will teach you how to keep your items safe using an Arduino Nano ESP32 and a force sensor. We will cover the steps to set up a system that sends you an email if someone tries to move your belongings. You will learn how to prepare the Arduino Nano ESP32, connect the force node, and set it up to email you through Gmail. We will provide detailed instructions and show you how this system can be useful.
Hardware Preparation
1 | × | Arduino Nano ESP32 | |
1 | × | USB Cable Type-C | |
1 | × | Force Sensor | |
1 | × | 10 kΩ resistor | |
1 | × | Breadboard | |
1 | × | Jumper Wires | |
1 | × | (Optional) DC Power Jack | |
1 | × | (Recommended) Screw Terminal Expansion Board for Arduino Nano |
Or you can buy the following sensor kits:
1 | × | DIYables Sensor Kit (30 sensors/displays) | |
1 | × | DIYables Sensor Kit (18 sensors/displays) |
Overview of Force Sensor and Gmail
We provide detailed guides on Force Sensors and Gmail. Each tutorial gives you step-by-step instructions on setting up the hardware, understanding how it functions, and connecting wires to Arduino Nano ESP32, including how to code for Arduino Nano ESP32. For more details, please visit these links:
- Arduino Nano ESP32 - Force Sensor tutorial
- Arduino Nano ESP32 - Gmail tutorial
How the theft detection system work
The force sensor measures the weight of an item placed on it. When you put your item on the sensor, the Arduino Nano ESP32 records the weight. If the item is taken away, the weight will change. The Arduino Nano ESP32 detects this change and sends you an email to inform you that your item has been moved.
Wiring Diagram between Force Sensor and Arduino Nano ESP32
This image is created using Fritzing. Click to enlarge image
Arduino Nano ESP32 Code
Detailed Instructions
To get started with Arduino Nano ESP32, follow these steps:
- If you are new to Arduino Nano ESP32, refer to the tutorial on how to set up the environment for Arduino Nano ESP32 in the Arduino IDE.
- Connect the Arduino Nano ESP32 board to the force sensor according to the provided diagram.
- Connect the Arduino Nano ESP32 board to your computer using a USB cable.
- Open the Arduino IDE on your computer.
- Select the Arduino Nano ESP32 board and its corresponding COM port.
- Place your items on the force sensor.
- Open the Library Manager by clicking Library Manager icon on the left side of the Arduino IDE.
- Search for ESP Mail Client and choose the library by Mobizt.
- Click the Install button to add the ESP Mail Client library.
- Copy the code and open it using the Arduino IDE.
- Enter your WiFi details (name and password) in the code by changing WIFI_SSID and WIFI_PASSWORD.
- Enter the email and password of the person sending the email in the code by changing SENDER_EMAIL and SENDER_PASSWORD.
- Enter the email address of the person receiving the email in the code by changing RECIPIENT_EMAIL. This email can be the same as the sender's email.
※ NOTE THAT:
- The sender's email address needs to be a Gmail account.
- Use the App password you got earlier as the sender's password.
- Any email provider can be used for the recipient's email address.
- Press the Upload button in the Arduino IDE to transfer code to the Arduino Nano ESP32.
- Open the Serial Monitor.
- Take items off the force sensor.
- Check the results on the Serial Monitor.
- Check the email inbox of the person you're sending to. They will get an email similar to this: