living with the lab - Louisiana Tech University

Download Report

Transcript living with the lab - Louisiana Tech University

living with the lab
temperature
system wiring
ENGR 121
transistor
© 2013 David Hall
relay
power resistor
living with the lab
DISCLAIMER & USAGE
The content of this presentation is for informational purposes only and is intended only for students
attending Louisiana Tech University.
The author of this information does not make any claims as to the validity or accuracy of the information
or methods presented.
Any procedures demonstrated here are potentially dangerous and could result in injury or damage.
Louisiana Tech University and the State of Louisiana, their officers, employees, agents or volunteers, are
not liable or responsible for any injuries, illness, damage or losses which may result from your using the
materials or ideas, or from your performing the experiments or procedures depicted in this presentation.
If you do not agree, then do not view this content.
The copyright label, the Louisiana Tech logo, and the “living with the lab” identifier should not be removed
from this presentation.
You may modify this work for your own purposes as long as attribution is clearly provided.
2
living with the lab
5V
thermistor circuit and program
If you have not done so already
• waterproof your thermistor
• create the voltage divider circuit shown
• enter the sketch below to make sure the
thermistor is working
• if the soldering irons are busy, then go to the
next slide and begin building control circuit
thermistor
analog input 4
(measures voltage across thermistor)
10kΩ
int val = 0;
// variable to store circuit output
void setup() {
Serial.begin(9600);
}
//
void loop() {
val = analogRead(4);
Serial.println(val);
}
// read the 0 to 1023 integer from analog pin 4
// print value to serial monitor
set up the serial display
living with the lab
temperature control circuit
Build this circuit. Write a sketch that reads the analog input from the thermistor circuit and displays
the 0 to 1023 value on your computer monitor. Then, modify the program to make the LED go off
when you heat the thermistor up by holding it between your fingers; the LED should come on when
the thermistor cools back toward room temperature. That is, include an “if” statement that makes the
LED come on when the analog input is less than a number (such as 500, but you’ll need to pick a
number that works). This will be very similar to the program that you use to turn on the heater when
the temperature drops below the setpoint. This is also one of your homework problems for next time.
5V
5V
Arduino
digital pin
+
12VDC
power
supply
C
thermistor
-
B
1kΩ
analog input
E
10kΩ
coil
normally open
contacts
SPST relay
solenoid
470W
valve
20W
heater to be
added later
You can replace the LED and 470Ω resistor with the heather (the 20Ω waterproofed
resistor provided by your instructor) after the LED is working well. NEVER have the
heater plugged in (or turned on) unless your fishtank is full of water.