Skip to content

Control of Custom Bedroom Lighting via Amazon Alexa Voice Assistant

Bedroom lighting was causing problems for Arkandas due to being either overly bright and direct, or too dim and diffuse. Custom lighting became the solution to this dilemma and a new...

Control Your Custom Bedroom Lights Via Amazon's Alexa Voice Assistant
Control Your Custom Bedroom Lights Via Amazon's Alexa Voice Assistant

Control of Custom Bedroom Lighting via Amazon Alexa Voice Assistant

A new project, led by Arkandas, aims to provide a solution to the common problem of inadequate bedroom lighting for reading in bed. The project, detailed on Github, involves building a custom controller for addressable LED lighting strips installed in the headboard of the bed.

The lighting system, capable of producing a light that can be adjusted to various levels, is controlled by an ESP32 microcontroller. Previously, the ESP32 has demonstrated its capabilities in creating smart lighting solutions, making it an ideal choice for this project.

Materials and Setup

To build this custom lighting system, you'll need the following materials:

  1. Addressable LED lighting strips (either WS2812B or SK6812)
  2. Aluminum channel with plastic diffusers for a smooth light
  3. ESP32 microcontroller
  4. Suitable power adapter for continuous use

Begin by wiring the LED strip data to an ESP32 GPIO pin and supplying appropriate 5V power for the LEDs.

Next, install the Arduino IDE and add ESP32 board support. Then, install the FastLED and/or Adafruit NeoPixel libraries via the Arduino Library Manager.

Programming the ESP32

Write a sketch initializing the LED strip and controlling LED colors/effects. The FastLED library allows you to set brightness, colors, and animation patterns, while the Adafruit NeoPixel library provides an object representing the strip with methods to set pixel colors and display them.

Adding Smart Functionality

For smart bedroom functionality, include Wi-Fi connection code on the ESP32 and use MQTT or another protocol for remote control. This can be integrated with an IoT dashboard (e.g., Node-RED) to set colors, brightness, or animations from a phone or PC.

You can upload your sketch via USB and power the ESP32 with a suitable adapter for continuous use. The combination allows custom lighting effects, schedules, and remote interactions.

Example Code

Here's an example snippet using FastLED (assuming WS2812B strip on GPIO 7 with 60 LEDs):

```cpp

CRGB leds[NUM_LEDS];

void setup() { FastLED.addLeds

void loop() { fill_solid(leds, NUM_LEDS, CRGB::Blue); // Set all LEDs blue FastLED.show(); delay(1000); fill_solid(leds, NUM_LEDS, CRGB::Black); // Turn off LEDs FastLED.show(); delay(1000); } ```

Integrate Wi-Fi and MQTT components to subscribe to lighting commands to adjust colors, brightness, or patterns dynamically. This provides a customizable and networked smart lighting controller for your bedroom.

Potential Applications

Though primarily designed for bedroom use, the smart capabilities of this lighting system have potential for other applications as well.

We encourage our readers to share their own smart lighting solutions with our tipsline, helping us all to create smarter homes together. Happy building!

This smart lighting system, designed for improving reading capability at night, utilizes addressable LED lighting strips, such as WS2812B or SK6812, and is controlled by an ESP32 microcontroller, a gadget renowned for its smart capabilities in technology.

To elevate this project's functionality, you can integrate Wi-Fi and MQTT into the ESP32, making it compatible with other smart home devices and gadgets, allowing you to control the lighting system remotely through an IoT dashboard.

Read also:

    Latest