PICAXE Raspberry Pi ADC

 by AntMan232
IMG_20121023_125107.jpg
In this instructable I will show you how to use a cheap PICAXE micro-controller as a multiple channel analogue to digital converter. We will be using I2C to access the PICAXE, which will be writing the adc values into the memory registers. 

The Raspberry Pi does not have a built in ADC, which is unhelpful if you need to read any kind of analogue value, such as a variable resistor position or a light level etc. PICAXE is a line of cheap microcontrollers, designed to be easy to use for school children. This means they are easy to use, and you may have one lying in a draw. This instructable will show you how to use one as an ADC, but by writing values to it, you could conceivably use one as a port expander at the same time. 
 
Remove these adsRemove these ads by Signing Up

Step 1: Set Up Pi

IMG_20121023_125107.jpg
You will need to set up the pi for i2c for this instructable, which is explained in another of my instructables, here: Set up i2c . You need to get up to the point of running i2cdetect. 
e024576 says: Dec 1, 2012. 5:12 PM
regarding ... WARNING: I will be connecting 5V logic to the Pi 3.3V pins. This has caused no damage, but I am not responsible if it breaks yours.

I think newer PICAXE chips, the M2 series, can run at 3.3 volts, so would that solve this potential concern?

I'm very interested in simplest way to get Pi and PICAXE talking, here's some discussion regarding serial comm ...

http://www.picaxeforum.co.uk/showthread.php?21686-Raspberry-Pi-Picaxe-Serial-Interfacing&highlight=raspberry+pi

Do you have any opinions on this?

Thanks
amandaghassaei says: Nov 1, 2012. 2:06 PM
this is a great work around, I was bummed about the lack of adc on the pi as well
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!