ATTiny Reliability 240816

Thread Starter

allenpitts

Joined Feb 26, 2011
182
Hello AAC forum,

For about a year, beginning in 2021,
a 555 timer was used to receive
a signal from a PIR and saturate
a transistor that turned on four
twelve-volt LEDs to light a closet,
staircase or other small space.

After a few months it was noticed
that about a quarter of the installations
were failing. Either the LED would not come
or, in the greatest number of cases,
the LEDs would come on but not go off.

Research pointed to the failing
component being the capacitor in
the capacitor-resistor pair that
governed the high output of the 555
in monostable, one-shot mode.
The failure was greater in units that had an
infrequent usage. Counter intuitively,
units that were used several times a day
failed less often than units that
were used once or twice a month.

To overcome the 555 capacitor failure
it was suggested that a microprocessor
be substituted for the 555. Several
Arduino-IDE-compatible microprocessors
were evaluated: DFRobot DFR0282 $8.90,
Seeed Studio XIAO SAMD21 $5.40, and the
ATtiny85 $1.66.

Besides being more precise in timing,
microprocessors allowed for the time
allowed for the time that the LEDs
stayed on to be changed by reprogramming
instead desoldering and changing
components.

Despite the need for an ATtiny programmer
to get the ATtiny 85 connected via
USB to the Arduino IDE, the size
and price of the Tiny were the
deciding factors.

Now two of the ATtiny85 units are failing.
Because the ATtiny85 is the heart of
the closet light the MC was tested first.

When the ATtiny85 became an integral part
of the closet units an ATtiny Tester
was developed schematic and layout
on prototype PCB attached herewith.

When the ATtiny was pulled and
reprogrammed with the ATtiny Tester Sketch,
attached below.ATtiny_tester_5_LEDs_230811.jpg


ATtiny_tester_on_Datak_21_114_230812.gif
When the Tiny called Mark3 was tested
it returned results that were unexpected.
Tests results copyed herewith below.
Three MCs were tested: Mark3, MarkB
and MarkC. Mark3 resulted in high
output much shorter than expected.

Tests of the MarkB MC were more in line
with expected results. To confirm that
the 8 MHZ was the correct Internal Clock
setting tests were performed on the
MCs using 1 MHZ and 16 MHZ clock settings.

To confirm that the MarkB results
were correct a new, out-of-the-box
MC, MarkC was tested. The results
of the MarkB and MarkC tests point
to the Mark3 unit being a failed
component.

The question is: How reliable are
the ATtiny85 MCs? Would going to
one of the other Arduino compatible
MCs improve the reliability?

Thanks.

Allen Pitts


Code:
/*
240816
Processor ATtiny85
Programmer USBTinyISP
 Compiled this sketch at Internal Clock 8 MhZ: LEDs blink at 5 second on and .5 second off
 Compiled this sketch at Internal Clock 16 MhZ: LEDs blink at 8 second on and 2 second off
 Compiled this sketch at Internal Clock 1 MhZ: LEDs blink at 1 second on and imperceptible off

  ATtiny Tester 230811
  Turns on an five LEDs on for one second, then off for one second, repeatedly
  as  a test of the microcontroller. If the internal clock is set to 8 MHZ
  the D1 LED blinks at 9 seconds on and 4 seconds off.
 */

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 4 as an output.
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(0, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(0, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second

  digitalWrite(1, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(1, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second

  digitalWrite(2, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(2, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second

  digitalWrite(3, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(3, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second

  digitalWrite(4, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(500);            // wait for a second
  digitalWrite(4, LOW);   // turn the LED off by making the voltage LOW
  delay(100);            // wait for a second

}
Test Results. Three MCs, Nine tests each

Mark3 ATtiny 85

16 Mhz 1.1 sec on; imperceptible off
8 Mhz .6 sec ; imperceptible off
1 Mhz .1 sec ; imperceptible off
16 Mhz 1 sec ; imperceptible off
8 Mhz .7 sec ; imperceptible off
1 Mhz .06 sec; imperceptible off
16 Mhz 1.1 sec; imperceptible off
8 Mhz .8 sec; imperceptible off
1 Mhz .12 sec 8.; imperceptible off

MarkB ATtiny 85
16 Mhz 8.1 sec ON, 1.6 sec OFF
8 Mhz 4.1 sec ON, .8 sec OFF
1 Mhz .7 sec ON, imperceptible OFF
16 Mhz 8.1 sec ON, 1.2 sec OFF
8 Mhz 4.1 sec ON, .7 sec OFF
1 Mhz .7 sec ON, imperceptible OFF
16 Mhz 8.0 sec ON, 1.4 sec OFF
8 Mhz 4.0 sec ON, .7 sec OFF
1 Mhz .7 sec ON, imperceptible OFF

MarkC ATtiny 85
16 Mhz 7.9 sec ON, 1.5 sec OFF
8 Mhz 4.0 sec ON, .7 sec OFF
1 Mhz 8.1 sec ON, imperceptible OFF
16 Mhz 8.0 sec ON, 1.4 sec OFF
8 Mhz 3.9 sec ON, .8 sec OFF
1 Mhz 8.1 sec ON, imperceptible OFF
16 Mhz 7.9 sec ON, 1.2 sec OFF
8 Mhz 3.8 sec ON, .7 sec OFF
1 Mhz 8.1 sec ON, imperceptible OFF
 

MrChips

Joined Oct 2, 2009
34,629
Are you using the internal RC oscillator as a time-base?
If yes, then examine the precision required for your application.
I designed a self-clocking serial interface that did not require exact timing. The MCU used the internal RC oscillator,

In most cases, you can get reliable timed procedures by using an external quartz crystal,
 

Jerry-Hat-Trick

Joined Aug 31, 2022
777
For another thread on this forum I tested an ATtiny85 with delay(900000); to set a timer for 15 minutes and was astonished to find that the error was less than three seconds. Certainly far better than you would ever get with a 555.

Whilst I can’t explain the.results of your tests, except perhaps if you are trying to drive too much current through the processor, if your requirement is to turn on all the LEDs together, better to drive a single transistor on from a single output with the LEDs in series with their respective series resistors connected between the 12V rail and the transistor collector.
 

DickCappels

Joined Aug 21, 2008
10,661
ATTiny controllers have been very reliable in my use over the years. These included ATTINY25/45/85.

I noticed that your diagram does not show any pull-up resistor on the reset input of any power supply bypass capacitor, either of which could lead to undesired operation.
 

Thread Starter

allenpitts

Joined Feb 26, 2011
182
Hello MrChips, Jerry_Hat_Trick, DickCappels, sagor and the AAC forum,

It has taken a while to get back to this post because an out-of-state
wedding was attended last weekend.

230819.1 MrChips
Are you using the internal RC oscillator as a time-base?
....reliable timed procedures by using an external quartz crystal,
Yes, the internal RC oscillator is being used. The time precision
required by the system (plus or minus 10 or 15 seconds) probably
does not justify an external crystal.
How much time is spent when a closet is entered to pick out a shirt
or suit? So the high signal is sent for more time than
one would estimate, say two or three minutes, and the time
need not be that precise.

240819.2 Jerry_Hat_Trick
...better to drive a single transistor on from a single output with the LEDs in
series with their respective series resistors connected between the 12V rail and the transistor collector.
I believe the schematic, attached herewith, shows a system very similar to
the one described:
P5L_220923_schematic_black_230415.jpg
P5L_220923_schematic_black_230415.jpg

Note: There are no limiting resistors required for the load LEDs
D2 - D5 because they are 12 volt automotive back up lights that
have circuitry in the lamps.
3W 12V BA15S S8 SC Bayonet Single Contact Base 1156
LED Light Bulb 2700K Warm White,Low voltage AC/DC 12volt
https://www.amazon.com/Bayonet-Cont...hvlocphy=&hvtargid=pla-4583520386391595&psc=1

240819.3 DickCappels

Added by pass capacitor as shown in revised diagram.
ATtiny_tester_on_Datak_21_114_240819.gif

Not sure where the pull-up resistor should go or what
the function of pull-resistor is.

240819.4 sagor

Added by pass capacitor as shown in revised diagram.


Thanks.

Allen Pitts
 

be80be

Joined Jul 5, 2008
2,394
You need to pull up reset with a 10 to 15 k resistor to VDD the way it looks you have it at ground not what you want if the chips going to run right
 
Top