Skip to main content



Lights for cheap with Arduino

Hello folks,

just recently I have finished my lights setup, so I thought I could share how I did that.

Secret tip: on ebay you can get a pack of LEDs for a ridiculously low price, which will probably last you for the rest of your life.

Behind the code If you have noticed, there is a magical formula named "PWM" in the comments of our code. This is also the reason we are not using any resistors, which would normally be necessary.

I am not going to explain this further (you can google 100 times better sources on this in 5 seconds), but for our purpose, you can think of it as a brightness switch for our LEDs.

Basically what it does, is, that it blinks your LEDs so fast, you brain sees them shine. The ratio of time when the LEDs are on to the time they are off is how much they shine. So for your eyes, the output is the same, as you would get from variable resistor.

The command analogWrite(5,20); means, we are using Arduino's digital pin 5 and we are setting the brightness to 2…

Latest Posts

Sunday evening on track

What is it like owning a RWD Sakura D4