About Me

My photo
They never fall who never climb.

006 MICROPROCESSOR CONTROLLED LED FADE IN & OUT


006 MICROPROCESSOR CONTROLLED LED FADE IN & OUT

JANUARY 23, 2011    (See also Companion Blog )
[Go BACK to Table of Contents] [ Next Experiment ] [ Last Experiment ]

           This circuit represents my first “thought out” project, as I could not find the corresponding schematic. Here is the schematic, which focuses on matching what the wiring actually looked like rather than for neatness. My intention centered on the code, not the electronics. Sketch is A100414_03FadeLEDinout.pde. Schematic is Components.xls Worksheet 006. See, I’m learning.



Theory:
          The diode should fade in and out rather than blink. The code contains a loop that counts up and down from 0 to 255, using this counter as a variable to determine the voltage (I think it is voltage) to the LED, shown here as an ordinary diode. By changing code values, the fade should be controlled in a variety of settings.

Practice:
           A perfect operation. My mental spotlight was on the code, but that is expected. Once the predicted fade was accomplished, I changed the code to find approximately twenty patterns which I would rate as ranging from pleasing to annoying. A little practice with the board reset button shows the code always begins from the programming loop, not the position where it left off.

           There are a variety of coding options that produce the same net effect, I won’t go into it. There is far more flexibility in the code than in the circuit wiring. That’s an important lesson.
           This circuit also taught me that, for now anyway, the power that operates the components must come totally from the Arduino board, as the signals control the power and nothing else. An external source won’t work. For now. I found a drawer full of old but matching power transformers, which were used to test and prove the Arduino has a non-volatile memory (the code stays put when the power goes off). The unit is also very tolerant of voltages at least up to 9V.

Conclusion:
          These trials are critical to the understanding of how the interface between code and component must operate. It is not always a direct cause and effect, as subtle differences are always appearing. As an example, set the delay between the counts (0 to 255) to zero milliseconds and watch what happens to the LED. There are too many subtle facets to write down, you must perform these experiments yourself to get the full benefit.

Go BACK to Table of Contents