Frustration with the MCP3008 ADC

I don’t often vent my spleen on my blog. This time, however, my frustration has boiled over. I’ve been trying to get an analog to digital converter working with my Pi. Now, I should say going into this I’m not feeling my best at the moment, and my patience is more than a little thin.

Over the past few weeks, I’ve had problems with my 7″ LCD screen, with my 16×2 LCD module, my ultrasonic distance sensor… and now it’s the turn of the ADC.

I was trying to do this tutorial:

Overview | Analog Inputs for Raspberry Pi Using the MCP3008 | Adafruit Learning System.

and failed miserably. Analog levels are just not being reported. I get the occasional fluctuation, but it doesn’t seem to be reading the analog-ness of the potentiometer. It’ll go to 100%, then to zero again. No idea what I’m doing wrong.

Still, I persevered and decided to try Jeremy Blythe’s tutorial that is the same as the Adafruit one by instead using the SPI protocol. I figured I’m using the Occidentalis distro, SPI is enabled, and I’m having no luck with the original. Here’s a link to the tutorial:

Guess what? I failed again. I’m getting 100% volume all the time. I don’t doubt that both tutorials are accurate and correct, just that my lack of knowledge is probably causing my failure.

Perhaps it’s because I’m using a mini potentiometer rather than one of the blue ones, but surely if I press down on the thing it should do the same? It’s so frustrating.

I’m not a stupid person – but I do feel that I’ve reached the end of my expertise with this simple tutorial. I’m all at sea with electronics, it seems, and I haven’t a clue how to get enough knowledge to make myself proficient enough to do what I want to do.

Rant over!

12 comments for “Frustration with the MCP3008 ADC

    • It’s one similar to this:
      eBay 7″ screen
      You can get them cheaper elsewhere, or from Hong Kong/China. They’re basically car rear-view monitors for those reversing cameras you can get.
      Best ones come with a power adapter to use – they’re normally powered from the car’s 12V, so it’s a 12V power supply you need.

    • I think the first step for me is to go much simpler than I’ve been doing. I’ve been trying to just add sensors to a breadboard, but I’m thinking now I should get things working in isolation first, and then combine them.

  1. Have you got a multimeter handy? It’s worthwhile checking the voltage across your input pin whilst varying the position of your potentiometer.

    If the pot isn’t connected(floating) you’ll tend to find that the input reading on your mcp3008 varies wildly, so it’s usually quite obvious.

  2. It sounds like you had the same problem as me. Please let me know what you did. I probed the input into my MCP3008 and it is changing as expected but I just get 100% all the time.

  3. i had the same problem as you. My values kept changing till I started fiddling with the wires. I switch breadboards and ran leds through connections to make sure current was going through. When I checked my knob , I had the connections wrong. Also using 3.3v worked, not 5v.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.