Notice: Click on the Disclaimer button prior to taking any action shown on this website.
SPECIAL NOTICE TO EUROPEAN UNION (EU) AND CALIFORNIA (CCPA) VIEWERS

RV-Project.Com does not use cookies. However, third party ad banners found on this site and other functions may use cookies to provide advertisement. If you do not agree with this, please turn off the cookies function in your browser or opt out by not using this website. If you continue to use this website, you agree to the use of cookies.

 

Automation Board Construction.


Automation Board - Option 2 (RGB Version).

 

The "brains" of the automation board is an Atmel ATTiny85 Microcontroller - yes, an embedded computer. Some characteristics of the microcontroller are:

  • 1-20Mhz Operation
  • 521b RAM
  • 512b EEPROM
  • 8kb Flash Memory

That's "b" as in bytes. While not nearly as powerful as the controller even in your cell phone, it is powerful enough to do the job. Perhaps though the best attribute of the microcontroller is it's low power consumption. We will be running the controller at 1Mhz and 3.3VDC, which results in a 1mA consumption. We could go even lower, but with the 2000mAH battery we will be using, this device can run for 83 days! Of course, that is in standby mode - i.e. in the daytime without the LEDs active.

Programming note. The Atmel ATTiny85 must be programmed by the end user (you) for the board to function properly. Programming is not as difficult as you may think, and in fact, I have made the written program available so all you have to do is download it. You can use it as-is, or you can try your luck at programming and make changes as you see fit. The link below contain all of the instructions you will need.

 

 

Theory of Operation

 

 

This board can be made as a RGB or Monochrome (single color) board. You will need to decide which option you want. Option 1 is for the Monochrome version and Option 2 is for the RGB version. Option 1 provides up to 16 different flash patterns that you can program, while Option 2 is limited to 4 patterns. For this reason, Option A can be used with Option 2 to extend the number of patterns by allowing the pattern to be changed each time you depress the switch. This can provide an endless number of flash patterns - up to the memory limits of the ATTiny85.

Outputs:The Atmel ATTiny85 is configured (by the programming) so that Pins 5, 6, and 7 are outputs (if using Option 2), and they actually drive the LEDs. The three outputs are connected to the Red, Green, and Blue leads of the LED strip. If using Option 1, only Pin 5 is used as an output, and Pins 6 and 7 are used for additional switch (flash sequence) selections.

Since the output channels of the ATTiny85 are limited to a few mA at 3.3V, output transistors are used (Q1, Q2, and Q3) that not only power the LED strips at 9.6V, but also can provide up to 800mA of current to the LEDs, which is sufficient for the 3ft LEDs.

 

Note:

Each output (whether monochrome or RGB) is limited to 800mA. Exceeding this limit may damage the board. In addition, you may need to heat sink the transistors to achieve 800mA.

Typically, a 3ft SMD3528 RGB strip should not exceed 70mA which is well within the design parameters of the board, and should not require heat sinking of the transistors.

If using the board for different projects, ensure you do not exceed the output current capability of the board.

 

 

Inputs: Pins 1, 2, 6, and 7 (Option 1) or Pins 1 and 2 (Option 2) are used for inputs. They read the switch position of the DIP switch, and select the proper flash pattern. The binary system is used here, which provides 2x selections per position. In other words, a single switch will provide 2 states, two switches, 4 states, 3 switches = 8 states, and 4 switches = 16 states. Therefore, 2 switches (Option 2) will provide 4 different flash options while 4 switches (Option 1) will provide up to 16 different patterns.

The resitsors R6, and optionally R9, and R10 are known as "pull up" resistors and ensure a Logic 1 value is presented to the ATTiny85 when the switches are off, and a Logic 0 value when they are closed.

Resistor R4 and R5 are a special condition. Normally the ATTiny85 reserves Pin 1 as a reset pin, and if a Logic 0 is applied as it is done with the other inputs, the microcontroller will be continuously reset, and no operation will be possible. However, by treating this input as an analog input, and selection of the resistor values as shown, we can change the input enough that the ATTiny85 can detect the switch position, yet not enough to reset the microcontroller. Again, this is setup in the programming.

 

