32-Channel analog to digital converter w/optical sensors

I am using your ZAD1232PROXR 32-Channel analog to digital converter

in a prototype device to monitor 18 optical sensors:

I have conditioned the sensor output to be between 1-5V to be read by the controller. An object will pass by the sensor within 4ms. I am having trouble getting the polling interval to be less than 290ms, thereby missing the events as they happen.

Here is the polling methodology:

Connect to COM port

Send Byte Array to converter (mode, number of bytes to receive, command, bank, channel, checksum)

Receive Byte Array of 5 bytes.

The SerialPort Class in .NET raises an event that there are bytes received in the port buffer.

The program receives the event and reads the 5 byte response from the serial port buffer.

Bytes #3 & #4 are calculated as follows to get the result for the current poll:

Byte#3 + (Byte#4 * 256) = Poll Result (the number between ~100 (untriggered state) and ~4000 (triggered state)

Send the poll for the next channel on the bank and repeat through all channels on both banks.

The full sweep takes ~290ms to complete. Very easy to miss sensors triggering.

Is there a better way to get these sensor events in real time? Is there a more appropriate device for this?

Thank you for your time,

That’s a pretty fast requirement and I can’t attest that these devices will go that fast, but it will be much faster than your current setup.

2x https://store.ncd.io/product/analog-to-digital-converter-16-channel-12-bit-with-i2c-interface/
1x https://store.ncd.io/product/screw-terminal-breakout-board-for-particle-photon-or-particle-electron/
1x https://store.ncd.io/product/esp32-iot-wifi-ble-module-with-integrated-usb/

You would need to write software on the ESP to constantly monitor the ADCs over I2C and then if it sees a change then send the appropriate data out of the serial port.

The pc would need to open a serial port to the ESP over the usb connections and just sit and listen for data.

Faster time could be had by using two ESP modules and two adapter, one for each adc. They would be able to use identical firmware. The only real change would be using two usb ports on the PC and opening two serial connections.