Alarm That Sends E-mail Notification Over Wi-Fi
by rowemg in Circuits > Arduino
91 Views, 1 Favorites, 0 Comments
Alarm That Sends E-mail Notification Over Wi-Fi
Pressing the button causes LED lights to flash in a rainbow pattern and sends emails notifying recipients that the button was pressed.
Supplies
- 32”x20” ⅛” pink acrylic
- Super glue
- 2 male to male wires
- 2 female to female wires
- Raspberry Pi Pico W
- Pico W breadboard
- 30 light LED strip with power, ground, signal wires
- 12mm square tactile button
- Slim external battery
- USB A to microUSB
Steps
- Physical
- 3d print button (PLA)
- File: phys_comp_wifi_alarm/bathroom alarm button.stl at main · WebsiteDisplayName/phys_comp_wifi_alarm (github.com)
- It will be necessary to add structure/supports
- Prusa Mini
- Signal should be GP15
- Laser cut box (⅛” pink acrylic)
- File: phys_comp_wifi_alarm/finalHingeBox.svg at main · WebsiteDisplayName/phys_comp_wifi_alarm (github.com)
- Trotec laser cutter
- Super glue box together
- Wire strip 30 light LED (3x wires)
- Signal should be GP14
- Super glue LED strip to top of box
- Place tactile button into hole of acrylic box and super glue into place
- For 2 adjacent legs of tactile button (not on opposite ends):
- Connect to leg with female wire
- Attach other end of female wire with male to male wire
- Attach other end of male to male wire to breadboard
- Have 1 of the wires go to GP14
- Electronic
- Setting up Pico W and settings.toml
- Overview | Quick-Start the Pico W WiFi with CircuitPython | Adafruit Learning System
- Will need to set WIFI_SSID and WIFI_PASSWORD to name and password of your network
- API provider
- Mailjet: Email Delivery Service for Marketing & Developer Teams | Mailjet
- 6000 emails/month, 200 emails/day
- Create an account
- Record Public and Private Keys
- Use key_conv.py to generate combined key to put into header of main program to authenticate
- Paste result into “COMB_KEY” key value in settings.toml
- Curl converter to change message body, recipient, etc
- Go here Send API V3 (mailjet.com)
- Copy the relevant Curl text
- Paste into Convert curl commands to code (curlconverter.com)
- Copy paste output into program and adjust as necessary
- NOTE: only necessary if making custom API request, not needed if copy pasting given code
- Requests Authentication
- File: phys_comp_wifi_alarm/key_conv.py at main · WebsiteDisplayName/phys_comp_wifi_alarm (github.com)
- Replace Public and Private key variable values with those found at Mailjet
- Run the program and copy paste the printed output into COMB_KEY variable in settings.toml
- Main program
- File: phys_comp_wifi_alarm/wifi_alarm.py at main · WebsiteDisplayName/phys_comp_wifi_alarm (github.com)
- Libraries: phys_comp_wifi_alarm/lib at main · WebsiteDisplayName/phys_comp_wifi_alarm (github.com)
- Replace timezone with your respective timezone
- Replace the “From” email in the post_request function with your intended sender email (as set in Mailjet)
- The recipient emails should be typed 1 email per line in the “target_emails.txt” file
- Usage
- Connect the Pico W to an external power source and press the button for the LED strip to light up and to send email(s)