3D Printing Pelita Raya


Since it’s dangerous to use a real 🔥 to light up the Pelita at my house, I decided to print a Pelita Raya using a 3D printer and add an LED. The LED is programmed to look like a real candle🕯


Watch this video to know more about it.

Hardware Preparation

This is the list of items used in the video.

const int LED = 10;
long random_led;
long random_time;
int difer_time();
void setup() {
pinMode(LED, OUTPUT);
int min_led = 200;
int max_led = 1024;
void loop() {
random_led = random(min_led, max_led); // random number to shine led
random_time = difer_time(random_led); // convert strength to time
analogWrite(LED, random_led); // set LED to value PWM
delay(random_time); // set delay depending of the strength
int difer_time(int s){
int a, b, wait;
b = map(s, min_led, max_led, 1, 100); // remap strength to 100%
// 3 stages of random speed. If more light then longer delay
if (b > 80){
wait = random(80, 100); // max strength
else if (b > 20 && b < 60){
wait = random(20, 80); // midle strength.
wait = random(1, 20); // led almost turned of, time very short.
return wait;

view raw
hosted with ❤ by GitHub


  1. Candle LED Light Up

Thanks for reading this tutorial. If you have any technical inquiries, please post at Cytron Technical Forum.

Please be reminded, this tutorial is prepared for you to try and learn.
You are encouraged to improve the code for better application.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

BLTouch Installation for Ender 3 with 32-bit V4.2.2 Board
Pick and Send Random Meal’s Option and Locations through Telegram Bot Using Grove WiFi 8266 on micro:bit
DIY Automated Vacuum Cleaner Using REKA:BIT With Micro:bit
Rainbow Spark in Mini House using Maker Uno.
TinyML on Arduino using Edge Impulse
Tutorials of Cytron Technologies Scroll to Top