My arduino code sends a message over the USB/COM port every time it sees a pulse from a LED (using a LDR). The code is running on a Arduino Uno (1st Rev with DIP AtMega). The Arduino is connected to a server (Windows Server 2008 R2 x64) with a custom C# application that writes the frequency of the pulses to a database. Everything works consistently, except that after about 24 hours (+- 3 hours), communication between the computer and the Arduino ceases completely. If you try to restart the C# application, it receives an exception "A device attached to the system is not functioning" when trying to open the COM port. The same error is given when trying to open the port using PUTTY.
To resolve the problem, I simply delete the COM port in the Device Manager, and then "Scan for hardware changes...". After the port is re-detected, the software runs for about another 24 hours before the problem repeats.
I have the exact same code running on a old Arduino Duemilanove (with the FTDI chip) at home connected to a Windows XP computer running the same C# code, and it has been running without a problem for 80 days now.
Can someone please shed a bit of light on the problem or help me resolve it with some troubleshooting.
EDIT: The Hardware ID of the Arduino UNO is USB\VID_2341&PID_0001&REV_0001 so am I correct in saying the Atmega8U2 is running the latest firmware?
The pulse measured is from a pre-paid electricity meter. The highest frequency possible is about 4Hz, and the message size is 6 bytes on every pulse. The only thing connected to the Arduino is a 100K LDR and and a 100K resistor to offset the LDR voltage. The integrated LED on pin 13 is flashed with every pulse. Other than that, nothing is connected.
The exact same components are attached to the Duemilanove though.
Does anyone do something like data acquisition with an Uno that can confirm an uptime of months?
Thanks for your help guys. I managed to deduce the problem: Its software/hardware related but not the arduino's fault.
I have an LDR that measures a pulse from an LED on an electricity meter and sends a basic message to the PC over USB. The message is sent on a rising edge interrupt.
It turns out that every morning at about 07:00, sunrise over here, sunlight penetrates the assembly and hovers the voltage around enough to trigger thousands of interrupts flooding and eventually breaking the USB. Putting a box over the meter and LDR solved it.
I'm also planning on using a 74HC14 Schmitt Trigger to solve the problem.. Do you think it will work?