Bus Pirate Edu Kit Exercise no.3

From DP

Jump to: navigation , search

BP EK E3 overview2.jpg

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

BP EK E3 schematic.jpgBP EK E3 circuit1.jpg

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
IC PIN1 (+) PIN2 (-)
MCP9701A E1 E2
Signal name Contact1 Contact2
5V BP_5V A1
TEMP BP_ADC A2
GND BP_GND A3
  • 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.