0% found this document useful (0 votes)
123 views

Online Experiment 2 Temperature Sensors: Procedure: 1. Create An Account In: 2. Create This Circuit

This document provides instructions for an online experiment using a temperature sensor circuit in Tinkercad. Students are asked to: 1. Create a Tinkercad account and build a circuit with a temperature sensor and 220-ohm resistor. 2. Copy code to read the sensor temperature in Celsius and Fahrenheit and light LEDs when thresholds are crossed. 3. Simulate the circuit and explain how it works to measure temperature and activate lights. Identify a real-world application. 4. Submit answers individually by the deadline, indicating groupmates.

Uploaded by

Gaming User
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views

Online Experiment 2 Temperature Sensors: Procedure: 1. Create An Account In: 2. Create This Circuit

This document provides instructions for an online experiment using a temperature sensor circuit in Tinkercad. Students are asked to: 1. Create a Tinkercad account and build a circuit with a temperature sensor and 220-ohm resistor. 2. Copy code to read the sensor temperature in Celsius and Fahrenheit and light LEDs when thresholds are crossed. 3. Simulate the circuit and explain how it works to measure temperature and activate lights. Identify a real-world application. 4. Submit answers individually by the deadline, indicating groupmates.

Uploaded by

Gaming User
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

ECE132L MALAYAN COLLEGES LAGUNA

INSTRUMENTATION AND CONTROLS (LAB) ENGINEER DONOVAN PAUL U. DOROIN

Online Experiment 2 Temperature Sensors

Procedure:
1.  Create an account in:  https://www.tinkercad.com/circuits
2.  Create this circuit: 

Note:
a. The sensor is a temperature sensor
b. Set the resistor’s value to 220Ω.
ECE132L MALAYAN COLLEGES LAGUNA
INSTRUMENTATION AND CONTROLS (LAB) ENGINEER DONOVAN PAUL U. DOROIN

3. Input this code in text (not block):

(← Click to see codes)


int baselineTemp = 0;

int celsius = 0;

int fahrenheit = 0;

void setup()

pinMode(A0, INPUT);

Serial.begin(9600);

pinMode(13, OUTPUT);

pinMode(11, OUTPUT);

pinMode(9, OUTPUT);

void loop()

// set threshold temperature to activate LEDs

baselineTemp = 40;

// measure temperature in Celsius

celsius = map(((analogRead(A0) - 20) * 3.04), 0, 1023, -40, 125);

// convert to Fahrenheit

fahrenheit = ((celsius * 9) / 5 + 32);


ECE132L MALAYAN COLLEGES LAGUNA
INSTRUMENTATION AND CONTROLS (LAB) ENGINEER DONOVAN PAUL U. DOROIN

Serial.print(celsius);

Serial.print(" C, ");

Serial.print(fahrenheit);

Serial.println(" F");

if (celsius < baselineTemp) {

digitalWrite(13, LOW);

digitalWrite(11, LOW);

digitalWrite(9, LOW);

if (celsius >= baselineTemp && celsius < baselineTemp + 40) {

digitalWrite(13, HIGH);

digitalWrite(11, LOW);

digitalWrite(9, LOW);

if (celsius >= baselineTemp + 40 && celsius < baselineTemp + 80) {

digitalWrite(13, HIGH);

digitalWrite(11, HIGH);

digitalWrite(9, LOW);

if (celsius >= baselineTemp + 80 && celsius < baselineTemp + 120) {

digitalWrite(13, HIGH);

digitalWrite(11, HIGH);

digitalWrite(9, HIGH);

if (celsius >= baselineTemp + 120) {

digitalWrite(13, HIGH);

digitalWrite(11, HIGH);

digitalWrite(9, HIGH);

}
ECE132L MALAYAN COLLEGES LAGUNA
INSTRUMENTATION AND CONTROLS (LAB) ENGINEER DONOVAN PAUL U. DOROIN

delay(100); // Wait for 1000 millisecond(s)

4. Simulate the circuit. Slide the temperature on the sensor left and right.
5. Explain the operation of the circuit. Don’t forget to mention the purpose of the sensor.
6. Identify an application of this circuit that is relevant in your program.

Instructions:

 Please submit this word file with your answers on or before May 23 (Sat).
 Only 1 member per group will be required to submit in BBL. Please indicate names of all
groupmates in alphabetical order
 Please do not meet up with your groupmates. You may communicate online
 Laboratory report will now be done individually. Please submit yours through BBL.
o Filename: Course_Section_Lastname_Firstname_Exp#

You might also like