Can't read analogue sensor data

February 8, 2024, 15:36

gelid_cryotheum

Hi, I'm trying to read data from the Sparkfun sound detector over SPI but for some reason it only works when I try to read the digital output (whether sound is detected or not), rather than the analogue outputs (amplitude and audio). I'm reading it through a MCP3008 by sending 0x80 (channel 0). It returns a value when it's plugged into the GATE pin and I'm making noise, but I just get 0x00 back when I plug it into the other 2 pins. Any ideas on why? I thought the MCP was meant to convert analogue to digital so the Pi can read it. Sound detector: https://www.sparkfun.com/products/12642 MCP3008 datasheet: https://cdn-shop.adafruit.com/datasheets/MCP3008.pdf

oops.se

The GATE pin is the output from a Schmitt trigger (https://en.wikipedia.org/wiki/Schmitt_trigger) and that is a digital output.

gelid_cryotheum

Yeah, the thing I'm struggling with is that I can read the digital output through the ADC but not the analogue outputs

oops.se

"other 2 pins" ... should we guess which one that is? And yes the MCP is a A/D converter with a MUX in front of it. And if you can read the digital signal but not an analog signal then there is a answer, is the analog signal high enough, hook up an oscilloscope and check the output signal.

gelid_cryotheum

Cool, thanks! :)