Beruflich Dokumente
Kultur Dokumente
http://learn.adafruit.com/reading-a-analog-in-and-control...
Overview Connecting the Cobbler to a MCP3008 Necessary Packages Python Script Run It Download PDF
Analog Inputs for Raspberry Pi Using the Full sized breadboard MCP3008
Convert analog inputs to digital and control audio volume Overview Connecting the Cobbler to a MCP3008 Necessary Packages Python Script Run Itto Cart $7.95 Add Half-size breadboard Single Page Download PDF Feedback? Corrections?
1 of 6
16/10/13 20:38
http://learn.adafruit.com/reading-a-analog-in-and-control...
$14.95 Add to Cart Adafruit Assembled Pi Cobbler Breakout + Cable for Raspberry Pi
Your E-mail:
http://learn.adafruit.com/reading-a-analog-in-and-control...
Wiring Diagram
In order to read analog data we need to use the following pins: VDD (power), DGND (digital ground) to power the MCP3008 chip. We also need four 'SPI' data pins: DOUT (Data Out from MCP3008), CLK (Clock pin), DIN (Data In from Raspberry Pi), and /CS (Chip Select). Finally of course, a source of analog data, we'll be using the basic 10k trim pot.
3 of 6
16/10/13 20:38
http://learn.adafruit.com/reading-a-analog-in-and-control...
The MCP3008 has a few more pins we need to connect: AGND (analog ground, used sometimes in precision circuitry, which this is not) connects to GND, and VREF (analog voltage reference, used for changing the 'scale' - we want the full scale so tie it to 3.3V) Below is a wiring diagram. Connect the 3.3V cobbler pin to the left + rail and the GND pin to the right - rail. Connect the following pins for the MCP chip MCP3008 MCP3008 MCP3008 MCP3008 MCP3008 MCP3008 MCP3008 MCP3008 VDD -> 3.3V (red) VREF -> 3.3V (red) AGND -> GND (black) CLK -> #18 (orange) DOUT -> #23 (yellow) DIN -> #24 (blue) CS -> #25 (violet) DGND -> GND (black)
Next connect up the potentiometer. Pin #1 (left) goes to GND (black), #2 (middle) connects to MCP3008 CH0 (analog input #0) with a gray wire, and #3 (right) connects to 3.3V (red) Advanced users may note that the Raspberry Pi does have a hardware SPI interface (the cobbler pins are labeled MISO/MOSI/SCLK/CE0/CE1). The hardware SPI interface is super fast but not included in all distributions. For that reason we are using a bit banged SPI implementation so the SPI pins can be any of the raspberry pi's GPIOs (assuming you update the script).
4 of 6
16/10/13 20:38
http://learn.adafruit.com/reading-a-analog-in-and-control...
Related Guides
Arduino Lesson 15. DC Motor Reversing Learn Arduino, Lesson 15. DC Motor Reversing
Arduino Lesson 14. Servo Motors Learn Arduino, Lesson 14. Servo Motors
5 of 6
16/10/13 20:38
http://learn.adafruit.com/reading-a-analog-in-and-control...
Adafruit Pi Cobbler Kit Assemble your Adafruit Pi Cobbler Kit About Adafruit Adafruit was founded in 2005 by MIT engineer, Limor "Ladyada" Fried. Her goal was to create the best place online for learning electronics and making the best designed products for makers of all ages and skill levels. Learn More. The Adafruit Learning System In 2012, after years of coding tutorials by hand, Limor put together a small team to build a custom tutorial management system from the ground up. The Adafruit Learning System allows us to make a wide range of awesome tutorials fast and eciently. We hope these tutorials will help you learn something new, and inspire you to make something great! Useful Stu Support Forums Adafruit Shop RSS 340 tutorials and counting Powered by Adafruit Learning Technologies
6 of 6
16/10/13 20:38