MCP3008 Raspberry Pi Breakout hat
Howdy Y’all Back when I was working on the Raspberry Pi portable emulator that became the backseat system. I thought that I would want to use an analog joystick like several of the other builds. However I was trying to get it to work via the GPIO instead of USB bus.
Unfortunately mid build I decided that a dedicated USB controller would be better for my Emulator console. However I still tinkered with the analog to digital conversion circuit using the MCP3008. Although I never finished up the control interface for emulators perhaps someone would want to add a rheostat or a analog sensor for a robot circuit or a self watering plant or something.
I am going to take you through building the circuit on a breadboard. Give a quick overview of v1 on a prototype board. Finishing with the assembly of a version 2 of my breakout board design. Version 3 removed the resistor provision as it caused more problems than it was worth.
If you want to skip the breadboarding and prototype stage and get right to it, The PCB’s are available on 123d circuits. Or you can use the attached gerber files to fabricate your own boards.
This is the link to version 3 of the board. on 123D Circuits.
Some notes on the design of my breakout board. Channels 0-7 are labeled as such on the solder mask. and I used the center rail as the jumper selectable power 3v3 or 5v. with Ground/negative on the far outside edge. The reasoning for this is like a RC servo Power is the center pin. The idea is if you wire your sensor into a 3 pin socket like cannot be plugged in backwards and fry your sensor.
This is a true open source project, share and share alike. If you make it into a viable product, groovy more power too ya. Just make sure to toss a nod out to the MoTinkerGNome when you make it big. I am compensated in no way by autodesk instructables or 123D Circuits. However in to have truth in disclosure 123D circuits did send me a T-shirt as a customer courtesy due to a issue in shipping, but that is neither here or there.
I am going to assume that you have the ability to solder.
I am also going to assume that you have the ability to program in C or Python
The difficulty of this project would be considered intermediate but the application of the final board would be considered advanced.
THIS IS NOT A BEGINNER PROJECT!
- Revision 2 or newer Raspberry Pi
- Stuff to make the pie work SD card, power supply etc etc.
- MCP3008 ADC chip https://www.adafruit.com/products/856 $3.75
- 26 pin Stacking header. https://www.adafruit.com/products/1112 $1.95
- Break away Pinheaders https://www.adafruit.com/products/392 $4.95
- 2 jumper shunts. . http://www.ebay.com/itm/50pcs-Computer-Mobo-CD-DVD… ( that listing is 50 fo$2.50)
- (optional) if you want to stack 2 you will need right angle headers https://www.adafruit.com/products/816 $2.95
- (optional) 16 pin IC Socket. https://www.adafruit.com/products/220 $1
Step 1: Breadboard the circuit
Give a look through the following pages… Go ahead Ill wait…
Now you understand what is going on with what needs to happen.
- Activate SPI
- Install SPI-Dev
- assemble the breadboard circuit Like the first 2 tutorials.
I wired up my breadboard pretty much in the exact same manner as the second page on how to use a joystick with the pi. As you can see from my pictures This little one button joystick seemed to work well and I would have went with this for my handheld if I could have gotten it thin enough for a 4 yr old to hold.
For the first protoboard I basically copied the breadboard circuit directly over to a proto soldering board. The version 1 board shown is a MCP3008 hooked up to the Pi like on a breadboard in the tutorials. The first row of 8 pins along the bottom edge are Channels 0-7 with the ground rail.
I did not have a power rail at this point and while the resistor was a great idea for testing individual sensors when I used multiple sensors in version 2 my readings went haywire. Basically this picture is shown just to add more documentation to the project.
For more detail: MCP3008 Raspberry Pi Breakout hat