Forum

Arduino based RGB L...
 
Notifications
Clear all

Arduino based RGB LED floor lamp

23 Posts
1 Users
0 Likes
4,520 Views
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

I came across a floor lamp pic floating around, and loved the concept for some accent lighting in my living room and office.

The sticker price was around $150.. wow.. So I figured I would make some of my own.

Current parts list as follows (I just ordered most of this, so I am still awaiting it to arrive)

Aluminum U Channel for LEDs
Aluminum Square Tube 20mmx300mm
12v WS2811 RGB LED strip, non-waterproof
12v Power supply
ESP8266-01

Other items I already have on hand, but include;

4 Wire LED Wire  (technically you only need 3 wires. But I had this on hand from other projects)
2.5mm Power Connector

And I'm either going to use an Arduino Nano, or an Adafruit Trinket. But more than likely the Nano, as I'm tossing around ideas for Syncing multiple devices.

As for syncing the devices / effects between them, I am tossing around a few ideas of how to sync and control them.

For the lamp itself, I'll just use a section of the U channel and mount it vertically with the LEDs inside. I plan to design and 3D print the base, once I get the channel in my hand.

I hope to have most, if not everything, in my hands this Friday. It should be fun.

 

This topic was modified 4 years ago by CrackedConsole

   
Quote
Topic Tags
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

The U channel came in and I've since started taking measurements to make a fitted base, here is the progress so far.

The U channel and diffuser slide in nicely in the top, there is room for cable management as well as an ESP8266. I've also added 2 tabs so the leg extensions can slot into place.

 

 

As for the legs, here is a quick concept I've been working on, I plan to 3D print both parts and do a dry run. I've already test fitted the U channel into it's slot and all is well.

 

 

Lastly, as mentioned, I am looking into using an ESP8266 for each light. With the hope that I can work out getting them all to recognize each other and sync together, I do have some simple Rainbow effects setup and tested with an Arduino Nano using the FastLED library and I'm pleased.

I'll work on finishing the hardware design, as I still have to add a power plug at 12v and split / drop the voltage down to 3.3v for the ESP8266. A location for the 12v plug still needs to be laid out in the 3D design as well, either a built in port, or a 2.5mm pigtail hanging out the back to plug into power.

 

More to come, as I hope to get alot done this weekend on this project.

(Side note)

For voltage regulation I may end up going with 

AMS1117-3.3 DC Voltage Regulator

As it can take in 12v and drop it down to 3.3v at 800ma, and from what I am reading an ESP8266 needs only 400ma.
These will arrive Sunday so I can start to play with them.

This post was modified 4 years ago by CrackedConsole

   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

Always check, before you place an order.. I guess I already had a collection of AMS1117 3.3v DC Regulators, so I broke one out and hooked up everything.
After installing the ESP8266 Libraries for Arduino, I flashed some test code to the ESP8266-01.

Hooked everything up, and no lights...

 

After some hair pulling and digging, I found that I needed to connect CH_PD to 3.3v as well in order to enable to ESP-01.

I can now say I have a successful test run of my WS2812 RGB LEDs connected to and being controlled by an ESP8266-01.

 

 

Once I get some final test code completed, I will share it as well. But for now, the basics are;

LED Type - WS2812

Data Pin - 2

 


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

Well, I've opted for a smaller more simple design for the 3D printed base.

 

The prior design was abit too big, bulky and long to print. This new design is abit more sleek and has built in channels under the legs to add some weight, such as lead shot or otherwise.

I have a rough test print completed (and looks like I need to do some maintenance to my printer)

 

 

I am a little worried about the 3.3v Voltage Regulator being stuffs inside the base of PLA plastic, worrying it may cause it to warp from heat. So I will have to test this and maybe change to PETG.

 

And for a teaser, as I start to work more on the code and additional effects...

 

 


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

Another day, more changes and progress!

I've opted to use 20mmx300mm extruded Aluminum square tubing for the legs/feet. This will save a TON in 3D print time as well as clean up the look abit.

 

I've got a final center section printing as we speak, and should... should be the final draft.

 

I am also going to leave the ESP8266 exposed and connected via a pin-header so it can be removed and re-flashed if someone so desires. Thus making this more a an opensource / tinkerer kit and project.

I plan to open source the Arduino code, as well as the 3D printed files.

 

