I got this kit that came with a 74LVC8T245 (http://www.wvshare.com/product/74LVC8T245-Board.htm) that I have been able to get 5v output working just fine but as for a 5v input sensor I'm not 100% sure about. Several of the sensors I have come from a kit from SunFounder which are all 5v. Several have digital inputs but most are analog. Considering the success I've had with the outputs, I'm hopeful the I'll have the same luck with the inputs. I've read that the Pi can't do analog without a chip (like the MCP3008) but as I live in Tanzania, East Africa finding one might cost me upwards of $50 in shipping alone. I have the following kit

Link: http://amzn.com/B00DWFEQAA

So, my question is this: out of all of the things in this kit, can I convert analog signals into digital ones that the Pi can understand?

1 Answer 1


First off, while this chip looks to be good (and I really like those yellow headers), it can't help you with inputs and outputs at the same time. I don't think you had that question, but I wanted to answer it in case you did.

For level-converting digital inputs without extra hardware, you can rig up a voltage divider for the inputs to reduce the 5 V to 3.3 V. 18 K and 10 K should be a good ratio, with the 10 K resistor between the 5 V signal and the 3.3 V input and the 18 K resistor between the input and ground. I haven't tested these values with a raspberry pi, but it works on paper. Feel free to google around to see what others use, and definitely test your circuit with a multimeter before connecting it to the raspberry pi. That combo I gave you will produce up to 3.2 V, but if you want to play it safe, reduce the 18 K resistor to 15 K, 12 K or even 10 K. The raspberry pi detects logic high for anything above 2.0 V.

If you need bi-directional communication like I2C, it will be hard to level-shift without more hardware.

Now, for analog signals (I think this is your real question), there is a guide that describes a rather clever method for measuring analog signals between 0 V and 3.3 V using only the raspberry pi and a comparator like the LM311, which are pretty common. The idea is to generate an analog voltage with the raspberry pi using PWM and comparing that voltage to the input until a nearly accurate value is found.

Here is the link: http://hertaville.com/2014/07/11/adchack/

Remember that you might have to use a resistor network like the one I described to adjust the levels of the analog signals to safe values. The guide looks very thorough and there are schematics and code provided, but I don't know whether it is designed for multiple inputs. Good luck!

Update: I missed the link to your kit. To answer your question more directly, no. It doesn't look like anything in that kit is equipped to read in analog signals. Those boards all appear to have a lot of digital I/O but nothing analog.

  • I'm looking into getting a PCF8591 AD DA board ([link]wvshare.com/product/PCF8591-AD-DA-Board.htm[/link]) as the DVK511 has an I2C (that I also use for my RTC); thoughts?
    – linuxgnuru
    Jul 19, 2014 at 18:22
  • Check to make sure that the I2C interface can operate at 3.3 V. If it's 5 V only, interfacing would be a headache. I don't know if any of the boards you have have I2C level shifting.
    – krs013
    Jul 19, 2014 at 18:25
  • According to the schematic (and the photo: wvshare.com/img/devkit/accBoard/DVK511/DVK511-intro.jpg ) the I2C on the DVK511 is 3.3v
    – linuxgnuru
    Jul 19, 2014 at 18:28
  • Right, so the DVK511 can interface with the rpi via I2C, but the real question is whether the PCF8591 uses 3.3 V or 5 V. It's common for I2C devices to have a separate VCCIO level for I2C, so I imagine it can work, but I would recommend double-checking.
    – krs013
    Jul 19, 2014 at 18:31
  • Found the answer here (wiringpi.com/extensions/i2c-pcf8591) and it is 3.3v (yay!)
    – linuxgnuru
    Jul 19, 2014 at 18:45

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.