Skip to main content

Smart Lamp

The prototype of a lamp with multiple functionalities.

info

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

Diagram

Picture of hardware components

Hardware

Schematics

KiCad Schematic

KiCad Schematic

Bill of Materials

DeviceUsagePrice
Rapspberry Pi Pico WThe microcontroller39 RON
Mini PIR Sensor HC-SR505The motion sensor9 RON
Photo ResistorLight detector9 RON
Button2 x 0.4 RON
Jumper wires8 RON
Breadboard5 RON
LED0.4 RON

Software

LibraryDescriptionUsage
pir-motion-sensorLibrary for the PIR sensorUsed 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-rsEmbassy-rs frameworkUsed to simplify bare-metal rust
  1. Motion Detection with a Raspberry Pi Pico
  2. How to make a Light Sensor Circuit using a Photoresistor and a Raspberry Pi
  3. Turn on an LED using a button