Smart Letterbox

by antje eechaute in Circuits > Raspberry Pi

381 Views, 2 Favorites, 0 Comments

Smart Letterbox

header_xs_kopie.jpg

Hello everyone, I'm a student at Howest in Kortrijk. I am studying Multimedia and creative technologies, I'm in my first year. At the end of the schoolyear we had to show what we've already learned. For the assignment we needed to make a project with minimum 3 sensors and 1 actuator. I thought about it for a while and then i came up with an idea. During corona my family ordered a lot online. So I thought can I make a smart letterbox so that our packages are safe when we aren't home?

To make sure my packages are safe i have three sensors on my letterbox.

  • An accelerometer to know when the top was opened.
  • A PIR sensor to know when someone was near the letterbox.
  • A load cell to know when the package arrived.

On the website you can see when the top was opened or when there was movement. And of course when your package was delivered.

To get your package out of the letterbox, you have to open the side door. It is closed with an electromagnetic lock. you can open or close the door on the website.

The box also has a little lcd display via this way you can say something to your mailman. you can change the message on the website.

Supplies

the cost was around €210

  • Raspberry pi 4 model B
  • Raspberry pi T-cobbler
  • 4 Weight sensors (SEN-10245)
  • Load cell amplifier
  • PIR sensor
  • Accelerometer
  • 16*2 LCD
  • Electromagnetic lock
  • Power supply (3.3V, 5V, 12V)
  • Microswitch
  • Tip 120 transistor
  • Mounting wire
  • Male to male jumperwires
  • Female to male jumperwires
  • Female to female jumperwires
  • Tin to solder
  • MDF board
  • corner connecters
  • Hinges
  • Paint

Fritzing Schema

breadboard_schema.png
elektronica_schema.png

As you can see I needed a lot of wires to connect everything to my raspberry pi. I also needed longer wires to connect the accelerometer because it has to cross a longer distance. I cut a female to male cable in two, after that I soldered a longer piece of mounting wire between the two pieces of the cable.

pir sensor

My pir sensor could work on 3.3v but the values weren't always right so I changed it to 5v. the values were better now. You need to put two resistors so the 5v doesn't go directly to your pi as you can see on the picture.

lock

To make sure my electromagnetic lock woudn't kill my raspberry pi I linked it with a transistor and a diode over the lock.

Building My Circuit

190514298_850068555889380_4432453517185927635_n.jpg
IMG_7415[459].jpg
IMG_7417[463].jpg
IMG_7420[469].jpg
image2[482].jpeg
image0[481].jpeg

first I made my circuit outside my case to see if everything worked and to test my code, then I made it again on the inside.

Load cell

I used 4 SEN-10245 load cells, you have to place them in the right angle as you can see on the picture. Make sure there's space under the middle part of the load cell. I attached a wooden slab on the 4 load cells with some tape.

You can see the circuit of the load cells on the fritzing scheme.

Writing My Code

You can download the code on my github. Change it to your preferences.

Github: https://github.com/EechauteAntje/SmartLetterbox

Load cell

For my load cell I used some code that i found on the internet. You can find it in this article. They explain how the code works and how to install the load cell.

Accelero meter

There's a file with a class for the accelerometer you can find this in the map 'helpers'.

PIR sensor

The PIR sensor was really easy to program you just have to read the input. You can change the sensitivity and the time delay on the two yellow turn knobs.

LCD

You can also find a file with a class for the lcd display in the map 'helpers'.

Database

Schermafbeelding 2021-06-11 112805.png

This is my database model.

I made my database with mariadb.

  • History: to save all the data of the sensors and actuator.
  • Device: to know which deviceID is which device.
  • Action: to know what action happened with the device.

Making My Case

192100435_226421398996758_5566594526148346225_n.jpg
192092448_331774618564245_904638952472117629_n.jpg
189312058_1222827308136485_5454676202392966114_n.jpg
190825457_521188055734088_8096487890775564640_n.jpg
193968433_1145601535907228_6317598195367014095_n.jpg

You can see an explanation of the housing in the pdf file.

I would recommend to make it a little bit higher because that way bigger packages can fit in.

Downloads

My Site

image0[453].png
image1[454].png
image2[455].png

I created my site for mobile devices. I didn't have to make a lot of changes for bigger devices so that was very easy.