TV Light Effect

After seeing Bruce Kingsley’s Arduino-animated HO scale house in the April 2016 issue of Model Railroader, which includes a flickering TV screen in a dark room as one of its many effects, I decided to try writing my own TV-flickering code for the Arduino, and ended up with what I think is a slightly more realistic effect. Using a cool-white LED to simulate the glow of a black and white TV, the code creates the effect by changing the brightness to various levels at various time intervals, within preset ranges, in two different ways.

The majority of the flickers are sudden changes from one level of brightness to another, simulating the light effect of moving images and cutting from one camera to another. The length of time between changes varies each time from between 400-1,000 milliseconds (.4 seconds to 1 second). The levels of brightness are randomly chosen each time, from a range of 25-75, on a scale where 0 is off, and 255 is the brightest level possible.

The flicker effect alone, however, looks a little more like the light of an endlessly flickering flame than the light of a television broadcast. For more realism, I needed to include …

Continue Reading →