Turn that light off!

Get a message if you left the light on in an empty room. If you turn the light off within a minute, you get a point!

#mz-moreeengagement

Turn that light off!

Repository for the "Turn that light off!" project of Make Zurich 2023.

The idea

  • Place light and motion sensors in a room.
    • Currently only the light sensor has been implemented.
  • If the light sensor detects that the light is on but the motion sensor detects that nobody is in the room, then either a message is shown on a display ("Turn the light off!") or another visual message could be shown to the user, such as a red LED turning on.
  • The user then hae one minute of time to turn that light off.
  • If the user turns it off within the agreed time window (default to one minute), then they get a point in a yet to be defined leader board.
  • Once the user get ten points, then they can buy themselves an ice cream!

Tools

Tasks

  • [x] Set up "blue" Raspberry Pi Pico W with light sensor.
  • [x] Set up "blue" Raspberry Pi Pico W to send uplink data to the TTN.
  • [ ] Set up "blue" Raspberry Pi Pico W to show the intensity of the light sensor using the onboard Neopixels.
  • [x] Set up "purple" Raspberry Pi Pico W with light LCD display.
  • [x] Set up "purple" Raspberry Pi Pico W to connect to WiFi.
  • [x] Set up "purple" Raspberry Pi Pico W to subscribe to the mz23 topic from the Adafruit IO MQTT broker.
  • [x] Install Datasette
  • [x] Visualize mqtt.db SQLite database with Datasette
  • [x] Develop subscribe_to_ttn.py Python script to subscribed to the MQTT TTN integration.
  • [x] Develop subscribe_to_ttn.py Python script to store the received data to a local SQLite database.
  • [x] Develop publish_to_aio.py Python script to read data from a local SQLite database.
  • [x] Develop publish_to_aio.py Python script to publish data to the Adafruit IO MQTT broker.
  • [ ] Dockerize the two Python scripts above.

Instructions

Datasette

Install Datasette in your Python environment:

pip install datasette

Run Datasette against a SQLite file on your computer using the following command:

datasette mqtt.db

Then open your browser at http://127.0.0.1:8001.

This content is a preview from an external site.
 

Event finished

10.06.2023 16:00

Edited content version 32

10.06.2023 14:03 ~ filippo82

Edited content version 29

10.06.2023 13:36 ~ filippo82

Edited content version 27

10.06.2023 13:35 ~ filippo82

Fix typos and add links

Find

10.06.2023 13:01

Edited content version 24

10.06.2023 13:01 ~ filippo82

Find

10.06.2023 13:00

Edited content version 21

10.06.2023 13:00 ~ filippo82

Edited content version 19

10.06.2023 13:00 ~ filippo82

Add directories

Update README

Find

10.06.2023 09:33

Edited content version 17

10.06.2023 09:33 ~ filippo82

Find

09.06.2023 17:02

Joined the team

09.06.2023 17:02 ~ KurtMarti

Edited content version 13

09.06.2023 10:18 ~ filippo82

Update README.md

Add reward idea

Find

09.06.2023 10:15

Edited content version 10

09.06.2023 10:15 ~ filippo82

Repository updated

09.06.2023 10:13 ~ filippo82

Edited content version 6

09.06.2023 10:13 ~ filippo82

Edited content version 4

09.06.2023 10:12 ~ filippo82

Update README.md

Add initial bits to the README.

Initial commit

Find

09.06.2023 08:56

Joined the team

09.06.2023 08:56 ~ filippo82

Challenge posted

09.06.2023 08:56 ~ filippo82

Event started

02.06.2023 09:00
 
Contributed 4 months ago by filippo82 for Make Zurich 2023

Creative Commons CC-BY logo The contents of this website, unless otherwise stated, are shared
under a Creative Commons Attribution 4.0 License.

Everyone at the event is required to agree with our Code of Conduct:

Be excellent to each other!

Make Zurich 2023