Week 9

 

Pi Experiment

ADC (Analog to Digital Chip)
MCP3008

CH0 -7 The 8 channels you wish to measure relative voltage of.  Max???
VDD (Voltage at the drain) Powers the chip 5V Max 7V
VREF Voltage of the thing you are measuring 5V Max ????
AGND Analog ground.  The Ground of the circuit you are measuring the voltage of
CLK Clock  Syncs the output of the chip with the input of the Pi
DOUT Where the digital signal comes out
DIN Used to load channel information to the chip.
!CS/SHDN Used to turn on and off the chip (Normal convention is to show CS active low with a bar above but I could not get that using my blogging tool and css was going to far so I used the lesser known convention)
DGND Used to connect to the digital inputs ground.

What comes out of DOUT.  A series of 1's and 0's which represent a number relative to the VRef max.
MCP is a 10 bit output (depends on chip) if the CH0 voltage out is 5V and the VREF is 5V then the DOUT will be 1111111111 meaning a max 1023 out of 1023

Understanding the MCP3008

Raspberry Pi does not understand the MCP3008 chip by default you need to load the libraries required.

sudo apt update
sudo apt install python3-gpiozero


Making sure SPI is enabled.

sudo raspi-config

3 Interface Options
SPI Enabled-> Finished

Connections


Experiment 1 Potentiometer


Experiment 2 Photo Resistor

How a Voltage Divider Works




VOut (Measured at CH0) = Vin x R2/(R1 +R2)
                                            = 5V x 5000/(10000+5000)
                                            = 1.67 V


Programming


Using Pip to find and use another MCP3008 library.


Next Week

That's all folks.


Comments

Popular posts from this blog

Week 4

Github and code

Week 1