Raspberry Pi – Reading Analogue inputs…

Part 1:

This is a tutorial on how to read analogue inputs on your Raspberry Pi using a PCF8591 analogue to digital converter…

Make sure to watch part 2!

Please subscribe and check out my other videos:
http://www.youtube.com/user/TheRaspberryPiGuy?feature=mhee

Happy Piing
The Raspberry Pi Guy
theraspberrypiguy@gmail.com

Part 2:

This is a tutorial on how to read analogue inputs on your Raspberry Pi using a PCF8591 analogue to digital converter…

Make sure to watch part 1 first!

Check out my other videos:
http://www.youtube.com/user/TheRaspberryPiGuy?feature=mhee

Necessary links and commands:

Datasheet for the PCF8591 (PDF) : http://astro.temple.edu/~cvecchio/PCF8591_6.pdf

Raspberry Pi’s GPIO layout: http://cdn.instructables.com/FJA/5B1M/H2WERJ0U/FJA5B1MH2WERJ0U.LARGE.jpg

Commands and code used: (All credit has to go to forum member: Grumpy Mike)

All the commands and code are covered in this forum post:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=42&t=14093&p=146643&hilit=PCF8591#p146643
If you have any problems or would like me to write out the code do not hesitate to comment or email me!

Happy Piing
The Raspberry Pi Guy
theraspberrypiguy@gmail.com

NOTE: Somebody figured this out for me!:

This might be useful to mention : Your tutorial is for a Rev1 Pi. People who have a Rev2 Pi need to change the bus ID from bus = SMBus(0) to bus = SMBus(1) otherwise they will get an IOError since the bus has changed from Rev1 to Rev2. To fix the “Stuck on 128” problem several people mentioned in the comments : Do not connect the OSC (Pin 11) of the PCF8591 to ground simply leave it unconnected and the problem should be solved.
Photo resistor: http://roguescience.org/wordpress/wp-content/uploads/2011/07/photoresistor.png