Smart Lamp
The prototype of a lamp with multiple functionalities.
Author: Bădică Ioana-Miruna
GitHub Project Link: Smart Lamp
Description
The project consists of a LED that turns on the light automatically when it detects movement and only when it is dark. Besides, it should still have its regular "lamp" function, so it will have a button to turn it on "smart" mode.
Motivation
I have chosen this project because I wanted to implement something that could turn into a bigger project later such as using a real lamp instead of a LED, or implementing new functions like (if I were to use a RGB LED) to add a remote controller to switch the colors of the light from far away.
Architecture
Components
-> Raspberry Pi Pico W: Microcontroller
-> Mini PIR HC-SR505 Sensor: Detects movement around the sensor
-> Photo Resistor: Used to detect the light intensity around the resistor
Connections
-> Both the PIR HC-SR505 sensor and the photo resistor are connected to the Raspberry Pi Pico W
-> The LED is also connected to the Rapberry Pi Pico W
-> The buttons are connected to the LED and also to the Raspberry Pi Pico W in order to send a signal when to get the data from the sensor and photo resistor
Log
Week 6 - 12 May
Managed to get all the components for the project and searched for documentation for each component.
Week 7 - 19 May
Assembled all the hardware components together, did the KiCad schematic and started the software rust program.
Week 20 - 26 May
In the last week, I made significant progress on the project software by implementing all the functionalities I wanted in the beginning. Lastly, I have added on GitHub the project and completed the Software Milestone.
Hardware
Diagram of Hardware components
Picture of hardware components
Schematics
KiCad Schematic
Bill of Materials
Device | Usage | Price |
---|---|---|
Rapspberry Pi Pico W | The microcontroller | 39 RON |
Mini PIR Sensor HC-SR505 | The motion sensor | 9 RON |
Photo Resistor | Light detector | 9 RON |
Button | 2 x 0.4 RON | |
Jumper wires | 8 RON | |
Breadboard | 5 RON | |
LED | 0.4 RON |
Software
Library | Description | Usage |
---|---|---|
pir-motion-sensor | Library for the PIR sensor | Used to simplify the process of reading data from the PIR sensor and to avoid having to write low-level code to interact with the sensor |
embassy-rs | Embassy-rs framework | Used to simplify bare-metal rust |