Smart lamp
The project involves creating a smart lamp that responds to motion and ambient light levels.
Author: Radu George-Alexandru
GitHub Project Link: https://github.com/UPB-FILS-MA/project-George2543
Description
This project revolves around creating a smart lamp system that enhances both convenience and energy efficiency. Utilizing the Raspberry Pi Pico W as its core, along with a motion sensor and a photoresistor, the lamp dynamically responds to its environment. By detecting motion, it ensures that illumination is provided when needed. Additionally, the led turns on/off based on ambient light levels, conserving energy when sufficient natural light is available and optimizing comfort when there is not enough light. This integration of motion and light sensing technology transforms the lamp into a versatile and adaptive lighting solution for any space.
Motivation
I choose to persue this smart lamp project because I was thinking that one of the most important facilities of a smart house are the lights. This project tackles energy efficiency by innovating traditional lighting with a Raspberry Pi Pico W and motion/light sensors. It's a technical challenge that excites me, merging hardware and software seamlessly, so that I can craft a smart home solution that contributes to a mindful energy consumption.
Architecture
Main components:
- Raspberry Pi Pico W: Is the control unit, it manages the motion sensor, photoresistor and LED
- Magnetic sensor Hall: Detects motion within its range
- Photoresistor: Measures ambient light levels
- LED
Connection between components:
- Motion sensor to microcontroller: The motion sensor is connected to the Raspberry Pi Pico W through GPIO pins.
- Photoresistor to microcontroller: The photoresistor is directly connected to the Raspberry Pi Pico W.
- LED to microcontroller: The LED is connected to the Raspberry Pi Pico W, serving as the output. Through the microcontroller, the LED is controlled based on the inputs received from the magnetic motion sensor and photoresistor.
Log
Week 6 - 12 May
I completed the project Kicad schematic, ensuring all components are properly connected.
Week 7 - 19 May
I used the project schematic as a template when putting together the hardware on the breadboard.
Week 20 - 26 May
I implemented the software for the hardware using PWM on the photoresitor and read the value of the motion sensor using the adc pins. After that I've run the code and flashed it on the pico.
Hardware
- Raspberry Pi Pico W: The microcontroller serves as the main processing unit, coordinating the functions of the entire system.
- Magnetic motion sensor: Detects motion within its range and sends signals to the Raspberry Pi Pico W, triggering the activation of the LED when movement is detected.
- Photoresistor: Measures ambient light levels and communicates this data to the Raspberry Pi Pico W.
- LED: Illuminates the lamp and is controlled by the Raspberry Pi Pico W. It turns on/off based on signals received from the motion sensor and light sensor.
- Resistors: Used to limit the current flow and protect the components, ensuring stable operation of the circuit.
- Breadboard: Provides a platform for assembling the circuit.
- Micro USB Cable: Powers the Raspberry Pi Pico W.
Schematics
Place your KiCAD schematics here.
Bill of Materials
Device | Usage | Price |
---|---|---|
Rapspberry Pi Pico W | The microcontroller | 35 RON |
Magnetic sensor HALL SS495A | Detecting motions | 3.33 RON |
Photoresistor | Measures ambient light | 1.90 RON |
LED 5mm | Serves as output | 0.45 RON |
Resistors | Protect components | 12.29 RON 600pcs/30val |
Breadboard | Assembling the circuit | 9.98 RON |
Wires male to male | Connections | 6.99 RON 40pcs |
Micro USB cable | Power the microcontroller | 3.03 |
Software
Library | Description | Usage |
---|---|---|
embassy_executor | Running asynchronous tasks | Execute asynchronous tasks |
embassy-time | Time Library | Used for creating timing functions |
embassy-rp | RP2040 pheripherals | Accesing the pheripherals of the microcontroller |