Here is a Mini Christmas Light With Arduino as Project Which Needs 3 Resisters and 3 LEDs, No External Power Supply. It Has 2 Blink Effects. This is great for the beginners and better than plain Blink that is supplied with the Arduino Software. It does not need external power means – it needs very less resources.
Mini Christmas Light With Arduino : Required Components
Frankly, at minimum you should have :
But it is better to have a breadboard, Multimeter and typical Electronics DIY kit. It is not that, without these later 3 you can not play. We have a video to show you how it exactly looks like :
---
Mini Christmas Light With Arduino : Circuit
We have a circuit design for you :
It is quite easy. The basic line diagram will be like this :
1 2 3 4 5 | LED1 ---(+)---[200 Ohm Resister]---- Pin 8 LED2 ---(+)---[200 Ohm Resister]---- Pin 7 LED3 ---(+)------------------------- Pin 12 LED1, LED2, LED3 ----(-)----[10K Ohm Resister]--- GND |
All the three LED’s negative pole should be connected and attached to a 10K Ohm resister (it is needed for our later upgraded guides, you can actually omit the resister here) and the wire connecting to the resister will go to GND of Arduino board.
The first LED’s positive pole should be connected to a 220 Ohm resister and go to pin number 7 of Arduino Board.
The second LED’s positive pole should be connected to a 220 Ohm resister and go to pin number 8 of Arduino Board.
The third LED’s positive pole should be connected directly connected to pin number 12 of Arduino Board. Resister not required for this LED.
Mini Christmas Light With Arduino : Code
Here is the code snippet, you can actually get the whole project on GitHub and at FritZing as Mini Christmas Light Arduino UNO. We are writing the snippet here for documentation purpose.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | void setup() { pinMode(13, OUTPUT); // on board LED OFF } void loop() { digitalWrite(13, LOW); // declaired pin value pinMode delay(10); // we will repeat the cycle for 6 times to create a visual impression, we will light up the 2nd blue LED at 3rd interval // continuous blink starts digitalWrite(8, HIGH); // LED on 8 ON delay(100); // wait time digitalWrite(8, LOW); // LED off delay(50); // wait time digitalWrite(7, HIGH); // LED on 7 ON delay(100); // wait time digitalWrite(7, LOW); // LED off delay(50); // wait time // add smoothing transition effect digitalWrite(8, HIGH); delay(50); digitalWrite(8, LOW); delay(50); // this is the second blue LED without any resister digitalWrite(12, HIGH); delay(100); digitalWrite(12, LOW); delay(50); // again add smoothing transition effect digitalWrite(7, HIGH); delay(50); digitalWrite(7, LOW); delay(50); digitalWrite(8, HIGH); delay(100); digitalWrite(8, LOW); delay(50); digitalWrite(7, HIGH); delay(100); digitalWrite(7, LOW); delay(50); digitalWrite(8, HIGH); delay(100); digitalWrite(8, LOW); delay(50); digitalWrite(7, HIGH); delay(100); digitalWrite(7, LOW); delay(50); digitalWrite(8, HIGH); delay(100); digitalWrite(8, LOW); delay(50); digitalWrite(7, HIGH); delay(100); digitalWrite(7, LOW); delay(50); digitalWrite(8, HIGH); delay(100); digitalWrite(8, LOW); delay(50); digitalWrite(7, HIGH); delay(100); digitalWrite(7, LOW); delay(50); // continuous blink ends // now do a bit delayed lighting creating another effect digitalWrite(8, HIGH); // LED on 8 ON delay(1000); // wait time prolonged digitalWrite(8, LOW); // LED off delay(50); // wait time digitalWrite(7, HIGH); // LED on 8 ON delay(1000); // wait time prolonged digitalWrite(7, LOW); // LED off delay(50); // wait time // give the second blue LED a shorter time to light up digitalWrite(12, HIGH); // LED on 8 ON delay(100); // wait time digitalWrite(12, LOW); // LED off delay(50); } |