The final version cleans up the lines a bit, and the legs press fit into place.

 


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

The final base design is DONE! Everything test fitted, and works perfect.

The legs and LED strip are friction fit, and are firm and stable once it's all put together.

 

Final steps are working out the remaining light effects and code, then writing up a cell phone app to control everything.

Another 1-2 weeks to wrap that all up, and the kits will then be available for sale on our webstore!

 

I plan to release the 3D files, Arduino and Phone app code, and also I will be leaving the ESP8266 exposed on the finished product. The goal is to have it connected via an 8 pin adapter, so if you wish you can unplug it and flash your own code or modify the existing.

 

More to come!

 

 

 

 

This post was modified 4 years ago by CrackedConsole

   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

I just placed an order for a run of 50 PCBs.

These will allow me to add the 8-pin pin header for the ESP-01, as well as the 3.3v Voltage regulator (on the opposite end) and lastly 3 pads for the RGB LEDs.

It looks like it will take around 2 weeks for production and delivery, so we shall see.

Another look at the final design, I still have to whip up some end caps for the legs. More than likely, that will be tonight.

 

A nice test fit of the electronics, again the ESP-01 will be removable for those that wish to add their own code.

 

And a quick test fit, where I started with the idea to just go ahead and get a custom PCB designed.


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

I've modified the base just a hair.

I raised the ceiling inside the parts area by 1mm, giving more room for everything.
I've added a small indent on the bottom layer, so you can access the removable ESP-01 a little easier.
I created a 0.5mm trench in the center, giving abit more room for the RGB LED wiring.

I can't imagine there will be any other major, or even minor changes after this. I of course still need to get the PCBs and test fit everything again, but I'm pretty sure this is it for version 1. I do eventually plan on doing a a possible version 2, that will include a small Mic for sound level processing and reactive LEDs. But for now I need to focus on finishing the Arduino code, as well as writing a controller app for your phone.

Lastly, I have finished and tested the leg end caps. Nothing special here, more so for ease of printing. Just a plug to cap off the aluminum legs.


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

I've almost finished the base Arduino code.
My main goal was to create a data structure that could be sent from the Android app to the ESP and change effects, colors and palettes based of that string.

 

So far I'm toying around with a 15 octet string right now.

The basics being

 

[effect][colorcount][blending][rgb colors]

[setting][value]

 

So for a 2 color palette effect it would be

0;2;0;0;255;0;255;255;0;

The first 0 being - Mode Palette

The 2 being - 2 palette colors

The next 0 being - Linear blending

And then the next 2 sets of 3 digits break down the RGB colors for each of the 2 colors in the palette.

 

You can also change settings and additional effects via the same structure, the first octet when set to 4 or above is the settings, ie...

2;0;

The first digit being 2 - Sett effect

The second digit being 0 - Fire effect

Or...

4;60;

The first digit being 4 - Speed settings

The second digit being 60 - Speed or updates per second.

 

When the ESP8266 gets a HTTP request from a client, it takes that string and parses it into a 15 integer array, that array is the command structure it then breaks down and updates the lights and effects based on that.

 


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

Just a quick update of what I will be working on next.

I found a way to read and write to the "EEPROM" of the ESP8266, thus the goal will be when you first turn on the device, you will connect to it as a WiFi access point, enter your own Wifi details and reboot. It will then connect to your WiFi for control.
I plan to have a timeout, where if it can't connect to your WiFi, it will revert back to being an access point so you can reconfigure the device. Of course once WiFi details are stored, it will always try to connect at boot prior to reverting back.

 

One of the write ups I've been following and plan to utilize is

 

https://thekurks.net/blog/2017/11/6/esp8266-iot-eeprom-example


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

A few updates on the coding side.

 

I've finished the Wifi portion, acting as an Access Point at initial boot, you can then connect to it and pull up a web page to enter your Wifi SSID and Password, that is then committed to the ESP's "EEPROM". 
The device will then hard reboot and connect to the Wifi that you entered in. If it times out, it will allow you to reconnect back to it's own access point and re-enter your details.

 

Effects and options that are complete.

The following effects are done;

Color Palette - Rainbow
Color Palette - Clouds
Color Palette - Forrest
Fire Effect - With default Heat Palette
Sparkle Effect - Choice of color
Strobe Effect - Choice of color
Solid Color - Choice of color

