Difference between revisions of "ADC (MCP3002) + Raspberry Pi 2"

From ESE205 Wiki
Jump to navigation Jump to search
Line 1: Line 1:
#'''Locate SPI pins on the Raspberry Pi''' - For this 8 pin ADC you will require the MOSI, MISO, and SCLK pins for timing and general communication between the ADC and Pi board. Follow the diagram to connect correctly to the board.  
+
=Wiring the ADC=
#'''Hook up to power''' - Then you can hook up the voltage to a 3.3V pin and the ground to a GND pin for general power.
+
#'''Locate SPI pins on the Raspberry Pi''' - In order to properly locate pins on the ADC you must be looking at it right side up. There is a small diet in the top and while that is facing up you may follow the visuals posted here. For the Serial Peripheral Device hookup you will require four SPI pins MOSI, MISO, and SCLK pins for timing and general communication between the ADC and Pi board, and the CS0 pin for receiving the data. Follow the diagram to connect correctly to the board.  
 +
#'''Hook up to power''' - You man hook up the voltage to a 3.3V pin as long as your data sheet does not say otherwise, and the ground to a GND pin for general power.
 
#'''Wire up analog input''' - To read analog data through the ADC you have to connect CH0 to your analog source. We only used CH0 so we connected CH1 to the ground as to not confuse data. For the analog photocell input we built a voltage divider to pull up the analog signal when receiving light. We matched the resistance of the voltage divider with the theoretical minimum voltage of the photocell.
 
#'''Wire up analog input''' - To read analog data through the ADC you have to connect CH0 to your analog source. We only used CH0 so we connected CH1 to the ground as to not confuse data. For the analog photocell input we built a voltage divider to pull up the analog signal when receiving light. We matched the resistance of the voltage divider with the theoretical minimum voltage of the photocell.
#'''Connecting to the board''' -  Finally you connect the ADC to the Raspberry Pi from the CS pin to the CS0 serial peripheral pin on the Raspberry Pi board.
+
[[File:RP2 Pinout.png|1000px|thumb|left|Raspberry Pi 2 Model B pin layout]]
 +
 
 +
[[File:ADC schem.png|1000px|thumb|left|Connections from the ADC to the Raspberry Pi, ignore pin layout of cobbler and use pin layout of diagram above.]]
 +
 
 +
Make sure that whatever analog device you are using is hooked up to the right pin of the ADC and that it has resistors to prevent damaged circuitry.
 +
 
 +
=Programming the ADC=
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
  
  
 
[[Category:HowTos]]
 
[[Category:HowTos]]

Revision as of 22:37, 3 May 2016

Wiring the ADC

  1. Locate SPI pins on the Raspberry Pi - In order to properly locate pins on the ADC you must be looking at it right side up. There is a small diet in the top and while that is facing up you may follow the visuals posted here. For the Serial Peripheral Device hookup you will require four SPI pins MOSI, MISO, and SCLK pins for timing and general communication between the ADC and Pi board, and the CS0 pin for receiving the data. Follow the diagram to connect correctly to the board.
  2. Hook up to power - You man hook up the voltage to a 3.3V pin as long as your data sheet does not say otherwise, and the ground to a GND pin for general power.
  3. Wire up analog input - To read analog data through the ADC you have to connect CH0 to your analog source. We only used CH0 so we connected CH1 to the ground as to not confuse data. For the analog photocell input we built a voltage divider to pull up the analog signal when receiving light. We matched the resistance of the voltage divider with the theoretical minimum voltage of the photocell.
Raspberry Pi 2 Model B pin layout
Connections from the ADC to the Raspberry Pi, ignore pin layout of cobbler and use pin layout of diagram above.

Make sure that whatever analog device you are using is hooked up to the right pin of the ADC and that it has resistors to prevent damaged circuitry.

Programming the ADC