Arduino Based LED City Model

by gosha05 in Circuits > Arduino

2822 Views, 28 Favorites, 0 Comments

Arduino Based LED City Model

219758672_1479967272364443_5507879293527373113_n.jpg
220061017_247225353631691_7370967004970292386_n.jpg
220014082_278278387432208_1499898769864402317_n.jpg
217192841_327727949063941_7714016244149502437_n.jpg

everything is boring without LEDs, so lets make a city out of it!

Basic Idea:

so we build a City mode out of cardboard, then illuminate it with a LOT of RGB LEDs and let the temperature of color change according to room temperature using LM35 Temperature sensor.

Supplies

1. WS2812b RGB LEDs (neopixels).

2. Arduino Uno/nano or any other available arduinos.

3. Some wires.

4. Cardboard.

5. Paper

6. Paint of some kind.

7. LM35 temperature sensor.

8.Plasticine, clay or a stretchy material.

9. Cotton (from pharmacy).

10. Aluminium foil.

Tools:

1. Hot glue gun.

2. Soldering iron (with some soldering wire).

3. Knife or scissors to cut the cardboard and the paper

4. Ruller.

Drawing

hghghgzdfgzsdf Aewf VASedfsedf.png
219746138_1547777462059575_6707009641089049072_n.jpg
219413567_774330996578487_549870151727035122_n.jpg

First of all we drew bunch of sketches and listened to Bee Gees - Stayin' Alive for 8 hours straight to find inspiration. in the end we came up with something...

Center Building

218498522_364265605296043_6539443762720210205_n.jpg
219406207_863569474271157_5859674375457053027_n.jpg
219614381_213687047331816_5968351748833851090_n.jpg
219261457_1439361539772074_4056655142336673101_n.jpg
hghghgzdfgzsdf Aewf VASedfsssedf.png

We decided for the main building to be octagonal shape. We cut out the cardboard, then bent it and glued LED strip on it. We painted it and then we filled window holes with Hot glue to give it blurring effect. then placed it in the center of the city.

Trees

218973785_200486488701282_4238315809095297119_n.jpg
lesdasdasfsafsdd.png

4 Wires should be coming out of the tree roots. its recommended to color code them: Black - GND; Red - 5v; Yellow - Din; Blue - DO;

Other Buildings

219455917_208731144385080_1887335136133279293_n.jpg
219051799_359053782456642_751493694798958441_n.jpg
217553391_1519120451760231_6301599033811780770_n.jpg

Then we started to make other buildings. all of them are made the same but with different dimensions. we cut then out, paint them and make windows just like in the previous one. We placed LEDs on the bottom side of the cardboard and made the roof with aluminium foil. aluminium foil helps reflect the light.

Park (mostly Just Grass)

220521671_930126230903316_6883404306766109444_n.jpg
sssdasggggggdggg.png

We made some of the grass with this stretchy thingie to give it 3D feeling. Oh and we also drew the river with light blue and white paint. we Use acrylic paint but am sure other types of paints will work too.

Wiring

218836179_1681802975362402_7491164660754044308_n.jpg
sssdasggggggdgjfgjggg.png

This step should be done only after everything is in place. Connect all GND and 5V wires together and daisy chain LEDs. then connect daisy chain main input to the Arduino digital pin 5. Connect GND and 5v to its pins. External power supply is highly recommended. Just use 5V external powers supply and connect power supply GND to Arduino GND and power supply 5V to Arduino 5V. Wiring can look messy like in my case but its fine...

Drawing Parking.

217192841_327727949063941_7714016244149502437_n (1).jpg

That's it. We just drew the parking.

Arduino Code

