Chameleon Artwork That Changes Color With the Weather
by Arpan Mondal in Circuits > LEDs
3187 Views, 45 Favorites, 0 Comments
Chameleon Artwork That Changes Color With the Weather
Yes, you read that right. A chameleon that changes color based on the surrounding weather. But hold on to that thought. I'm not just talking about the chameleon we are about to make in this Instructable. I'm talking about real life chameleons. That's right, real chameleons also change colors based on weather conditions. While we all know that chameleons change colors to blend with it's surroundings, scientists do not totally believe in that. In fact, scientists say it is more likely that a chameleon will change colors to reflect it's mood or to protect itself from harsh weather. For example, if it is too cold out there, a chameleon will get darker to absorb more sunlight. Isn't that interesting?
Now coming to this project, I am going to explain how I made a glowing artwork of a chameleon that can change it's colors based on weather changes in your location.
Supplies
Cut Out the Chameleon Drawing
You could just design the entire thing and 3D print it for a hassle free and seamless build. But we still haven't reached the age where everyone has a 3D printer at home and Elon Musk has built a Mars base out of it. So, let's see how I made it without a 3D printer :)
Take a sheet of white cardboard and draw the chameleon on it. While it might take some patience to draw it correctly, you can print the PDF file attached in this step and stick it to the cardboard instead. Then you can cut along the lines.
Cutting was definitely tedious, but I somehow managed to do it. If the edges are not smooth after cutting, you can use a small piece of sand paper to smoothen them.
Downloads
Painting
You can skip this step if you used a black cardboard sheet to begin with. But for everyone else, this step does have some tips about painting!
- Before applying paint, make sure the surface you are painting on is not too smooth. Use a sand paper to make the surface coarse if it is.
- If you are using poster colors (like I did), you need to apply at least 2 coats of paint to get a thick and uniform finish. I ended up applying 3 coats.
- If you are using spray paint, make sure to do it in a well ventilated place. Ideally, you should do it outside.
- While applying spray paint, keep your hand moving from left to right. It's okay if you end up wasting a lot of paint. Don't spray all the paint at one place without hand movement.
- Apply 3 or 4 thin coats instead of one thick coat.
- Use matte finish paint instead of glossy.
Creating the Back Cover
Before we make the housing for the LED strip and the electronics, we need to prevent any light leaking through the cardboard. Although we have applied many coats of paint, if the cardboard is too thin, light will leak through it. Trust me, it did for me. To fix this, we can take an aluminum foil sheet and stick it to the back side of the cardboard. Make sure to cut the part where the chameleon is cut out so that light can pass through it. Also, I sandwitched a piece of butter paper between the cardboard front piece and the aluminum foil. This should diffuse the light coming out of the chameleon.
Then for the rest of the housing, I cut a rectangular frame from a sheet of Styrofoam. Make sure the thickness of the frame is at lease equal to the width of the LED strip. Also, I suggest sticking a strip of aluminum foil to the styrofoam too. This way, the LED strip will remain cool. I missed it during the build.
Finally, for the back panel, I used a normal cardboard sheet.
Get Your Open Weather API
We will use the Open Weather API to extract the weather data for our location. It is free to use and pretty reliable from what I've seen. I use open weather even on my phones over the default weather app.
To get the openweather API, visit the OpenWeatherMap website and create a new account. Navigate to the 'API keys' tab to find the default API key.
Programming the Nodemcu
You can use the attached INO code file with this step. Once you double click on it, you might get a popup asking you to put it inside a folder. Just click 'OK' and it will do the job and open up the code in the Arduino IDE.
The code uses the FastLED library to control the WS2812B strip.
First, you need to make a few changes in the code so that it works as intended. I have added arrows wherever you will have to make changes.
- Add your WiFi SSID and password in the necessary fields.
- Provide your Open weather API key in the next field.
- Add your city and country codes in the next two sections. This will help Openweather send the weather for your location. If this doesn't work, you can try replacing the city name with your zip code. You can find more details here
Once that is done, you should be good to go. Let me explain how the code works.
The code extracts weather data using OpenWeatherMap API. Then we parse the JSON response from the API to get two main details: Temperature and Humidity.
By comparing these values, we determine how the weather is and display the right color on the LED strip. For example, if it is very cold and humid, we display a blue color.
Downloads
Using Adafruit and IFTTT
Skip this step if the Open Weather Map solution works for you
For some people, OpenWeatherMap might nt work reliably. Using an API to get weather data can be quite challenging and complicated to understand and debug. So, here is another way to do it.
We can use the 'Weather Underground' service on IFTTT to get the weather data. Then we use the 'Current condition changes to' trigger to detect the weather condition. IFTTT can then send a trigger signal to Adafruit IO which an send another signal to the Nodemcu about which color to display on the LED strip.
Sounds confusing? Actually, it is pretty simple to setup and much more reliable than the previous method. I have written a step by step tutorial on how to use IFTTT and Adafruit to control a Nodemcu on another instructable. Click here to check it out.
So why didn't I use this method primarily instead of using Open Weather? Well, IFTTT is getting kinda unreliable these days. Earlier, they used to provide unlimited free applets to free users. Then they limited it to three. Now, it is again reduced to 2 free applets only. So, you can only create 2 weather triggers using this method (Unless you create multiple accounts and trigger the same Adafruit feed from all of them)
Circuit Connections
Wiring up the LED strip to the Nodemcu is very simple.
- Connect the Din (Digital input) pin of the LED strip to D7 of the NodeMcu. We have defined D7 as the LED pin in our code.
- Connect the GND pin of the LED strip to GND of the node MCU
- Nodemcu cannot power the LED strip directly, so we will need a separate power supply for it. You can use the same power supply that you are already using to power the Nodemcu and wire it up in parallel. Here, I have shown the 5v supply as a battery. We will connect the positive terminal to the +5v pin of the LED strip.
- If you are using a separate power supply for the LEDs, you will need to connect it's GND (negative) terminal to Nodemcu's GND pin. Otherwise, you can ignore this step.
Done. Now we need to stick the LED strip inside the styrofoam frame and stick it all together. Once done, you can test if everything works fine.
Finished!
And we are done! We have finally made your color changing chameleon artwork. I have always loved art and electronics and wanted to create a fusion of the two. This is definitely one of my favorites. Let's give it a name, what do you say? Art + Electronics = Artronics? If you have any better suggestions, do let me know!
I hope you enjoyed reading this. If you did, you'll enjoy this one even more: Baymax lamp: Helps you take medication on time.