Mass Production Measuring device

Hello there, how are you all?

I need some help to create a "simple code" to apply on my company.

I want to evaluate the amount of time that my machine is producing something (Also know as "OEE"). I intend to use the following equipment's:

  1. 01 Arduino, connected to my USB desktop port.
  2. 01 sensor of presence (capacitive of laser type), to be my INPUT DEVICE

The approach that I figure out to use is:

a) If the sensor receive more then 15 pulses of signal on the next 10 seconds, then I need to get the Date and Time of this moment.
Obs. The above subject will show me when my equipment started to produce my products

b) If the sensor receive less then 15 pulses of signal on the next 10 seconds, then I need to get the Date and Time of this new moment.
Obs. The above subject will show me when my equipment stopped to produce my products

c) the ARDUINO must keep looping these algorithm without stop for any reason

d) If possible, the system exposed bellow shall have some "security protections", like "auto restart" (When the power is out and come back).

e) These information's shall be saved on a XLS (excel type) of my desktop, on the directory like "C:"

Could you help me?

c) the ARDUINO must keep looping these algorithm without stop for any reason

The Arduino is a toy, intended for learning and experimentation.

The Arduino boards were not intended to be used in an industrial process or environment and the software that is available was not designed with reliability in mind.

It is possible to use the same microprocessors on boards intended for use in an industrial environment, with software designed for reliability. You should hire professional engineers for that.

An Arduino would be a convenient system for developing a prototype. An Uno or Mega with sockets for wires would not be reliable for long term use - and certainly not in a harsh environment with dirt, vibration or heat. But I suspect some of the small format Arduinos such as a Nano or Micro would probably be reliable.

And as @jremington has said you could build an industrial spec board with an Atmega 328 or 2560 on it and use the code developed in a prototype Arduino.

Counting pulses within a specified period of time is straightforward.

If the Arduino / Atmega MCU stops it will most likely be due to faulty code. It has a watchdog timer that can be used to restart it if there is a crash.

If you really need a super-reliable product then pay a professional who can provide you with a guarantee and who has insurance to provide you with compensation if it fails.

...R