Kit Instructions

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Temperature sensor kit

PART NO. 2184579

This kit is designed to have the 4x7 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.

Time Required: 1 hr depending on experience


Experience Level: Beginner
Required tools and parts:
Solder and soldering iron
FTDI cable or FTDI Breakout and USB cable (to program Arduino)
Arduino software
4x7 segment display(COM-09482)

Bill of Materials:

Qty Jameco SKU Component Name


1 207483 Thermistor
1 2143881 3-Pin Female with wire lead
10 2157167 10k ohm resistor
1 2157765 Arduino Mini Pro
1 153700 6-Pin header
1 11280 9-volt clip
1 151095 9V Battery

Step 1 - Arduino

Look at the Arduino and familiarize yourself with the orientation vocabulary used in these steps
Step 2 - Wire placement view from FRONT

Identify the location for the wire placements on the Arduino

Step 3 - 9-volt red

Trim the red lead from the 9-volt clip, insert from the BOTTOM and solder it to the RAW hole on the arduino

Step 4 - 9-volt and 3-pin GND

Trim black leads from both the 3-pin connector and the 9-volt clip, twist the wires together, insert into the GND hole from the
BOTTOM of the Arduino and solder
Step 5 - 3-pin red

Trim red lead from 3-pin connector, insert from the BOTTOM of the Arduino into the Vcc hole and solder

Step 6 - 3-pin DATA

Trim and insert the DATA lead from the 3-pin connector into the A5 hole on the Arduino from the BOTTOM

Step 7 - Thermistor prep

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)
Step 8 - 6-pin header

Insert the 6-pin header through the holes on the RIGHT side of the Arduino from the FRONT and solder on the BACK in place

Step 9 - 7 segment display prep

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.

Step 10 - 7 segment TOP

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.
Step 11 - 7 segment BOTTOM

Confirm the pins on the 7 segment display fit in the holes on the BOTTOM FRONT of the Arduino.

Step 12 - 7 segment display

With the 7 segment display in place by inserting through the FRONT of the Arduino, solder the pins from the BACK of the Arduino.
Be sure to maintain clearance between the pins on the 7-segment display and surface components on the Arduino.

Step 13 - 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)
-----------------------------------------

#include
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;
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] ");//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;
}
}

You might also like