Customizable Arduino Nano LED Candle (2 - 6 LEDs) 3D model preview
View source Save
0 downloads 2 likes 3,551 views Paid price

About this 3D model

A simple Arduino Nano LED candle for 2 to 6 LEDs. This design is completely free and shared under a permissive license. Your support is hugely appreciated. Did you know? Some of our designs cannot be found on MyMiniFactory. If you are looking for more, check out our premium projects: https://codeandmake.com/premium You will need Tools A computer with Arduino IDE installed and a mini USB cable. Soldering iron, solder and flux. Hot glue gun and glue. Wire cutters/strippers. Materials 9v battery. 9v battery connector. 2 - 6x LEDs (a mixture of red, yellow and/or orange work best). 2 - 6x appropriate resistors for your LEDs (use this calculator or 220 Ohm resistors if unsure). A small amount of thin wire (~26AWG) (ideally in two colors; positive and negative). Heat shrink. Liquid electrical tape (or standard electrical tape). Cable tie (optional). Building Printing 1. Customize the .SCAD file using OpenSCAD or use the .STL files.1. Print it - I recommend using a light filament (e.g. yellow or white) for the base and mount pieces and clear filament for the diffuser. Wiring Use the included wiring diagram as a reference. If you are new to soldering, please see my tutorial which demonstrates how to solder an Arduino Nano. The tutorial shows how to solder pin headers to your Arduino Nano. You should not need to use pin headers for this project, you can solder wires directly to the board instead. However, you may still find this tutorial useful. Insert the LEDs into the LED mount with the negative (-ve) legs towards the center of the LED mount. Solder the negative legs of the LEDs together. Depending on your chosen configuration and LEDs you may not need wire for this step. The legs may be long enough to solder them together directly. Solder resistors to each of the positive (+ve) legs. Solder a short length (4 - 6") of your negative color wire to one of the negative LED legs. Solder short lengths (4 - 6") of your positive color wire to each of the resistors. Place some heat shrink over each of the positive legs and resistors so that no positive terminals are exposed. Use your soldering iron to shrink the heat shrink, being careful not to touch the LED mount with the soldering iron. I do not recommend using a heat gun. Solder the negative LED wire and the negative wire of the 9v battery connector to the `GND` pin(s) of the Arduino Nano. You can twist and join them or solder them to separate `GND` pins. Solder the positive wire of the 9v battery connector to the `VIN` pin of the Arduino Nano. Solder the positive LED wires to pins `D3`, `D5`, `D6`, `D9`, `D10` and/or `D11`. If you have fewer than 6 LEDs, use fewer pins. Coding Here is the code. Save this in a file called `codeandmake.com_Arduino_Nano_LED_Candle.ino`: /* * Copyright 2020 Code and Make (codeandmake.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. *//* * Simple flickering candle effect using up to 6 LEDs. * * This code accompanies the following Thingiverse project: https://www.thingiverse.com/thing:4113149 *//** * PWM Pins on Arduino Nano are 3, 5, 6, 9, 10 and 11 * See: https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/ */int ledPins[] = { 3, 5, 6, 9, 10, 11 };/** * Set each pin as an output */void setup() { for (int i = 0; i < sizeof(ledPins) / sizeof(int); i++) { pinMode(ledPins[i], OUTPUT); }}/** * Set random values for each pin */void loop() { for (int i = 0; i < sizeof(ledPins) / sizeof(int); i++) { analogWrite(ledPins[i], random(10, 255)); delay(random(10, 20)); }} If you haven't already, install Arduino IDE and configure it ready to program your Arduino Nano. Please see my tutorial for installing the Arduino IDE in Ubuntu and configuring it for an Arduino Uno. The steps will be similar for the Arduino Nano and other operating systems. Connect the Arduino Nano to your computer via USB. Open the code file (`codeandmake.com_Arduino_Nano_LED_Candle.ino`) in Arduino IDE. If you used fewer than 6 LEDs, remove any unused pins from th