Making a RTC which counts how many times the machine was used etc

Hi all,

I'm going to be making a counter which logs temperatures, how many times a machine was used and when a machine is due servicing (e.g. after x amount of uses or 12 months). The data will be sent via Wifi to a database to store this information.

The machine may lose power on some days so a RTC will be needed to keep track of time as well as store the counter.

Can you provide me with a list of hardware I'll need? So far on the list I have: Arduino UNO Arduino Wireless SD Shield Network Interface card Precision Real time clock memory module Arduino DS3231 AT24C32 IIC module Raspberry Pi to hold central database Temperature Sensors

The list depends on having a design. Do you have one? Yes, mostly. If you aren't sure that your list is correct, you need a more complete design.

Use EEPROM for counting the power ups. No sense in using RTC for that job.

Shpaget:
Use EEPROM for counting the power ups. No sense in using RTC for that job.

The AT24C32 is an EEPROM. I think the OP meant the module, which has an onboard EEPROM, good idea because it stores more.

aarg: The list depends on having a design. Do you have one? Yes, mostly. If you aren't sure that your list is correct, you need a more complete design.

I made a counter & RTC using a PLC earlier this year so that part of the design is complete. The networking aspect of, uhhhm no design yet. :-[

aarg: The AT24C32 is an EEPROM. I think the OP meant the module, which has an onboard EEPROM, good idea because it stores more.

Yes this was my thinking.

Unless you go wild on power cycles, ATmega328 already has enough EEPROM for many years worth of powering up. No need for additional components.

Shpaget: Unless you go wild on power cycles, ATmega328 already has enough EEPROM for many years worth of powering up. No need for additional components.

You are mistaken about power cycles. There is no stress on EEPROM during read operations. So the "many years worth of powering up" means nothing. It is write cycles that are limited.

If the application used up a lot of write cycles, you might eventually have to replace the EEPROM. Now I ask you, which would be easier to replace, the ATmega, or the RTC? The new ATmega would have to be reflashed with code. Not so with the RTC.

The 328 has 4k EEPROM. The AT24C32 has 32k EEPROM. Whether 4k is enough is application dependent, but that's 8 times the storage.

The ZS-042 module which has the AT24C32 onboard, sells for the same or less money than boards that don't have it. So it often costs more to not have it in a system, than to have it. I recently paid approximately US$1.25 each for them.

It's not an additional board. It's just a particular board. So not only does the additional EEPROM storage come for free, it's actually a cost saving, once you are committed to adding an RTC.

It does mean something if you write to EEPROM every time you power up and count the number of power ups, which is something OP wants to do.

As for the rest, if you want to sell the product, which I got the impression OP wants to do, would you slap it together from modules you get from ebay or make a dedicated PCB and put only the necessary components?

Shpaget: It does mean something if you write to EEPROM every time you power up and count the number of power ups, which is something OP wants to do.

As for the rest, if you want to sell the product, which I got the impression OP wants to do, would you slap it together from modules you get from ebay or make a dedicated PCB and put only the necessary components?

If it's Wifi connected, it will have to do some kind of startup connection with the logging server. Since this happens once every time the device boots, it may be possible to count the startups at the logging server. If there is data that must be stored in EEPROM, there is no way to avoid the issue of EEPROM wear, as it is inherent in the technology. That's the same, regardless of where the EEPROM is installed.

The rest is a decision that rests on the designer. I'm responding to a description that does not imply the design of an integrated PCB. You can suggest it, and it may or may not be what you or I might do. It really depends on the application and circumstances.

To put this in perspective, the AT24C32 is guaranteed for 1 million write cycles. How many times will the machine be turned on? ;)

if you are talking about a tracktor for fork lift that is used a couple times a day, the amount of write times is not even close to being used, either in the write times or amount of data.

if you are counting keystrokes on a keyboard.... that would be something else.

seems the OP needs to approximate the expected numbers of writes.

aarg: You are mistaken about power cycles. There is no stress on EEPROM during read operations. So the "many years worth of powering up" means nothing. It is write cycles that are limited.

The 328 has 4k EEPROM. The AT24C32 has 32k EEPROM. Whether 4k is enough is application dependent, but that's 8 times the storage.

The AT24C32 is a 32kbit EEPROM (4K bytes) so it has the same storage space as the 328.

The 328 is specified with 100k write cycles, whereas the ATC24C32 is specified with 1M write Cycles with a 32byte write page.

Chuck.

chucktodd: The AT24C32 is a 32kbit EEPROM (4K bytes) so it has the same storage space as the 328.

I was just seeing if you were paying attention. :)

Atmega 328P has 1KBytes EEPROM, not 4.

Want more write durability? FRAM. 10^13, 10^14 write cycles, at SPI Speeds (vs 3.3mS for onchip EEPROM), up to 2Mbyte in little 8-pin packages.

"High-endurance 100 trillion (10^14) read/writes"

http://www.digikey.com/product-search/en?pv154=29&FV=fff40027%2Cfff80434&k=fram+memory&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25

aarg: I was just seeing if you were paying attention. :)

Did you see where my 'correction' was also wrong? :o Crossroads pointed out that the 328 only has 1k of EEPROM :confused:

chuck.