Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Timeout on read_voltage

The ADC Differential Pi is an Analogue to Digital converter for the Raspberry Pi

26/01/2022

Posted by:
ChuckB

ChuckB Avatar

I've an ADC Differential Pi which was working just fine, then quit... timing out on read_voltage.

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?

Thanks!

Chuck

26/01/2022

Posted by:
andrew

andrew Avatar

Hi Chuck

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.

27/01/2022

Posted by:
ChuckB

ChuckB Avatar

i2cdetect finds both units, one at 68/69, the other at 6A/6B. I don't thinks its software, since the 3 line program that imports the ADCDiff lib, sets the IC2 address, and does a read_voltage hangs.

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!

Chuck

27/01/2022

Posted by:
andrew

andrew Avatar

If the ADCs are showing up on i2cdetect that means that at least the I2C part of the chips is still working. Often a voltage surge on one of the input channels can kill one of the ADC chips but leave the other one working so you may find that if your shunt was connected to channels 1 to 4, channels 5 to 8 will still be working.

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.

28/01/2022

Posted by:
ChuckB

ChuckB Avatar

The chip at 68 was cooked. I've hooked up each shunt to input 5 (one at a time) and each reads just fine and is within limits.

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!

Chuck

01/02/2022

Posted by:
ChuckB

ChuckB Avatar

Andrew,

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!

Chuck

01/02/2022

Posted by:
andrew

andrew Avatar

A Zener diode will help reduce the damage from voltage spikes. You could also add a resistor on the ADC input to limit the current going to the built-in ESD protection diodes.

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.

Sign in to post your reply


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.

Home

Shop

Learn

Forum

FAQ

Contact

0 item

Your cart is empty

Please browse our shop to order from the wide range of Raspberry Pi boards and accessories.

Subtotal:£0.00
View Basket Continue to Checkout