
|
|
![]()
I originally constructed three different dimmer boards - a High Side, Low Side, or Combo High/Low. The Combo High/Low Side dimmer is perhaps more flexible, but requires extensive SMD (Surface Mount Device) soldering, which is beyond the capability of many hobbyists. The High and Low side boards use thru-hole components, and are easier to construct. Other than the connection method of the LED to the dimmer, the functionality of all three boards are identical. Since the High Side board will work with all LED configuations, that is the one that will be built. If you desire a Low Side board, use the link below.
Due to the cost of the circuit board and potting compound (which will provide more than enough material for 3 boards, the boards end up costing around $25 each, so they are not out of line with commercial dimmers (which cost between $10 and $60). Even when you add the $25 or so for the programmer and a few more dollars for the peripherials (Remote Control Wireless Transmitter, switches, etc), you are still within the cost range of a less capable commercial dimmer. Since the construction video and documentation package provide adequate information about building the dimmer, I will not replicate that information here. Feel free to drop an email to RV-Project.com should you have any questions,
In order to program an ATTiny85, you need to accomplish a few tasks. First, you need to download the Arduino IDE (Integrated Development Envrionment), which is a fancy way to say the interface software for these microcontrollers. It is essentially the programmer. Ardunio is one of the public domain companies that was instrumental in the growth of microcontrollers for hobbyists, and their IDE is a free download.
At this point, if you were able to get the LED blinky program to work (from the Arduino IDE Setup Guide), you are ready to continue. If not, YouTube has many videos on installing the Arduino IDE, and adapting it for the ATTiny85. Some of these resources are very good, so it is not necessary to replicate that information here. You will also need to download the Sketch, which is the program for the ATTiny85 MicroController, and contains all of the necessary instructions for the MicroController to function properly.
A few items of interest:
This section sets the various intervals for the different timer modes. The current setup is for one, two, or four hours. Also, there is a reference line for eight hours. By simply replacing the interval on one of the above lines with that value, the time delay for that mode can be changed. The time delay values are in mS (MilliSeconds). Therefore 28,800,000 is the time delay in mS. Divide by 1000 to obtain seconds; 28,800. And since there are 3,600 seconds in an hour, dividing 28800 by 3,600 equals 8 hours. Note that you must not use commas in the program.
The default PWM frequency for the timer is 500Hz. If required to drive a specific LED, you can change the frequency according to the values shown. However, be absolutely sure you need to do this as the delay mechanism will not function properly. The same timer that controls the PWM frequency controls the delay, and by changing the timer, both are changed.
The first line is the logarithmic function for the dimmer. The second line is the linear equivalent. The value of A1 will be 0-1023, which is the Analog-to-Digital conversion of the voltage set by the dimmer potentiometer.Feel free to experiment as needed.
|