• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomeArduinoAdvanced Learning Kit for ArduinoArduino Temperature Sensor Kit
Previous Next

Arduino Temperature Sensor Kit

Posted by: admin , August 26, 2014

[vc_row][vc_column][vc_column_text]Picture of Arduino Temperature Sensor Kit

This kit is designed to have the 4×7 segment display which displays the temperature mounted directly on the Arduino board. The
3-pin wire leads connect a thermistor to an analog pin on the Arduino. Once the Arduino is programmed, a 9-volt battery can supply
the power. The thermistor can be replaced with other types of sensors and the Arduino can be reprogrammed to display those sensor value readings.

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Step 1: Parts list” tab_id=”1409042861-1-31″][vc_column_text]Thermistor

3-pin female with wire lead

10 k ohm resistor

Arduino mini pro

6-pin header

9-volt clip

9v battery

Required tools and part:

Sold and soldering  iron

FTDI cable or FTDI breadout and USB cable  (to program Arduino)

Arduino software

4 x 7 segment display (COM-09482)[/vc_column_text][/vc_tab][vc_tab title=”Step 2: Arduino Mini” tab_id=”1409042861-2-24″][vc_column_text]Picture of Arduino Mini

Look at the Arduino and familiarize yourself with the orientation vocabulary used in these steps.  This project uses the Arduino Mini Pro.  Other arduino boards will be able to perform in this project but the mini allows for a compact design.[/vc_column_text][/vc_tab][vc_tab title=”Step 3: Power and Data connections” tab_id=”1409042976959-2-10″][vc_column_text]Picture of Power and Data connections

The supply power, sensor power and data wire leads are connected in these pins from the back side of the arduino.  The ground leads for the sensor and the power supply can be connected together and soldered into the GND pin.  The power supply positive lead is soldered into the RAW pin.  The sensor voltage lead is soldered into the VCC pin.  The data lead is soldered into the A3 pin.  Soldering them in through the back of the arduino will keep them from hindering the placement of the 7-segment display.[/vc_column_text][/vc_tab][vc_tab title=”Step 4: Sensor” tab_id=”1409042978666-3-2″][vc_column_text]

Picture of Sensor
Wrap one end of resistor to one leg of the thermistor, solder and trim leads.
the thermistor/resistor module does not need to be soldered into the 3-pin clip. When inserted into the clip end of the 3-pin clip, the
bare thermistor leg should connect to the BLACK wire, the resistor leg should connect to the RED wire and the thermistor leg that has the resistor soldered should connect to the DATA wire (the DATA wire could be YELLOW, WHITE or even BLUE)

[/vc_column_text][/vc_tab][vc_tab title=”Step 5: Arduino Header Pins” tab_id=”1409044683815-4-0″][vc_column_text]

Picture of Arduino Header Pins
Attach the header pins to the arduino on the front right side of the arduino.  These pins will be used with the FTDI cable to program the arduino.

[/vc_column_text][/vc_tab][vc_tab title=”Step 6: 7-Segment Pins” tab_id=”1409044715372-5-7″][vc_column_text]

Picture of 7-Segment Pins
Bend pins out flat then straight again so the footprint is wide enough to fit in the Arduino holes. you will also need to bend the #9 pin
so it fits in the GND hole on the TOP FRONT of the Arduino.

[/vc_column_text][/vc_tab][vc_tab title=”Step 7: 7-Segment Ground Pin” tab_id=”1409044778119-6-9″][vc_column_text]

Picture of 7-Segment Ground Pin
Align the 7 segment display so the pins fit the Arduino holes and confirm that the #9 pin on the 7 segment display fits in the GND hole
on the FRONT TOP of the Arduino.

[/vc_column_text][/vc_tab][vc_tab title=”Step 8: Program Arduino” tab_id=”1409044793732-7-6″][vc_column_text]

Picture of Program Arduino

Connect your computer to the Arduino with your FTDI connection and upload the thermistor program (source program included here made up of parts taken from samples online)

