INPUT DEVICEZ

In this class’ lecture we learnt about the very fundamental components of any working electronic system , which are sensors.
There are different types of sensors:

  1. Light
  2. Sound
  3. Temperature
  4. Fluids
  5. Electricity & Magnetism
  6. Motion
  7. Proximity/Distance
    Though for my Final projects I intend to work with Proximity sensors to avoid clashes. For which Nathan suggested the use of Ultrasonic sensors which weren’t available in the lab at the time!
    i took the time to learn about Temperature sensors! I found the idewa of a a sensor working with the help of Temperature sensitivity to be really cool! circuit
    I designed my circuit as above to allow the Thermistor to detect any change in temperature and report it on the serial monitor! It worked out perfectly!
    I had to apply the Steinhart-Hart equation into the program:
    The Steinhart–Hart equation is a model of the resistance of a semiconductor at different temperatures. The equation is
    The equation is often used to derive a precise temperature of a thermistor, since it provides a closer approximation to actual temperature than simpler equations, and is useful over the entire working temperature range of the sensor. Steinhart–Hart coefficients are usually published by thermistor manufacturers.

Where Steinhart–Hart coefficients are not available, they can be derived. Three accurate measures of resistance are made at precise temperatures, then the coefficients are derived by solving three simultaneous equations.
equation
The program worked properly after a few corrections in my resistance measurement! I did forget how to use the multimeter :P … It worked out well towards the end after all the debugging! I needed to know the correct resistance value which caused an error at first and I was gernating values on a scale of 300, then after searching up the error in the code I was able to recieve the room temperature!


The link to my code is here: ]
code
I then inTegrated my codew with a motor
int ThermistorPin = 0;
int Vo;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;

int motorPin = 10;

void setup() {
Serial.begin(9600);
}

void loop() {

Vo = analogRead(ThermistorPin);
R2 = R1 * (1023.0 / (float)Vo - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2logR2 + c3logR2logR2logR2));
T = T - 273.15;
T = (T * 9.0)/ 5.0 + 32.0;
if (T <= 90) {
analogWrite(motorPin, HIGH);
}
else if (T>90) {
analogWrite(motorPin, LOW);
}
Serial.print(“Temperature: “);
Serial.print(T);
Serial.println(“ F”);


delay(500); }

I spent the remaining of my time in designing parts for my final project! Updates regarding which can always be found in the final project page :D
As usual there was a lot of new things for me to learn from Proffesor Rob as well as my classmates! I hope to apply what I learnt on to my final project model!

Click to download my STL file