raspberrynewbB
Posts: 12
Joined: Fri Sep 29, 2017 6:32 am

Not getting any output from MCP3008 [solved]

Mon Oct 02, 2017 6:55 am

Hello there,

I have wired the MCP3008 according to this tutorial: https://learn.adafruit.com/raspberry-pi ... rs/mcp3008

I have used male-female jumpers to go from the GPIO pins to the breadboard so i know for sure my connections are correct. I wired it to the RPi3 to connect with a software SPI connection.

When I run the tutorial to output reading for the channels, I get only 0 values. To check if the ADC was working I connected a 3v3 cable to one of the analog inputs, expecting to get a 1024 output, which would correspond to 3v3 becasue Vref is 3v3.

Instead I only get 0. In fact, every now and then (rarely but still happens) I get a 1024 output for channels that I don't even have connected to anything?

Can anyone help me?

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Not getting any output from MCP3008

Mon Oct 02, 2017 7:24 am

did you check the correct forum?

piras77
Posts: 147
Joined: Mon Jun 13, 2016 11:39 am

Re: Not getting any output from MCP3008

Mon Oct 02, 2017 7:50 am

Well, if you are sure that you did everything right, then, as the only conclusion, something must be broken.

In my experience, this is rarely the case, so you may want to check your setup again.

You may also want to have a look at the datasheet: https://cdn-shop.adafruit.com/datasheets/MCP3008.pdf

Anyway, a good start to analyze your problem is to trace the signals with a logic analyzer (which are less than 10 bucks).

Im sure you will get help here if you provide more information as pictures, actual measurements or traces of the logic analyzer.

BTW: Analog inputs that are not connected may return random values. However, in my experience, they won't toggle between 0V and 3.3V as you describe.

User avatar
B.Goode
Posts: 10725
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Not getting any output from MCP3008

Mon Oct 02, 2017 9:47 am

The gpiozero Python library module installed by default with recent releases of the Raspbian Operating System includes built-in support for the MCP3008 chip.

The sample 'recipe' even includes a wiring diagram.

Perhaps it would be worth trying this alternative solution? If it works it would prove that your MCP3008 chip is functioning and if necessary you could return to the Adafruit example with fresh confidence.

http://gpiozero.readthedocs.io/en/stabl ... entiometer

raspberrynewbB
Posts: 12
Joined: Fri Sep 29, 2017 6:32 am

Re: Not getting any output from MCP3008

Wed Oct 04, 2017 12:08 am

thank you all for the suggestions..after some digging i ended up getting it work :D


much appreciated

User avatar
B.Goode
Posts: 10725
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Not getting any output from MCP3008

Wed Oct 04, 2017 8:09 am

raspberrynewbB wrote:
Wed Oct 04, 2017 12:08 am
thank you all for the suggestions..after some digging i ended up getting it work
For the possible benefit of others who may read this thread in the future could you say a few words about what the problem was, or what the key troubleshooting step was? Was it the wiring, or the coding, or a combination?

Also it is the practice in this forum to now edit the Subject/Title of your initial post to add [Solved] or something similar.

cszalaj
Posts: 1
Joined: Tue Dec 18, 2018 2:24 pm

Re: Not getting any output from MCP3008

Tue Dec 18, 2018 2:46 pm

Hi, I'm new to RPi projects, and am trying to use the MCP3008 with hardware SPI interface to connect a capacitative moisture sensor.

I believe things to be wired up properly, but I have the same issue as noted here from the previous user, I only see 0 for the channels when i run the sample python that reads the channel output from the MCP3008.

I followed the wiring here for the hardware SPI interface:
https://learn.adafruit.com/raspberry-pi ... rs/mcp3008

Here are pictures of my wiring:
https://drive.google.com/open?id=1Qs8AN ... NSpeiudUJa
https://drive.google.com/open?id=18di_r ... iQ3__Gzxk2

Not sure if this is the most helpful way to provide the info or not, so please let me know what you need to help me out.

Thanks for any suggestions! I'd love to know what the last person did that helped them -

Chris

pcmanbob
Posts: 10142
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Not getting any output from MCP3008

Tue Dec 18, 2018 6:59 pm

cszalaj wrote:
Tue Dec 18, 2018 2:46 pm
Hi, I'm new to RPi projects, and am trying to use the MCP3008 with hardware SPI interface to connect a capacitative moisture sensor.

I believe things to be wired up properly, but I have the same issue as noted here from the previous user, I only see 0 for the channels when i run the sample python that reads the channel output from the MCP3008.

I followed the wiring here for the hardware SPI interface:
https://learn.adafruit.com/raspberry-pi ... rs/mcp3008

Here are pictures of my wiring:
https://drive.google.com/open?id=1Qs8AN ... NSpeiudUJa
https://drive.google.com/open?id=18di_r ... iQ3__Gzxk2

Not sure if this is the most helpful way to provide the info or not, so please let me know what you need to help me out.

Thanks for any suggestions! I'd love to know what the last person did that helped them -

Chris
Hi.

If you have a read of this thread viewtopic.php?f=28&t=211861
specifically my posts on 24 Apr 2018, 16:31 will give you the correct connections between your pi and the MCP3008 and then 25 Apr 2018, 13:38 for 2 sample programs to read a single and all input to the MCP3008.

diagram of connections
Image

This should solve your problem.

One final point its not advisable to post a new question on a thread marked solved, I only picked it up because it appeared in the list of threads I have posted on, you would have been better to ask your question in a new thread , better still you could have searched the forum for posts about connecting the mcp3008 and found several similar posts related to your problem, including the one i liked to.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

rompelstilchen
Posts: 71
Joined: Thu Mar 03, 2016 10:37 am

Re: Not getting any output from MCP3008 [solved]

Tue Jan 28, 2020 3:27 pm

why connect AGND to the RPI ?
this is obviously a gnd for the analog side of the ship

User avatar
davidcoton
Posts: 5503
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Not getting any output from MCP3008 [solved]

Tue Jan 28, 2020 3:39 pm

rompelstilchen wrote:
Tue Jan 28, 2020 3:27 pm
why connect AGND to the RPI ?
this is obviously a gnd for the analog side of the ship
You realise you are replying to a year-old post?

See the MCP3008 data sheet, especially section 6.5 about grounding.
In most circumstances DGND and AGND should be connected close to the chip.
Location: 345th cell on the right of the 210th row of L2 cache

Return to “Beginners”