I'm working on a project currently, though things aren't quite working so I would like whoever's advice.

So, to put it briefly, I'm using a Sparkfun Flex Sensor and an MCP3008 hooked up via a Raspberry Pi. However, the MCP3008 is not picking up on the sensor's output. Well, that's what I think is happening at least. Anyways, I cannot seem to be able to figure out how to do this properly, and I'm not sure if this is a problem with the code or the wiring. In case you were wondering, I followed Adafruit's tutorial and I am using their example code.

I've been experimenting with this for a day or two now. Sometimes, all channels seem to be getting a value of 1023, and other times it's just at 0.

As of now I can't take a picture of it, but I'll make sure to upload one when I can.

1 Answer 1


i couldn't comment as of now so answering anyway if copied the code right it should work fine

Note: Copy the code from GitHub not from the blog because in blog they present only snippets of code so check that out once again if it didn't work comment below

  • I did take the code from Github. It hasn't been working.
    – Procinogen
    Commented Feb 3, 2018 at 1:34
  • hope this video help you out linkif not your MCP is faulty Commented Feb 3, 2018 at 12:25
  • I tried that video you sent. It hasn't worked, for me at least. I'm trying to set up a voltage divider with the flex sensor. My MCP probably isn't faulty, I tested both of the MCPs I ordered and got the same output.
    – Procinogen
    Commented Feb 4, 2018 at 17:52
  • Pin 19 (MOSI ) -> pin 11 (Din) Pin 21 (MISO ) -> pin 12 (Dout) Pin 23 (SCKL) -> pin 13 (CLK) Pin 24 (CD0 ) -> pin 10 (CS) Pin 6 (GND) -> pin 14 (AGND) & 9 (DGND) Commented Feb 5, 2018 at 7:42
  • try checking if any VCC pin is connected to your channel pin in that case you get full value 1023 Commented Feb 5, 2018 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.