• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Three millions events counter! Help needed

Status
Not open for further replies.

Cryptbreaker

New Member
I wanted to build a circuit that can count up to 3 millions event. The number of elapsed event can be stored in an non volatile memory. Any suggestion of possible solutions?
 

Cryptbreaker

New Member
The time between events is about 1 second, but the contact point of the event is 5millisecond.
The analogy for the events is like this. I need 5 millisecond to change the gear, but the motor will run for a second on that particular gear, and then another 5 millisecond to change to another gear, and the cycles continue. I need to count these contacts and store the number into a nonvolatile memory so I can read this memory in the future.
 

ChrisP58

Well-Known Member
Most Helpful Member
Most any microcontroller with some eeprom would work. A 24 bit counter (3 bytes) can count to 16.7 million. The problem will be with changing the LSB that many times will exceed the read/write endurance of most non volatile memory. Do you need an exact count? Or could you live with a stored number that jumps 256 steps? If you need an exact count, it can be done, but will be a little more tricky.

How do you want to read the stored number out? Do you need an integrated display? Or will it be OK to have to connect it up to an external reader?
 

ronsimpson

Well-Known Member
Most Helpful Member
Many microcontrollers do not have permanent memory. There are small (8-pin) memory chips (flash or eeprom) that work well. There is also "battery backed" ram that with a battery work well. Some microcontrollers have that built in.
 

ronsimpson

Well-Known Member
Most Helpful Member
EEPROM can not be written to 3 million times. (most parts) There are some ways to get around this. Search on the internet for how. FLASH also has this problem.
 

ChrisP58

Well-Known Member
Most Helpful Member
EEPROM can not be written to 3 million times. (most parts) There are some ways to get around this. Search on the internet for how. FLASH also has this problem.
That is why I asked the OP if he could live without non-volatile storage for the lower 8 bits. Use a static counter for the first byte and use eeprom only when it rolls over. That way there would only be 12K cycles on the eeprom. Well within the 100K spec.

Another way is to do all 24 bits in ram, and use a pending loss of power pin to save ram to eeprom while a storage cap keeps the power up for an extra half second.
 

ericgibbs

Well-Known Member
Most Helpful Member
The time between events is about 1 second, but the contact point of the event is 5millisecond.
The analogy for the events is like this. I need 5 millisecond to change the gear, but the motor will run for a second on that particular gear, and then another 5 millisecond to change to another gear, and the cycles continue. I need to count these contacts and store the number into a nonvolatile memory so I can read this memory in the future.
At this low counting speed, a 8 digit electromechanical counter would work ok.

A little pricey at ~£53.00, but a quick simple solution
http://uk.farnell.com/hengstler/0-8.../925901?Ntt=8+digit+electromechanical+counter
 

ronsimpson

Well-Known Member
Most Helpful Member
I have, in production, products that use so little current that we did not install a on/off button. Using a 3V coin battery and running the "PIC" at 32khz and using sleep mode this product can count pulses and remember in RAM and probably last years on a small coin battery. I have some 6 pin PICs and 8 pin PICs that will do the job.
 

Cryptbreaker

New Member
Let me give you an analogy of gears in a machine.
It takes 5 milliseconds to make the contact between gears to settle. and the contact between the gears lasted for 1 second. and then the gears would be released and in contact again. The cycle continues until the machine turn off. When it is turned off, the no. of contacts will be stored in non volatile memory. When the machine is turned on and running. the number of contacts will be added to the previous memory. I don't think I need to store how many contacts between each machine runs. I just need to know the total contact. 3 millions is the maximum contacts that I can think of before I am resetting the counter

The circuit will be incorporated in my machine system, maybe in the form of socket through pin. What kind of reader and how to read it, I am not really sure as well, because I am not well versed in electronics. Can I use universal reader/programmer to read the EEPROM in the system with the header pins from the ports?

Sure it will be a good learning experience to make this from scratch, but I am not closing a possibility of getting off the shelf if it's cheap (cost is important) and can be installed in the machine system. My machine is not big a industrial machine, maybe in the shape of normal notebook, so that would be nice if it's it's compact in form of PCB.
 

ronsimpson

Well-Known Member
Most Helpful Member
I could make a small PCB of 1 inch by 1 inch or much smaller if size is important.
It will look for pulses in the 3 to 10mS range.
Count, in memory, until power goes away.
...It will continue to function for about 1 second after power fails.
...It will store in EEPROM the count during that last 1 second, then shut down.

On power up it will retrieve the last count from EEPROM and continue to count from there.

Using a small cable it can plug into a PC or laptop computer. The count will be displayed on the PC and a reset command can be given.

The counter could also store the counts for the last 30 times the machine was used. OR How fast the machine is running. OR .......
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top