Production Monitoring

I have done some searching here and elsewhere on setting up some production monitors. Basically I want to create an entry in a log (goal is in a DB on a server) every time my machine cycles. I get a signal from the machine every time a part is made so all I have to do is tie into that. I have 4 machines with possibly some additional in the near future.

If anyone has some resources for me to check out or if anyone could be of assistance... I'd really appreciate it. I could provide further info as to why I want to do this but I didn't want to muddy the waters.

mxadkins: I have done some searching here and elsewhere on setting up some production monitors. Basically I want to create an entry in a log (goal is in a DB on a server) every time my machine cycles. I get a signal from the machine every time a part is made so all I have to do is tie into that. I have 4 machines with possibly some additional in the near future.

If anyone has some resources for me to check out or if anyone could be of assistance... I'd really appreciate it. I could provide further info as to why I want to do this but I didn't want to muddy the waters.

We really don't care why you want to do it. We do care about many other things.

What sort of signal do you get from the machine when a part is made? How do you want to connect the Arduino to a database? How far apart are the machines from each other? How far are the machines from the database machine? Do you need to use more than one Arduino for any reason you can think of?

All these questions will determine what sort of methods and interfaces will serve the purpose

The signal would be a voltage jump on a particular circuit. I'd just use ethernet to connect to the database. The other option is to export .csv and have my ERP go pick up the file. The machines are in a row about 10' from one another. I don't know if I need to use more than one Arduino. I have a computer at each machine now for data entry so I was considering having each computer log production data from it's machine and have my master DB go "look" at all of the other data.

mxadkins: The signal would be a voltage jump on a particular circuit.

How long is the "jump"? How often will it happen? It is easy to check for a pulse, and your only real concern will be that (a) you don't miss it, and (b) that it arrives at an Arduino with the appropriate voltage swing.

I'd just use ethernet to connect to the database. The other option is to export .csv and have my ERP go pick up the file.

Ethernet is more complex than many other schemes. With the spacing and overall distance of the machines, a much simpler signaling protocol is possible. I don't know what an EPR is, but an SD card with someone picking it up, also seems inefficient.

The machines are in a row about 10' from one another. I don't know if I need to use more than one Arduino. I have a computer at each machine now for data entry so I was considering having each computer log production data from it's machine and have my master DB go "look" at all of the other data.

With a computer on each one, it makes things a little easier, though you still have to decide whether to use one Arduino per machine, or just one Arduino. If the pulse is fairly long, I'd probably go for one Arduino, looking at four pins, each being connected to one machine. That scheme would service n machines with n+1 wires. The idea would be that the Arduino would scan the pins fairly quickly, debouncing (if necessary) each pin's level, and simply counting the pulses. One Arduino would gather all the data, and send it in to a PC, perhaps on one of the machines.

20 ft. (the maximum distance a signal would have to travel for those 4 machines) may require a "line driver", which is low-cost and commonly available, but after adding more machines (if you do), the line driver could handle much longer distance. If distance becomes an issue, other Arduinos could be added, with each "group" being informed by the next group.

Are the PCs on each machine connected via WiFi? Or if not, could one or more of them be made WiFi connected?

The signal is typically on for .2 to 5 seconds and off for 2-20 seconds. I think the best thing to do is have an arduino for each machine that connects to the dedicated computer. The reason for this is I may add more machines in the future. All of the computers are networked via ethernet. but I can easily add wifi. I'll just defer to you on the best method of getting the data to the PC.

Thanks for your help by the way. I really appreciate it.

mxadkins:
The signal is typically on for .2 to 5 seconds and off for 2-20 seconds. I think the best thing to do is have an arduino for each machine that connects to the dedicated computer. The reason for this is I may add more machines in the future. All of the computers are networked via ethernet. but I can easily add wifi. I’ll just defer to you on the best method of getting the data to the PC.

Thanks for your help by the way. I really appreciate it.

200 ms is quite long in terms of the Arduino’s speed, so you don’t stand much chance of missing it.

An Arduino per machine is a more expensive option, but has a few advantages. Two, as you mentioned, are ease of getting the data to the associated PC and in expanding the system to monitor more machines. Another is that you don’t need to run multiple wires in a way that doesn’t leave them vulnerable to accidental disruption.

Getting the data to the database is about as easy as it can be, if the individual PCs are Ethernet connected to the database machine. The Arduino’s job is almost trivial.

loop() {
   Read the pulses
   Keep a count of them
   Decide how often to send a count.
   Send the count to the PC with Serial.print()
   Clear the count
}

If you have a computer at each machine then I would have the Arduino just send an event to the computer via USB serial each time the machine cycles, and have that computer log the event to a central database. You will need an application on the computer to receive the event from the Arduino serial port and perform the database write. The application would be very simple and you should be able to find examples in the playground. If the computer is running Windows then you can use Gobetwino to invoke a database client utility to perform the write, instead of having to write your own application.