The following are being worked on;

Color Palette - Choice of colors (up to 4 colors)
Fire with Palette - Choice of colors (up to 4 colors)
Breathe - Choice of color
HeartBeat - Choice of color

 

Items to complete over all.

Outside of the above mentioned effects, the remaining items to wrap up are;

Generating color palettes from integer values (should be fairly easy, I just haven't started on it yet)
Updating the Wifi details input form (beautify it for lack of a better term)
Finishing the on/off options (I want to store the current light setting or effect, this is for a soft off/on not a power disconenct)
Working on power loss options, it does save wifi details on power loss, but not the current light settings/effect
Any other lighting effects I may decide on.

Oh and also, the Android control app, I haven't even started on this. BUT It should be fairly straight forward once I get the hang of things>
It's to the point I pretty much need a few drop downs or check boxes, a color wheel and the ability to scan and detect for the device names on the network and then send them a string over HTTP.

My goal is to kind of make it like the "Magic Home" interface;

Where you have a Devices and Groups list, you can choose a device or group then change the lighting effects for them respectively.
This way you can add multiple lights to a group and then set them all at once to blue, for example.

Lastly, the first PCB run is complete! They should arrive this Wednesday.
I also picked up 2 tiny sound modules, as I want to toy with making these sound reactive. For sure it wont be in version 1, as the 3D base and the PCB have no allowance for this. But maybe I can eventually add an option in the Android app to do sound reactive options to version 1.

 

More to come!

 


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

"Christmas" came early this past weekend.

The first batch of PCBs was delivered yesterday on Labor Day!

 

 

 

The fit is great! But of course I am making just a few small adjustments and tweaks to the design here and there for the base.
I've rounded a few of the corners, cable slot and lower edges.

And highlighted in yellow below, I added a small relief cutout for the PCB to rest back into it's home.

 

The PCB will be glued/epoxied into place, yet the pin-header will let you remove the ESP for re-flashing, updating or replacement.

The last items on my plate before I list these on the web store are;

Finish multicolor fadein-fadeout code.
Fix heartbeat effect.
Beautify the WiFi input form.
Disable SoftAP once the lamp connects to your WiFi.
Read/Write current light settings to EEPROM, so device resumes last effect if power is lost.
Add Brightness setting.

Start and finish Android based controller app. (Any takers on helping here? lol)


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

A couple of notes;

The 12v RGB LEDs I have been using are 3 LEDs per IC, thus you can only controller groups of 3 LEDs together. I love the brightness, but I am not happy with some of the effects. 
On top of that the 3.3v regulator is getting fairly warm inside it's little cuby hole, this has caused the PLA plastic to become slightly soft to the touch in the thinner areas.
I have a fully addressable strip of 5v LEDs arriving in the next day or so, I can hook those up and see if things run cooler.

I am also debating swapping over to PETG for the base parts, as it is better suited for the heat the regulator is putting out.

At the end of the day though, I'm fairly confident the swap from 12v to 5v will solve all the issues above.


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

Well, it is looking like the 5v LEDs are the way to go. The voltage regulator runs much cooler, as well as the LEDs themselves.
I've completed all effects that will be in this build, and now my main focus is the control App.

I've swapped over from Android Studio to Visual Studio, as I have past experience with it. I'm hoping this will allow me to easily publish an iPhone app as well as Android now.

 

I think I am also going to add a couple items to the web store, outside of the complete light kits.

1. Preflashed ESP8266 modules, this also allows for major firmware update and chip replacement options. As well as giving DIY folks some options.
2. ESP to RGB LED PCBs, these will allow a DIY fan to connect their own (or our) ESP8266, LED strip and feed in anywhere from 12v to 5v for LED power and ESP power.

It's going to take a couple of weeks at minimum to get used to Visual Studio again, and figure out the app and part it together. Past that, I'm not sure how long app approval for each app store takes, so I'll at least make the APK and otherwise available until it can hit the App store.


   
ReplyQuote
CrackedConsole
(@crackedconsole)
Member Admin
Joined: 6 years ago
Posts: 368
Topic starter  

User Interface design for the mobile app is well underway.
This is a rough draft, a few things will change for sure, such as icon size and adding text to the options.

 


   
ReplyQuote
Page 1 / 2
Share: