I am working on a design to count the mechanical cycles of a piece of equipment. It has to be a 32 bit counter and be robust. I have a working prototype using a sn74lv8154 IC, configured as 32bit.

There are 2 main issues with the design 1. Reading the count 2. Losing the count

  1. Reading the count For testing and prototyping purposes I have used an Arduino to access the 4 byte registers, and display the count value on a lcd screen. However, the Arduino is proving to not be robust enough. Ideally I would like to read the count data using a laptop, but I have no experience directly interfacing a PC with an IC. Someone has suggested HyperTerminal, but again, I have no experience at all with this.

  2. The prototype uses a battery to power the device. If the battery runs flat or is disconnected the count value is lost. This is a major problem, a solution using a non-volatile counting IC would be preferable but I have not been able to find one from searching. I came across a solution using EEPROMS configured to work as EPROMS. This had potential, but I faced the same issue as problem 1, as well as using a lot of space on a circuit board.

I am keen to find solutions to these problems, so please let me know if this question is too vague!! I can provide dropbox links to the Arduino code or circuit schematic if this is useful (and allowed!) I didn't want to violate terms of use accidentally.


Thank you all for your answers and help.

I will go forward with embedding an Arduino Nano into the mechanism for the next prototype.

The reliability issues are currently being caused because the Arduino Uno and screen are in the form of a handheld reader, rather than inside the mechanism. This was bought before I started on this project http://hobbycomponents.com/boards/269-uno-enclosure-kit-r3-revision-3-arduino-compatible-uno-1602-serial-lcd-module-and-case

I agree that this can be solved with a micro approach rather than with counter ICs

  • 3
    \$\begingroup\$ The 'standard' solution for this and many other small problems is: use a micro-controller. In this case one with (internal or external) eeprom memory (and use some algorithm that is robuust anagainst power failure during eeprom write). \$\endgroup\$ Commented Sep 1, 2015 at 11:19
  • \$\begingroup\$ Why Arduino is not robust enough? I agree with Wouter. Use a micro and connect it to your laptop through USB. Write an app that reads the counter value over the serial port on your laptop. You don't need the SN74LV8151 IC or the battery. The micro will do the counting for you and save the count in its internal EEPROM. \$\endgroup\$
    – Alexxx
    Commented Sep 1, 2015 at 11:32

2 Answers 2

  1. Use Arudino Nano with USB that emulates a serial port would be perfect for that.
  2. For the laptop app download Visual Studio Express for free and use their serial port module.
  3. Watch the youtube video on how to write a simple C++ application in VS that uses the serial port.

A small microcontroller (even the one in your Arduino) should be all the technology you need for this. You would connect the pulse coming from the equipment to an interrupt input on the MCU, and use its internal EEPROM to make the count values nonvolatile. And, depending on the specific MCU you pick, you would have a wide choice of protocols to transfer the data to a PC — anything from a serial port or CANbus to USB or even Ethernet.

  • \$\begingroup\$ I wouldn't do CANbus or Ethernet. That would be an overkill. \$\endgroup\$
    – Alexxx
    Commented Sep 1, 2015 at 12:07
  • 1
    \$\begingroup\$ @Alex: Why not? Both are eminently suitable and widely used in industrial environments. \$\endgroup\$
    – Dave Tweed
    Commented Sep 1, 2015 at 12:33
  • \$\begingroup\$ Another option might be RS485. It's simpler than CAN but still has nice noise immunity which might be a factor in an industrial application. \$\endgroup\$
    – Edward
    Commented Sep 1, 2015 at 12:47
  • \$\begingroup\$ @Dave Tweed. Can or Ethernet are fine but this project is too simple for these. The simplicity of serial port over USB is more than enough for just reading the 32 bit value. That's my take on it. \$\endgroup\$
    – Alexxx
    Commented Sep 2, 2015 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.