#include #define NUM_LEDS 100 #define DATA_PIN 5 #define CLOCK_PIN 8 int val; int tempPin = 3; int BT1 = 0; int BT2 = 1; int BT3 = 2; int BT4 = 3; int BT5 = 4; int BT6 = 5; int BT7 = 6; int BT8 = 7; int WT1 = 28; int WT2 = 29; int WT3 = 30; int WT4 = 31; int TrBl = 0; CRGB leds[NUM_LEDS]; void setup() { FastLED.addLeds(leds, NUM_LEDS); Serial.begin(9600); } void loop() { val = analogRead(tempPin); float mv = ( val/1024.0)*5000; float cel = mv/10; Serial.print(cel); Serial.print(" "); Serial.print(TrBl); Serial.println(); TrBl = map(cel, 25, -10, 0, 255); if (TrBl < 0) { TrBl = 0; } if (TrBl > 255) { (TrBl = 255); } leds[BT1] = CRGB(0, 255, TrBl); leds[BT2] = CRGB(0, 255, TrBl); leds[BT3] = CRGB(0, 255, TrBl); leds[BT4] = CRGB(0, 255, TrBl); leds[BT5] = CRGB(0, 255, TrBl); leds[BT6] = CRGB(0, 255, TrBl); leds[BT7] = CRGB(0, 255, TrBl); leds[BT8] = CRGB(0, 255, TrBl); leds[8] = CRGB(200, 255, TrBl); leds[9] = CRGB(200, 255, TrBl); leds[10] = CRGB(200, 255, TrBl); leds[11] = CRGB(200, 255, TrBl); leds[12] = CRGB(200, 255, TrBl); leds[13] = CRGB(200, 255, TrBl); leds[14] = CRGB(200, 255, TrBl); leds[15] = CRGB(200, 255, TrBl); leds[16] = CRGB(200, 255, TrBl); leds[17] = CRGB(200, 255, TrBl); leds[18] = CRGB(200, 255, TrBl); leds[19] = CRGB(200, 255, TrBl); leds[20] = CRGB(200, 255, TrBl); leds[21] = CRGB(200, 255, TrBl); leds[22] = CRGB(200, 255, TrBl); leds[23] = CRGB(200, 255, TrBl); leds[24] = CRGB(200, 255, TrBl); leds[25] = CRGB(200, 255, TrBl); leds[26] = CRGB(200, 255, TrBl); leds[27] = CRGB(200, 255, TrBl); leds[WT1] = CRGB(0, 255, TrBl); leds[WT2] = CRGB(0, 255, TrBl); leds[WT3] = CRGB(0, 255, TrBl); leds[WT4] = CRGB(0, 255, TrBl); leds[32] = CRGB(200, 255, TrBl); leds[33] = CRGB(200, 255, TrBl); leds[34] = CRGB(200, 255, TrBl); leds[35] = CRGB(200, 255, TrBl); leds[36] = CRGB(200, 255, TrBl); leds[37] = CRGB(200, 255, TrBl); leds[38] = CRGB(200, 255, TrBl); leds[39] = CRGB(200, 255, TrBl); leds[40] = CRGB(200, 255, TrBl); leds[41] = CRGB(200, 255, TrBl); leds[42] = CRGB(200, 255, TrBl); leds[43] = CRGB(200, 255, TrBl); leds[44] = CRGB(200, 255, TrBl); leds[45] = CRGB(200, 255, TrBl); leds[46] = CRGB(200, 255, TrBl); leds[47] = CRGB(200, 255, TrBl); leds[48] = CRGB(200, 255, TrBl); leds[49] = CRGB(200, 255, TrBl); leds[50] = CRGB(200, 255, TrBl); leds[51] = CRGB(200, 255, TrBl); leds[52] = CRGB(200, 255, TrBl); leds[53] = CRGB(200, 255, TrBl); leds[54] = CRGB(200, 255, TrBl); leds[55] = CRGB(200, 255, TrBl); leds[56] = CRGB(200, 255, TrBl); leds[57] = CRGB(200, 255, TrBl); leds[58] = CRGB(200, 255, TrBl); leds[59] = CRGB(200, 255, TrBl); leds[60] = CRGB(200, 255, TrBl); leds[61] = CRGB(200, 255, TrBl); leds[62] = CRGB(200, 255, TrBl); leds[63] = CRGB(200, 255, TrBl); leds[64] = CRGB(200, 255, TrBl); FastLED.show(); delay(50); //this code changes its color temperature according to room temperature. it adds more blue the lower the temperature gets. }

Arduino Library

download Arduino FastLED.h library from: https://github.com/FastLED/FastLED