Please show me how to connect the parts together Project Description: Connect te
ID: 2248004 • Letter: P
Question
Please show me how to connect the parts together
Project Description:
Connect temperature sensor to Arduino and write code to read sensor voltage in A/D pin A0 and display the following on the serial monitor and turn on an LED when temperature is over 60 degrees C:
A/D count
Voltage reading of sensor
Temp in degrees C
Temp in degrees F
Use water heated to about 85 degrees C (almost boiling) and then cool it down with ice cubes to 0 degrees taking measurements along the way.
Use temp sensor matrix and software load on Blackboard as reference.
To be displayed on serial monitor,
“A/D count” xx
“Degrees C” xx
“Degrees F” xx
You will have to calculate the optimum resistor when creating the sensor circuit.
2. Provide the following:
a- Code listing.
Use the following in your code to convert A/D reading to degrees C:
float temperatureC = (905-(voltage/.00488))/7.6 ;//converting from A/D counts to deg C
b- Electronic Parts used:
Add list:
3- Electronic pictures of your setup.
Schematic/wiring diagram of your setup.
Use pin A0 for sensor input.
Use pin 13 for LED output.
4- Data Log:
Measure and record the following readings:
5V To A0 SensorExplanation / Answer
The arduino code for reading the sensor data and displaying the same on a serial monitor is as provided below:
----------------------------------------------------------------
int val = 0; // variable to store the value read
int LedPin = 13; // Using LED at pin 13 for detecting temp > 60
void setup()
{
Serial.begin(9600); // setup serial
pinMode(A0, INPUT);
pinMode(LedPin, OUTPUT);
digitalWrite(LedPin, LOW);
}
void loop()
{
float temperatureC, voltage;
val = analogRead(A0); // read the input voltage at pin A0
voltage = (val/1023)*5; // 5V corresponds to 1023 counts for 10but ADC
temperatureC = (905-(voltage/.00488))/7.6 ; //converting from A/D counts to deg C
temperatureF = (temperatureC * 9/5) + 32; // converting deg C to deg F
if (temperatureC > 60)
{ digitalWrite(LedPin, HIGH);}
Serial.print('A/D Count : ');
Serial.println(val);
Serial.print('Degrees C : ');
Serial.println(temperatureC);
Serial.print('Degrees F : ');
Serial.println(temperatureF);
}
----------------------------------------------------------------------
Let me know your feedback on this.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.