Timeout on read_voltage
555 Views - Created 26/01/2022
The RPI also has an ADC Pi which works as expected, so I know the IC2 stuff is good. I've swapped the IC2 addresses, stil no ADC Differential Pi readings.
I bought another ADC Differential Pi, assembled it, and am getting the same results. My input is microvolts (from a current shunt). At this point I've disconnected any input, looking to see if that will eliminate the timeout. Same result.
I'm coding in Python and created a simple standalone program that solely imports the ADCDiff lib, sets the IC2 address, and does a read_voltage. Same result... just wanted to rule out something in other code being in the way.
I've ordered 3 more ADC Differential Pi units, figuring this must be a hardware failure.
That said, is there a means to ping the unit and get a reply that confirms it's alive?
I am sorry you are having problems with your ADC Differential Pi boards.
You can use the i2cdetect command to check if the ADC chips are visible on the I2C bus. Run the command "sudo i2cdetect -y 1" in a terminal and it should display a grid with the i2c addresses of any devices available shown in the grid. The ADC chips on the ADC Differential Pi are normally set to addresses 0x68 and 0x69 but depending on how the address jumpers are set it can be any address between 0x68 and 0x6F.
If the ADC chips show up in i2cdetect that would mean the problem is most likely a software issue. If the ADC chips do not show up in i2cdetect it is probably a hardware issue. The fact that your ADC Pi works would suggest that there isn't a problem with the I2C bus so the hardware issue would most likely be with the ADC Differential Pi.
Is the current shunt you are measuring connected to the high side or the low side of the circuit? Ideally, you want to connect the shunt on the low side so the voltage measured by the ADC is relative to ground.
The maximum input voltage on the MCP3424 ADC used on the ADC Differential Pi is 5V. A high side current shunt on a circuit with a power supply voltage greater than 5V would overload the ADC as the input voltage on the ADC relative to ground would be greater than 5V.
The current shunts are on the low side, previous notes had an input at +42 mv during one read. I thinking a spike or something killed the unit. I did have my first one working for a day or so, and the second made one reading and then died.
I should have a new ADC Differential Pi tomorrow. I'll bring that one up very deliberately to see what happens.
Thanks for the quick response,, really appreciated!
Can you try downloading our python library onto your Raspberry Pi and run the ABElectronics_Python_Libraries/ADCDifferentialPi/demos/demo_readvoltage.py python demo? That will try to read from all 8 channels. If it fails try setting it to only read from one chip by changing adc = ADCDifferentialPi(0x68, 0x69, 12) to adc = ADCDifferentialPi(0x68, 0x68, 12) or adc = ADCDifferentialPi(0x69, 0x69, 12).
Does the circuit with the current shunt share a common ground with your Raspberry Pi and the ADC Differential Pi? If the circuit uses a separate power supply from the Raspberry Pi and the grounds are not connected you may have a large voltage difference between the two grounds that would damage the ADC inputs.
All inputs (Differential Pi and Pi) share the same ground. I'm not sure why I've had two failed boards. I have new differentials coming in, I'll installe one and hopefully all will be well.
Thanks again for the help!
Apparently I'm getting soime spikes on the circuit that has the current shunts I measuring. It's a pwer generation systems and I think its from when a solenoid kicks off.
I'm contemplating adding a capacitor and/or zener diode to the input that will resolve the problem. Have you any past solutions or wisdom you can offer? Thanks in advance!
Check that the solenoid has a flyback diode fitted to reduce any voltage spikes when it switches off.
Analog.com have a good article on protecting ADC inputs on their website.
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.