int Ai5 = A5;
int Value5;
boolean hb = HIGH;
int hbCNT = 0;
int digit1 = 10; // 11; //PWM Display pin 1
int digit2 = 11; // 10; //PWM Display pin 2
int segD = 12; // A1; // 5; //Display pin 3
//not used 13; // pin 4
int segE = A0; // A0; //Display pin 5
int digit3 = A1; // 12; // 9; //PWM Display pin 6
int dp3 = A2; // 9; // 12;
Step 11 - 7 segment BOTTOM
Confirm the pins on the 7 segment display fit in the holes on the BOTTOM FRONT of the Arduino.
int digit4 = A3; // 13; // 6; //PWM Display pin 8
int segB = 9; // 3; //Display pin 16
int segG = 8; //Display pin 15
int segA = 7; //5; // A1; //Display pin 14
int segC = 6; // 4; //Display pin 13
//not used 5; // pin 12
int segF = 4; // 7; // 7; //Display pin 11
int dphb = 3; // A3; pin 10
// GND // pin 9
void setup() {
pinMode(segA, OUTPUT);
pinMode(segB, OUTPUT);
pinMode(segC, OUTPUT);
pinMode(segD, OUTPUT);
pinMode(segE, OUTPUT);
pinMode(segF, OUTPUT);
pinMode(segG, OUTPUT);
pinMode(digit1, OUTPUT);
pinMode(digit2, OUTPUT);
pinMode(digit3, OUTPUT);
pinMode(digit4, OUTPUT);
pinMode(dp3, OUTPUT);
pinMode(Ai5,INPUT);
Serial.begin(9600);
Serial.println();
}
void loop()
{
//show temp
displayNumber(Value5);
//show heartbeat
if (!(hbCNT % 100)) hb=!hb;
//query temp
if (hbCNT++ > 300)
{
hbCNT = 1;
//store thermistor resistance value
Value5 = analogRead(Ai5); //Read the value of AI1 (pin2) and write it to Value1
Serial.print(Value5);
Serial.print(" [] ");
Serial.print( 1000/(float(1023 / float(Value5)) -1));
float steinhart, average;
average = 1023 / float(Value5) - 1;
average = 10000 / average;
steinhart = average / 1000; // (R/Ro)
steinhart = log(steinhart); // ln(R/Ro)
steinhart /= 3636; // 1/B * ln(R/Ro)
steinhart += 1.0 / (25 + 273.15); // + (1/To)
steinhart = 1.0 / steinhart; // Invert
Serial.print(" [] ");
Serial.print(average);
Serial.print(" [k] ");
Serial.print(steinhart);//kelvin
Serial.print("

[c][/c]

");//celcius steinhart -= 273.15; Serial.print(steinhart); Serial.print(" [f] ");//fahrn steinhart = steinhart * 9 / 5 + 32; Serial.print(steinhart); Serial.print(" ||| "); Value5 = steinhart*10; Serial.println(Value5); } } void displayNumber(int toDisplay) { #define DISPLAY_BRIGHTNESS 500 #define DIGIT_ON HIGH #define DIGIT_OFF LOW long beginTime = millis(); for(int digit = 4 ; digit > 0 ; digit--) { digitalWrite(dp3, HIGH); //Turn on a digit for a short amount of time switch(digit) { case 1: digitalWrite(digit1, DIGIT_ON); break; case 2: digitalWrite(digit2, DIGIT_ON); break; case 3: digitalWrite(digit3, DIGIT_ON); digitalWrite(dp3, !hb); break; case 4: digitalWrite(digit4, DIGIT_ON); break; } digitalWrite(dphb, !hb); //Turn on the right segments for this digit lightNumber(toDisplay % 10); toDisplay /= 10; delayMicroseconds(DISPLAY_BRIGHTNESS); //Display this digit for a fraction of a second (between 1us and 5000us, 500 is pretty good) //Turn off all segments lightNumber(10); //Turn off all digits digitalWrite(digit1, DIGIT_OFF); digitalWrite(digit2, DIGIT_OFF); digitalWrite(digit3, DIGIT_OFF); digitalWrite(digit4, DIGIT_OFF); } while( (millis() - beginTime) < 10) ; //Wait for 20ms to pass before we paint the display again } //Given a number, turns on those segments //If number == 10, then turn off number void lightNumber(int numberToDisplay) { #define SEGMENT_ON LOW #define SEGMENT_OFF HIGH switch (numberToDisplay){ case 0: digitalWrite(segA, SEGMENT_ON); digitalWrite(segB, SEGMENT_ON); digitalWrite(segC, SEGMENT_ON); digitalWrite(segD, SEGMENT_ON); digitalWrite(segE, SEGMENT_ON); digitalWrite(segF, SEGMENT_ON); digitalWrite(segG, SEGMENT_OFF); break; case 1: digitalWrite(segA, SEGMENT_OFF); digitalWrite(segB, SEGMENT_ON); digitalWrite(segC, SEGMENT_ON); digitalWrite(segD, SEGMENT_OFF); digitalWrite(segE, SEGMENT_OFF); digitalWrite(segF, SEGMENT_OFF); digitalWrite(segG, SEGMENT_OFF); break; case 2: digitalWrite(segA, SEGMENT_ON); digitalWrite(segB, SEGMENT_ON); digitalWrite(segC, SEGMENT_OFF); digitalWrite(segD, SEGMENT_ON); digitalWrite(segE, SEGMENT_ON); digitalWrite(segF, SEGMENT_OFF); digitalWrite(segG, SEGMENT_ON); break; case 3: digitalWrite(segA, SEGMENT_ON); digitalWrite(segB, SEGMENT_ON); digitalWrite(segC, SEGMENT_ON); digitalWrite(segD, SEGMENT_ON); digitalWrite(segE, SEGMENT_OFF); digitalWrite(segF, SEGMENT_OFF); digitalWrite(segG, SEGMENT_ON); break; case 4: digitalWrite(segA, SEGMENT_OFF); digitalWrite(segB, SEGMENT_ON); digitalWrite(segC, SEGMENT_ON); digitalWrite(segD, SEGMENT_OFF); digitalWrite(segE, SEGMENT_OFF); digitalWrite(segF, SEGMENT_ON); digitalWrite(segG, SEGMENT_ON); break; case 5: digitalWrite(segA, SEGMENT_ON); digitalWrite(segB, SEGMENT_OFF); digitalWrite(segC, SEGMENT_ON); digitalWrite(segD, SEGMENT_ON); digitalWrite(segE, SEGMENT_OFF); digitalWrite(segF, SEGMENT_ON); digitalWrite(segG, SEGMENT_ON); break; case 6: digitalWrite(segA, SEGMENT_ON); digitalWrite(segB, SEGMENT_OFF); digitalWrite(segC, SEGMENT_ON); digitalWrite(segD, SEGMENT_ON); digitalWrite(segE, SEGMENT_ON); digitalWrite(segF, SEGMENT_ON); digitalWrite(segG, SEGMENT_ON); break; case 7: digitalWrite(segA, SEGMENT_ON); digitalWrite(segB, SEGMENT_ON); digitalWrite(segC, SEGMENT_ON); digitalWrite(segD, SEGMENT_OFF); digitalWrite(segE, SEGMENT_OFF); digitalWrite(segF, SEGMENT_OFF); digitalWrite(segG, SEGMENT_OFF); break; case 8: digitalWrite(segA, SEGMENT_ON); digitalWrite(segB, SEGMENT_ON); digitalWrite(segC, SEGMENT_ON); digitalWrite(segD, SEGMENT_ON); digitalWrite(segE, SEGMENT_ON); digitalWrite(segF, SEGMENT_ON); digitalWrite(segG, SEGMENT_ON); break; case 9: digitalWrite(segA, SEGMENT_ON); digitalWrite(segB, SEGMENT_ON); digitalWrite(segC, SEGMENT_ON); digitalWrite(segD, SEGMENT_ON); digitalWrite(segE, SEGMENT_OFF); digitalWrite(segF, SEGMENT_ON); digitalWrite(segG, SEGMENT_ON); break; case 10: digitalWrite(segA, SEGMENT_OFF); digitalWrite(segB, SEGMENT_OFF); digitalWrite(segC, SEGMENT_OFF); digitalWrite(segD, SEGMENT_OFF); digitalWrite(segE, SEGMENT_OFF); digitalWrite(segF, SEGMENT_OFF); digitalWrite(segG, SEGMENT_OFF); break; } }

[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]

Tags: Advanced Learning Kit for Arduino, Arduino

Share!
Tweet

admin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors