Skip to content

Gabouin/SENTINEL-PICO

Repository files navigation

License Project Series Language

SENTINEL PICO

An intelligent desk environment monitor built on the Raspberry Pi Pico and written in MicroPython. Sentinel-Pico uses a proximity sensor to detect whether someone is sitting at the desk, then reads temperature, humidity, and ambient light to display contextual information on a small OLED screen. Try it online on on Wokwi.


Table of Contents


Overview

Sentinel-Pico turns any desk into a smart monitoring station. When no one is detected within 50 cm, the OLED display enters a low-power idle screen. When someone sits down, it immediately reports ambient conditions and alerts the user if the lighting is too dim for comfortable work.k.


Features

  • Presence detection via HC-SR04 ultrasonic sensor
  • Temperature & humiditydity readout from a DHT22 sensor
  • Ambient light monitoring with a photoresistor (LDR)
  • OLED display driven by an SSD1306 over I2C
  • Three distinct display modes based on real-time sensor data
  • Fully simulated on Wokwi, no physical hardware

Hardware / Components

Component Model Pin(s)
Microcontroller Raspberry Pi Pico (MicroPython)
OLED Display SSD1306 128×64 (I2C) GP4 (SDA), GP5 (SCL)
Temperature & Humidity Sensornsor DHT22 GP14
Light Sensor Photoresistor (LDR) GP26 (ADC0)
Ultrasonic Sensor HC-SR04 GP28 (TRIG), GP27 (ECHO)

Wiring / Pinout

SSD1306 OLED  →  SDA: GP4, SCL: GP5, VCC: 3.3 V, GND
DHT22         →  DATA: GP14, VCC: 3.3 V, GND
LDR Sensor    →  OUT: GP26 (ADC0), VCC: 3.3 V, GND
HC-SR04       →  TRIG: GP28, ECHO: GP27, VCC: 5 V (VBUS), GND
ND

Logic Flow

Loop:
 ├── Measure distance (HC-SR04)
 │
 ├── Distance > 50 cm  OR  sensor error
 │    └── OLED: "Nobody Detected / Shutdown"
 │
 └── Distance ≤ 50 cm (someone at desk)
      ├── Read DHT22 (temperature + humidity)
      ├── Read LDR (ambient light level)
      │
      ├── LDR ADC value ≥ 32727  (≤ ~100 lux — too dark)
      │    └── OLED: "Please turn on the light!"
      │
      └── LDR ADC value < 32727  (bright enough)
           └── OLED: "Hi Sir! / Humidity: X% / Temp: X °C"
                └── Wait 5 s, then repeat
epeat
s, then repeat

Repository Structure

SENTINEL-PICO/
├── deskstation.py     # Main application logic (MicroPython)
├── journal.md         # Dev log / Hack Club Lapse links
├── desktop-station.zip # Wowki source file including libraries
└── README.md
.md

Note: ssd1306.py (the OLED driver) must be placed on the Pico alongside deskstation.py. You can download it from the MicroPython SSD1306 driver.


Quick Start

Simulate online (no hardware required)

Open the project directly on Wokwi: https://wokwi.com/projects/462996062362677249

Run on real hardware

  1. Flash MicroPython v1.24.1 (or later) on your Raspberry Pi Pico.
  2. Download ssd1306.py from the MicroPython library (link above).
  3. Copy deskstation.py and ssd1306.py to the Pico using Thonny or mpremote:
    mpremote cp deskstation.py :main.py
    mpremote cp ssd1306.py :ssd1306.pyy
  4. Wire the components according to the Wiring / Pinout section.
  5. Power up : the program starts automatically on boot.

Configuration

All tunable values are located at the top of deskstation.py:

Variable Default Description
Distance threshold 50 cm Maximum distance to consider someone present
LDR threshold 32727 ADC value above which the light is considered insufficient
Refresh interval 5 s Delay between sensor readings when someone is detected

Simulated Screens

No one detected (distance > 50 cm)cm)

Nobody detected

Too dark (ambient light < 100 lux)ux)

Too dark warning

Normal operation (temperature & humidity displayed)yed)

Normal display

Troubleshooting

Symptom Likely Cause Fix
OLED stays blank Wrong I2C pins or missing ssd1306.py Check GP4/GP5 wiring; ensure driver file is on Pico
Distance always returns -1 Echo pin not connected or timeout Verify HC-SR04 wiring (5 V on VCC) and GP27/GP28
DHT22 read error Sensor not stabilised Add a 2-second warm-up delay before the first read
LDR value always 0 ADC pin floating Ensure voltage-divider resistor is connected to GND

License

This project is licensed under the MIT License — see the LICENSE file for details.


Contributing

Contributions, improvements, and remixes are welcome! Please read the CONTRIBUTING.md guide to get started.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages