Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

First use of ADCPi and can not get a reading

2493 Views - Created 25/06/2019

25/06/2019

Posted by:
DDH69

DDH69 Avatar

Location:
Australia

I am a first time user of the ADCPi connected to a Pi Zero WH. I think I've followed all of the correct instructions but find that I am getting readings of 0.0V from all 8 inputs.

Around the house I've got about 10 Pi's running a variety of things and have written Python scripts for a house alarm and a watering system, so reasonably familiar with Pi's. This is my first use of the ADCPi which I plan to use for analogue temperature reads. (I've got 3) I haven't got that sophisticated yet, just trying to read any analogue voltage at present.

This is what I've done:


Installed the github software as per https://github.com/abelectronicsuk/ABElectronics_Python_Libraries/tree/master/ADCPi
Enabled the SPI interface as per ABE link
Enabled I2C interface
Installed
Using the default addresses - configuration #1
For testing, placed a 10K variable pot from 0v to 3V3 with the wiper going to input #1 (also tried #2 and #5)
Run the demo program, runs without error, but 0.0 read
Wriiten a simple Python script but still get 0.0v read


I think that's a fair summary of where I am (other than frustrated :-) ). Any suggestions are most welcome.

25/06/2019

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Try connecting a wire directly between the 3.3V on the GPIO header and the channel 1 input as shown in the image below. You should get a reading of 3.3V. Make sure you don't connect the 3.3V to the ground pin next to the input as that could damage the Raspberry Pi.

forum image

25/06/2019

Posted by:
DDH69

DDH69 Avatar

Location:
Australia

Thanks for the reply.

I have now made the connection. Using both my program (intialise, read) and the demo_adcread.py I get the return 0.0

25/06/2019

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

If you run the command "sudo i2cdetect -y 1" does the ADC Pi appear on the I2C bus on addresses 0x68 and 0x69?

25/06/2019

Posted by:
DDH69

DDH69 Avatar

Location:
Australia

I have run this (and just ran it again). I am unsure what the correct result is. I get a grid of hexademinal results from 0x03 to 0x77. Each position on the grid has the respective hexidecimal result, ie colum 1, row 70 has 71, etc.

25/06/2019

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

i2cdetect should return a result like in the image below, assuming that the ADC Pi is the only device plugged into the GPIO header.

forum image

If your Raspberry Pi is showing numbers on all of the columns then there is probably a problem with the configuration of the I2C bus, in which case I would suggest going through all of the steps in our I2C tutorial again to make sure everything is configured correctly.

Also, try running the i2cdetect command without anything plugged into the I2C bus and with a different ADC Pi connected to see if you get any different results.

25/06/2019

Posted by:
DDH69

DDH69 Avatar

Location:
Australia

forum image

It took me a moment, but here is the output of i2cdetect

25/06/2019

Posted by:
DDH69

DDH69 Avatar

Location:
Australia

Sorry, posts "crossed in the mail". I will follow-up on your suggestions (prehaps tomorrow here in Oz) and report back - thank you again.

26/06/2019

Posted by:
DDH69

DDH69 Avatar

Location:
Australia

OK, back at it again tonight.

I have:


Removed the ADCPi - still reporting all addresses
Openned another brand new Pi Zero WH, swapped over the SD card (I didn't really want to do another Raspbian load from scratch - yet, the current one has been built over the last few days) - still reporting all addresses
Went through the steps on https://www.abelectronics.co.uk/kb/article/1/i2c--smbus-and-raspbian-linux again, very carefully, and twice - still reporting all addresses


Any further thoughts are most welcome as I'm struggling.

26/06/2019

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

As the I2C bus is showing all addresses on two different Raspberry Pis without anything connected my best guess would be that the Raspbian image is corrupted in some way.

Do you have a spare SD card you could use to set up a new version of Raspbian Linux?

26/06/2019

Posted by:
DDH69

DDH69 Avatar

Location:
Australia

Damn - rebuild from scrach it is then! I will report back ....... probably tomorrow by the time I redownload, image, etc.

Thank you.

27/06/2019

Posted by:
DDH69

DDH69 Avatar

Location:
Australia

So, definately something in the image. Built a new setup from scratch, now working perfectly.

Thank you for your help. Now its time to finish the new image and get back to coding :-)

18/07/2019

Posted by:
Openair

Openair Avatar

Location:
NY

Do you have an electrical circuit for this board?

18/07/2019

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew 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.