Model Scenery Tutorials

A Comprenshive Modeler's And Model Railroader's Guide

model scenery center

How to fade LED lights on and off.

What’s In This Page

A tutorial including Arduino sketches, wiring diagrams and video demonstrations of fading lights on an off.

If you are using a phone, at the bottom of the page there are links to many  supplies for modelers. Otherwise those links are in the sidebar to the right. You can also find other information  by using the search function that is in the navigation bar above.

Also In Addition To What’s In This Page, What This Site Can Do For You

If you are a model train enthusiast, modeler, diorama maker, or interested in making Arduino projects the easy way, there is categorized information for you here. Click Here.

The Latest Information

Anything new and page updates are posted on Twitter (now X) and Facebook.

It is easy to keep up with the latest by following us on either of them.

Circuit Board.

This image shows the circuit board that we use to fade lights on and off. The program resides on an Arduino mini pro. In this setup there are 6 LEDS.

There are 6 because in order to fade lights, the lights must be connected to PWM pins.

On an Arduino,Mini Pro, Nanao and Uno, there are only 6 PWM pins.   So generally speaking, you are limited to fading only 6 lights via one of these boards.

There is, however, a workaround that you can use. Each pin can pass 40 ma on any one pin. So you can measure the current your LEDS are passing and connect more than one LED to each pin.  You must not exceed the 40 ma per pin and must remain below the 400 ma total board capability.  For safety sake, it is best to stay well below both those margins.

Free Help

We will answer your questions and

The Circuit Board Explained

The fader is made by connecting the LEDS to pins  3, 5, 6, 9, 10, 11 on a Utility board. Instructions for making the board are here.

You can get a kit to make such a board here.

As you note from the image, you can make your own board using a prototype board and components that you gather.  If you do it that way the time cost spent on making the board will be may times the cost of the kit. And the quality of the end product will not be equal. We recommend that you get a kit.

The Arduino Code To Fade Lights

The lights fade up and fade down when pin A2 goes HIGH or low. You can control that with a switch or an event timer. The videos below show the lights being controlled by an event time.
The program allows you to change the times it takes to fade your lights on and off.
Download it here.

Video Tutorial

These video show the sketch in action.
VIDEO 1 TO BE ADDED.
Diorama Lighting
Click on the image to watch the video.

Feedback

Your questions and comments help us clarify and upgrade the information presented.  Even if you find this helpful, please tell us.

Please let us know if this page has been helpful  And if you have questions or suggestions, use this spam free system.

Or use the green WhatsApp button that is to the right.

Questions, Comments, Help

If you have questions, comments or need help using this sketch or animating your own diorama or train layout scene, contact us by email or use our Facebook messenger at ModelSceneryTutorials.

 

Scroll to top