Smart Mailbox
This is a little project I made for school. It's a mailbox that detects mail and measures the temperature and rain. Everything is saved in a SQL database and can be seen on the local Apache webserver. The door can be controlled from the webserver.
Code for door is can be setup at settings page.
Supplies
- Raspberry Pi (4 model B 2GB used)
- 16GB Micro SD Card (8GB works as well)
- Micro SD Card Adapter
- Breadboard
- RPi T-Cobbler
- LCD Display
- LDR
- Laser Emitter
- PIR Motion Sensor
- One Wire Temperature Sensor
- Raindrop Sensor
- Servo Motor
- MCP3008
-
Potentiometer
-
1k & 4.7k Resistors
Fritzing
First things first, let's create the circuit. Make sure the 5V components(LCD, PIR & Servo) are connected to the 5V and the 3.3V components to the 3.3V
Database
Step 2 is the database. I created a simple database that will save the history.
Raspberry Pi
To get the RPi to work, you'll need to write an image on the SD Card, I use win32diskimager.
The image I used "Raspberry Pi OS with desktop".
Connect to the Pi via SSH or VNC and turn the right interfaces on.
The only interfaces we need are the SPI and One wire. Make sure to turn the others off because we are using their GPIO pins. SSH & VNC can stay turned on.
Coding
All code can be found on my Github repo.
The IDE I used is VS Code.
Housing
Housing is fully made out of wood and put together with silicone and screws. This is just a prototype, I don't recommend using wood if you are gonna use it outside.
Finishing Touch
To finish off the housing you can add some paint and branding, like I did.