element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Internet of Things
  • Technologies
  • More
Internet of Things
Documents WI-FI Enabled Mood LED Lights at Home
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Internet of Things to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 30 Jul 2014 2:50 PM Date Created
  • Last Updated Last Updated: 30 Jul 2014 6:37 PM
  • Views 1334 views
  • Likes 2 likes
  • Comments 6 comments
Related
Recommended

WI-FI Enabled Mood LED Lights at Home

image

 

As a keen fan of IoT I wanted to workout something at home and what should be better than starting with the lights? image My living room's ceiling was designed initially to import hidden LED lights at its edges and provide relaxing movie nights atmosphere. In order to have cool effects and even changing colors I have chosen an RGB 5050 LED strip which has 60 leds per meter. The current draw of this strip is estimated at 1.2A per meter if all the colors are at their maximum (white color). For my project I needed 15 meters of LED strip and bought 180W switching power supply that can handle the load. The LED strips are usually sold in 5 meters length and you can connect them to each other using their headers. Be aware that in each 10 meters you will need an amplifier or another power source otherwise the leds at the end of the strip will not light that bright like the other end. I have overcome this by setting a second power line from the power supply to the middle of the strip where initially I measured around 1V drop between the two ends of the strip. Another problem that you might face is the resistance in the headers of the led strip, so I recommend removing them and solder the strips to each other.

In order to control it I decided to use an ArduinoArduino + Wi-FI UART Module and later write a socket application that can be hosted on an IoT router or single deployment written in Java. In order to control a LED you need the IC to have PWM enabled pins. ATMega 328P which I used has 6 of them or in other words you can have two channels of RGB strips that can be controlled separately. To control the different colors of the LED strip I have chosen the STP16NF06L resistor STP16NF06L resistor which is capable to power 16A which is about 750 leds at full bright. In order to fit everything on one board I have moved the Arduino as per this tutorial on a development board Arduino - Setting up an Arduino on a breadboard

 

Connecting the LED Strip wiring should look like this:

image

Where in the above picture if you have long strip like mine you should connect the +12v line of the strip directly to your power supply and make sure you have the negative ( - ) connected from the LED power supply to the Arduino if you are supplying it with other power source.

 

The WI-FI is pretty easy - you need to get an UART module and attach it to RX/TX. Any will work. After doing so you need to connect it to your home WI-FI network as per the module's documentation. Once you are there you should be able to open telnet to the configured IP and port and transmit commands to the Arduino. You can also use Bluetooth module for this functionality which will work the same way.

 

For having nice effects and also a feature to find a color that best fits my mood I have updated the code to use the HSV color representation - HSL and HSV - Wikipedia, the free encyclopedia.  The HSV to RGB transformation is based on this post Arduino Programming – HSB to RGB This allows me to change the color smoothly in a loop with pre-configured step and delay by changing the HUE only instead of mixing the RGB values. Once I find the perfect color for me I just reset the step to 0 and the color will stop changing. In the command controls I have enabled change for all possible values - Hue, Saturation, Brightness, Color step, delay. You can find the code that I have bundled attached to this post.

 

For the first version of this I accidentally broke my WI-FI module while mounting all this which left me with a hanging cable from the ceiling and I had to connect the laptop in order to change the color - not cool at all image Fortunately I had an IR receiver and remote so I retrofitted the code to support IR remote control as most of the stock LED Strips come, just until I have my new WI-FI module. In order the attached code to work you will need to setup the Arduino IR library as per this tutorial https://github.com/shirriff/Arduino-IRremote Using it gives you the power to change the code so any IR remote control in your house can work.

 

For using telnet or any other terminal to control the lights over WI-FI with the attached code you should use this reference:

     H100 - change the hue to value 100 - Hue can be between 0 and 360

     S100 - change saturation to value 100 - Saturation can be between 0 and 255

     B100 - change the brightness to 100 - Brightness can be between 0 and 255

     D1000 - change the delay to 1 second - The color will change with particular step each second

     F1 - the hue step value will change by 1. Once it reach 360 it will start from 0

 

 

Another feature I have set is to record the last values from the commands into the EEPROM so they are persisted and working on a system restart.

 

The code can have defects and might be better for sure. I was in a hurry to see it working image I might continue updating this document once I have new changes if there is interest.

 

What is next? Well I can setup the API to work with a Pebble App, deploy an HTML5 webpage to a local server and change the LED values over my home's webpage. I can setup a photo resistorphoto resistor to start them based on outside light or even create a setup to mimic the TVs background color for better experience. You can imagine more...

 

External References:

http://arduino.cc/en/Main/Standalone

https://learn.adafruit.com/rgb-led-strips/overview

Arduino Programming – HSB to RGB – kasperkamperman.com : creative media technology

https://github.com/shirriff/Arduino-IRremote

Attachments:
HSB_RGB.zip
  • wi-fi
  • strip
  • led
  • iot
  • arduino
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply
  • shabaz
    shabaz over 11 years ago in reply to Former Member

    I didn't realize those IR receivers were so cheap these days! For small amounts of data/config, looks like the most cost-efficient method of wireless transmission image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 11 years ago

    Great Job man ... and very useful ..

     

    Axel

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to shabaz

    Thank you Shabaz! Should be a good start as this is my first emelement14 post image I believe the IR Receiver is TSOP4838 TSOP4838 But if it doesn't work with a particular remote you can also search for other frequency receiver.

    I like the "travolta mode" idea a lot image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 11 years ago

    Nice work.

     

    mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 11 years ago

    Nice! What IR receiver did you use? It could be useful for configuring many things on the fly, when you don't have wireless connectivity. Just find any remote : )

     

    Hehe you should make it so if you click your fingers, it goes into "travolta mode" : ) Maybe you already have image

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mitko369
    mitko369 over 11 years ago

    Great job on combining electrical with internet of things. Next hobby project for the weekend! image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube