I have a uno that I have been using for 3 years now. I will be using it again in a rather critical project in which failure on the part of the board could be rather expensive and dangerous. So, I would like to be sure that the board is not approaching end of life or going to fail anytime soon. Is there any reliable way to figure out how long the board will function without failing or reduction in performance?
-
"failure on the part of the board could be rather expensive and dangerous". Define expensive and define dangerous. Maybe an Arduino is not the best fit for your application, maybe you need to design in a fail safe mechanism. – jippie Feb 12 '14 at 06:15
-
@jippie Think small UAVs and/or other small to medium robots. – asheeshr Feb 12 '14 at 06:20
2 Answers
Unfortunately, there isn't much way to really determine "wear" in the context of solid-state electronics.
Probably the things that are most likely to fail are the electrolytic capacitors and the connectors.
First, if you're using an ATmega CPU for something that could possibly injure someone CONTACT ATMEL AND TALK ABOUT SAFETY PRECAUTIONS. The ATmega CPU used in most of the arduino models is not rated for use in such situations.
In EVERY datasheet:
Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.
Now, realistically, this is probably mostly lawyer repellent, but you should still take appropriate precautions.
Really, while there isn't anything on a common arduino board that really wears out except the connectors, why are you trying to save $30 at a potential huge cost? Just buy a new board.
I'd also strongly reccomend you chose a board with a SMT ATmega328P, since that removes the IC socket contacts from the list of concerns. If possible, also remove the pin-headers, and solder wires to the board directly. Try to minimize connectors, since they are frequent points of failure.
- 2,674
- 12
- 16
One of the sections of the Arduino that is likely to become unreliable over time is its memory. There are three pools of memory in the microcontroller used on avr-based Arduino boards:
- Flash memory (program space), is where the Arduino sketch is stored.
- SRAM (static random access memory) is where the sketch creates and manipulates variables when it runs.
- EEPROM is memory space that programmers can use to store long-term information.
The memory is one part of the board that can be checked and verified, and thus evaluated for reliability/health. A very basic way to check memory would be to write a certain 8-bit pattern (byte character) over every address in the memory and then read the value present from every address. If the value that was written matches the value that is read, then that specific 8 bit block in memory is functioning correctly at the present moment.
Wear in ROM memory usually occurs in a blockwise pattern i.e. n*8-bit blocks become degraded over time. So, for a 2K byte ROM chip, the health of the chip can be estimated by writing and reading from every byte on the chip, and calculating the percentage of correctly functioning blocks. If the percentage of failed blocks is significant (15%-20%), that means that the memory is likely to fail soon.
The test code can be written using separate methods for each of the memory sections.
SRAM
Any variables declared statically or dynamically are allocated on the SRAM. So, we could declare a large character array (~2000) and fill every element with 255 (all bits 1). Then, we could attempt to read each of those elements and see if the value being read is indeed 255.
EEPROM
The EEPROM can be manipulated using the EEPROM library. The library provides functions to read and write from specific locations in the EEPROM. So, all memory addresses can be tested by simply looping over the entire memory space. This operation will require 500 writes and reads.
Depending on the board usage, EEPROM is most likely to fail first but is not critical to board operation.
Flash
Data can be stored on the flash memory using the PROGMEM directive. Similar to SRAM, a large array can be declared and initialized here. Then, values can be read and checked.
-
This concentrates just on the microcontroller, which is highly unlikely to be the least reliable bit on the board. The flash is rated to 10k cycles - this is very hard to achieve. Also the test would only prove that it is working now, not when put into the application. It's much easier surely to just validate the program memory once programmed, or the EEPROM? – Cybergibbons Feb 13 '14 at 15:01
-
I'd question the phrase "One of the sections of the Arduino that is likely to become unreliable over time is its memory." - the flash can do 10k cycles, the EEPROM 100k cycles. That's a lot of writing. – Cybergibbons Feb 13 '14 at 15:03
-
@Cybergibbons Memory intensive applications can end up doing 100+ writes per minute. Not common, but possible when using a large number of sensors. The test would give us a percentage of the memory that is working correctly. I dont have specific knowledge of the ROM chips on the Arduino, but many ROMs have the ability of spreading read and write cycles across the chip. The effect of this is that when even some memory locations degrade, it is a sign that the entire chip will degrade soon. Even if the R/W cycles are not spread, even then, if certain areas start to fail, then it is a sign that.. – asheeshr Feb 13 '14 at 15:31
-
atleast parts of the chip have undergone significant wear making the chip partly unreliable. In either case, evaluating the entire range of memory available is quite a reliable method to figure out current state of the chip, which can give an indication of failure in the near future. Yes, this will not tell me if the chip will fail in the next project, but in the case of a dangerous or expensive application, I certainly would not put a chip to work that has an increased likelihood of failure. – asheeshr Feb 13 '14 at 15:32
-
If you are writing to EEPROM or flash hundreds of times a minute, you are looking at a lifetime of under a day though. That's just inappropriate use. There is no wear levelling in an ATmega. – Cybergibbons Feb 13 '14 at 15:49