
XMAS tree with Arduino controlled leds.
thingiverse
An Xmas tree in OpenSCAD can be found on https://www.thingiverse.com/thing:1214464/files. The holes were modified to accommodate 14 LEDs. The OpenSCAD file is attached for further modification. The hole diameters are 50% of the actual LED diameter, which measures 5mm. When the print is scaled up by 200%, it still fits on a 20x20 cm bed, and the LEDs fit into the holes perfectly. An Arduino Nano controls the open collector outputs of two ULN2003 ICs. The following Arduino sketch serves as a good starting point for programming the LEDs. The LEDs are wired to resistors: Red with 150 Ohms, and Green, Blue, White with 56 Ohms each, for a 5-volt power supply. Here's the code: ```c int L0 = 0; int L1 = 1; int L2 = 2; int L3 = 3; int L4 = 4; int L5 = 5; int L6 = 6; int L7 = 7; int L8 = 8; int L9 = 9; int L10 = 10; int L11 = 11; int L12 = 12; int L13 = 13; int t=20; void setup() { pinMode(L1, OUTPUT); pinMode(L2, OUTPUT); pinMode(L3, OUTPUT); pinMode(L4, OUTPUT); pinMode(L5, OUTPUT); pinMode(L6, OUTPUT); pinMode(L7, OUTPUT); pinMode(L8, OUTPUT); pinMode(L9, OUTPUT); pinMode(L10, OUTPUT); pinMode(L11, OUTPUT); pinMode(L12, OUTPUT); pinMode(L13, OUTPUT); } void loop() { digitalWrite(L0, LOW); delay(t);digitalWrite(L0, HIGH); //star led digitalWrite(L1, HIGH); delay(t);digitalWrite(L1, LOW); digitalWrite(L2, HIGH); delay(t);digitalWrite(L2, LOW); digitalWrite(L3, HIGH); delay(t);digitalWrite(L3, LOW); digitalWrite(L4, HIGH); delay(t);digitalWrite(L4, LOW); digitalWrite(L5, HIGH); delay(t);digitalWrite(L5, LOW); digitalWrite(L6, HIGH); delay(t);digitalWrite(L6, LOW); digitalWrite(L7, HIGH); delay(t);digitalWrite(L7, LOW); digitalWrite(L8, HIGH); delay(t);digitalWrite(L8, LOW); digitalWrite(L9, HIGH); delay(t);digitalWrite(L9, LOW); digitalWrite(L10, HIGH); delay(t);digitalWrite(L10, LOW); digitalWrite(L11, HIGH); delay(t);digitalWrite(L11, LOW); digitalWrite(L12, HIGH); delay(t);digitalWrite(L12, LOW); digitalWrite(L13, HIGH); delay(t);digitalWrite(L13, LOW); } https://youtu.be/VYAfNfvDHbo ```
With this file you will be able to print XMAS tree with Arduino controlled leds. with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on XMAS tree with Arduino controlled leds..