Bus Pirate Edu Kit Exercise no.3
From DP
Contents |
Overview
In this exercise we'll read the MCP9701A analog temperature sensor. The device outputs a voltage proportional to it's current case temperature. The Bus Pirate will use it's analog to digital converter to display a value between 0 and 1023.
The Circuit
This excercise only requires us to connect the 3 pins of the MCP9701A to the Bus Pirate. We just need to provide power from the 5V power supply pin and read the voltage with the ADC pin.
The result is formulated as ADC pin voltage = (result * 6.6v)/1024
Breadboard legend
| IC Location | Breadboard wiring legend | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
- The (+) and (-) next to PIN1 and PIN2 are intended for devices such as LEDs, where PIN1 should be the anode and connected to a higher potential then PIN2.
Bus Pirate Terminal
Connect the Bus pirate and activate the terminal window. Here's a tutorial on how to connect the Bus Pirate, and activate the Terminal window, if you haven't already please check it out now.
HiZ>m<<<the mode command
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
x. exit(without change)
(1)>8<<<LCD mode
Ready
LCD>W<<<power supplies ON
POWER SUPPLIES ON
First we enter the LCD mode, activate the power supplies with the 'W' command. We have to do this as the 'W' command is unavailable in the HiZ mode.
LCD>d<<<single ADC pin voltage read
VOLTAGE PROBE: 0.92V
Now all you have to do is read the voltage on the ADC pin with the 'd' command. 0.92V is the voltage level our room temperature gave during test.
LCD>m<<<the mode command
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
x. exit(without change)
(1)>1<<<return to HiZ mode
Ready
HiZ>
To exit simply switch back to the HiZ mode.
Not Working?
- If you are getting strange readings, the most probably cause is faulty wiring. Wiggle the connections around and check it stabilizes.
- If you are still having problems, feel free to contact us through our contact form, or ask in the forum.
Taking it further
To check that it really does react to temperature, you could introduce a heat source next to the IC, and the read voltage should rise. Recommended heat sources are your hands, or a cup of hot coffee or tea, Please don't use an open flame.
LCD>D<<<constant ADC pin voltage read
VOLTMETER MODE
Any key to exit
VOLTAGE PROBE: 0.90V
By using the D command you activate constant voltage monitoring of the ADC pin. This way you can see the voltage change with the temperature instantly.
