Skip to main content

Smart lamp

The project involves creating a smart lamp that responds to motion and ambient light levels.

info

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

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

DeviceUsagePrice
Rapspberry Pi Pico WThe microcontroller35 RON
Magnetic sensor HALL SS495ADetecting motions3.33 RON
PhotoresistorMeasures ambient light1.90 RON
LED 5mmServes as output0.45 RON
ResistorsProtect components12.29 RON 600pcs/30val
BreadboardAssembling the circuit9.98 RON
Wires male to maleConnections6.99 RON 40pcs
Micro USB cablePower the microcontroller3.03

Software

LibraryDescriptionUsage
embassy_executorRunning asynchronous tasksExecute asynchronous tasks
embassy-timeTime LibraryUsed for creating timing functions
embassy-rpRP2040 pheripheralsAccesing the pheripherals of the microcontroller
  1. How to Connect BH1750 with the Raspberry Pi Pico/Pico W: Measure Ambient Light for Smart Lighting
  2. Smart Light | LDR | Relay | Arduino Uno | Arduino project | Smart Bulb | Smart Street Light | Bulb