Bluetooth Mailbox Notification (Week 7)

  1. Goal: To create a wireless notification device. The mailbox in my apartment building is on the first floor. However, I live on the fourth floor. It takes extra effort to go downstairs to check the mailbox only to discover that nothing has arrived. So, this project is an Arduino Bluetooth-enabled device that sends a notification to my desktop and my cell phone that the mailbox has been opened, thus alerting me to the presence of mail. 
  2. Assembly: Jumper wires, Arduino Nano, Bluetooth module (HC-06), 1K,2K, and 330 resistors, LED, PIR sensor, 9V battery. Programming: Arduino IDE, and Python3.
  3. How it works: The Arduino Nano is connected to the HC-06 through the RX-TX and TX-RX pins. I used a voltage divider because the Arduino operates with 5V, but the RX pin on the HC-06 can only accept 3.3V. Then, I connected the PIR sensor. One side to GND, the other to PWR, and connected it to pin 2. Finally, I connected the LED to in 7 to test. As for the code, it is fairly simple. The PIR is a digital connection, so it only reads HIGH and LOW. If the PIR is HIGH it turns the LED ON and prints 1 to the serial monitor, if the PIR is LOW then it turns the LED OFF and prints 0 to the serial monitor. If only runs these statements if the PIR has first detected movement. Lastly, in order for my serial port to communicate with my desktop and cellphone, I used a push notification API with my computer’s Wifi connection. To do this I wrote a Python3 script. The script waits for the HC-06 to print to the serial monitor, once it does it sends a push message through the API to my Pushover service account, which sends out a push notification to any device in my network (in this case, my phone and desktop).
  4. Problems: Because I don’t have a Wifi shield, I am limited to using the Bluetooth which can only be connected via a short-range Bluetooth-enabled device. So, unfortunately, I must be connected to my computer or cell phone when I am close by. In order to use this device when I am away from home, it would be better to have a microcontroller with wifi capabilities and have that connect directly to the API.

LINK TO CODE

Leave a Reply

Your email address will not be published. Required fields are marked *