Note:

Realize that Pins 6 and 7 are used for different purposes depending on Option 1 or Option 2. This is due to the limitation of the number of pins available on the ATTiny85.

Therefore, you can only select one option or the other, and in fact, you must omit the components for the unused option. For example, if using Option 2, you must omit R9, R10, and two positions of the switch. Similarly, if you use Option 1, you must omit R2, R3, Q2, and Q3.

 

Pin 3 is also setup as an analog input, and reads the voltage on the photocell. In bright light conditions, the photocell's resistance will be less than in low light conditions. So when coupled with R8, the voltage on the photocell will decrease in the daytime and increase at night. The ATTiny85 can detect this for dusk-to-dawn operation. R8 is a potentiometer (variable resistor), and it's function is to calibrate at which point the photocell trips the automation. If the automation starts when it is too bright, then turning R8 one way will cause the photocell to trip in lower light. And turning R8 the other way will increase the trip point.

 

 

 

It should be pointed out that the selection of R8 is highly dependant on the photocell being used. I strongly suggest using the photocell available in the Bill-of-Materials list, as I selected R8's value for this photocell. If you use a different photocell, you may find you will need to either change R8 to a different value, program a different threshold value into the ATTiny85, or both.

Power Supply: U2 and C1, C2, and C3 are the power supply for the board, and provide a regulated 3.3VDC @ 100mA to power the ATTiny85. The ATTiny85 can operate from 1.8 to 5.5V (depending on version), and 3.3V is sufficient for proper operation and low power consumption.

Basic Operation: The ATTiny85 will monitor the photocell's value once per second. If the photocell is properly adjusted, at dusk, the photocell's value will trip the threshold of the input pin causing the ATTiny85 to go into active mode and flash the LEDs in accordance to the sequence selected by the switch, and programmed into the microcontroller. This pattern will continue until the timer has expired (one, two, or four hours) as programmed into the microcontroller, or until the photocell detects dawn has arrived. In reality though, since you can program any sequence or delays into the microcontroller, an almost endless pattern can be created.

 

Parts

First and foremost, you need a printed circuit board. I used OSH Park to custom make my boards, and you can purchase your boards there by clicking on the button to the right. I say boards as they have a 3 board minimum. However, the total cost of the three boards was around $15 including shipping, which results in each board being around $5 each. You can either give the other two boards to someone else, make gifts, or use the other two for similar projects.

Anyway you look at it - you probably won't find a cheaper source. However, if you like, I have included a link to the Eagle file I used to create the boards. You can download this file and make any changes you desire.

Order from OSH Park

or make your own:

Once you have the board, you will need a source of parts. I have located all of the parts from a great supplier: Tayda Electronics. They are located in Colorado, USA and ship domestically. The total cost for these items should be just under $5. Tayda does have a $5 minimum, so look around, you might find something else to buy - or perhaps you may want to buy a couple of spare parts.

I had considered making a limited run "kit" consisting of the printed circuit board, the components, and a pre-programmed ATTiny85, however, my license for use of the printed circuit board software is restricted to non-commercial use only.

 

Bill of Materials

SymbolItemOption 1 QtyOption 2 Qty
U1 Atmel ATTiny85 Microcontroller11
U2 78L33 3.3V Voltage Regulator11
C1, C2 10uf 25V Elecrolytic Capacitor22
C3 0.1uF Ceramic Capacitor11
PH1 KE10720 PhotoCell11
R1, R2, R3, R6, R9, R10 10K 1/4W 1% Metal Film Resistor (Pack of 10) 11
R4 22K 1/4W 1% Metal Film Resistor (Pack of 10) 11
R5 33K 1/4W 1% Metal Film Resistor (Pack of 10) 11
R7 1K 1/4W 1% Metal Film Resistor (Pack of 10) 11
R8 100K Trimmer Potentiometer11
Q1, Q2, Q3 BC338 NPN Transistor13
SW1 4 position DIP Switch10
SW1 2 position DIP Switch01
J1 2 position 5mm Terminal Block11
J2 2 position 3.5mm Terminal Block12
N/A 8 pin DIP Socket11
N/A 10" Heat Shrink Tubing11

Note on quantity. The resistors come in a pack of 10. The Quantity needed columns for Option 1 and Option 2 reflect the number of items required when ordering, not necessarily how many items used per option. For example, 4ea 10k resistors are required for both Option 1 and Option 2, however, only qty 1 needs to be ordered as they come in a pack of 10.

 

 

 

Finally, you will need a way to program the ATTiny85. The best little programming board I have found is from Sparkfun Electronics, called the Tiny AVR Programmer available HERE . You can also buy one from Amazon. It costs around $20, it is already built, and more details on how to install the drivers and other details will be provided on the programming webpage.

While this is an additional cost, keep in mind that you can program thousands of ATTiny85s with this board. And since I have at least one additional RV project in the works using the ATTiny85, it might be a worthwhile investment.

There are other options you can use to program the ATTiny85, including using an Arduino Uno , and a quick search on the internet will provide several options. However, I have had tremendous success using the Sparkfun board.

Advertisement

 

Construction

 

Construction is primarily populating the circuit board with the proper components. This is typically done step-by-step inserting a few components at a time, then inserting them. If you have never soldered before, I would recommend practicing a bit.

You can buy solder-practice kits - sometimes available with a soldering iron and a bit of solder. I would recommend a soldering iron around 25W.

I have used an inexpensive Weller WLC100 for the last 5yrs and can be adjusted from 5W to 40W.

There are several YouTube videos on how to solder, so I will not replicate that video here.


Advertisement


 


Parts Locator and Polarity Orientation

 

Reference part on the Bill-of-Materials and install as shown on the Parts Locator above. Pay attention to orientation and polarity for the transistors (Q1, Q2, Q3), ICs, (U1 and U2) and Electrolytic Capacitors (C1 and C2). No other parts are polarity sensitive and can be inserted either way.

When you are done, if you built Option 1, there should be no resistors in R2 or R3, no transistors in Q2 or Q3, no connector in the left side of J2, and a 4 pole switch S1. If you built Option 2, there should be no resistors in R9 or R10, and S1 should be a 2 pole switch with the switch located at the top (the bottom 4 holes should be open).

With these exceptions, there should be parts in every location.

For C1 and C2, the Negative Stripe should be to the Left when the board is oriented as shown. The flat spots for Q1, Q2, and Q3 should be pointed up, and the flat spot on U2 should be pointed down. The dimple in the socket for U1 should be pointed up.

Resistor values - especially metal-film, are sometimes hard to read as their marking colors may fade easily. As well, the color bands seem to rub off easier than carbon-film resistors.

It is often advantageous to keep the resistors in their packaging for easy location (if you buy them from Tayda Electronics, they will come in individual pouches).

ValueMetal FilmCarbon Film
33KOrange-Orange-Black-RedOrange-Orange-Orange
22KRed-Red-Black-RedRed-Red-Orange
10KBrown-Black-Black-RedBrown-Black-Orange
1KBrown-Black-Black-BrownBrown-Black-Red

 


Project Video.

 

References:

Order the Circuit Board Here OSH Park.Com
Download the Circuit Board Eagle File Definition file for the LED Automation circuit board (make your own).
Download the Eagle Circuit Board Designer Free for non-commercial use (limited features).
Tayda Electronics Parts resource.
Thaishine Tayda Electronics eBay store.
Eagle Tutorial Useful Tutorial if you want to learn how to use Eagle.
AVR Tiny Programmer Source for the ATTiny85 Programmer.
Installing and using the AVR Tiny Programmer How to use the ATTiny85 Programmer.

 

 

 

 


Last reviewed and/or updated June 14, 2025