Updated: Feb 23, 2025
Members: Hamad Alsayed, Amanda Guo, Sultan Hassan, Aaron Symonds
Week 2 activities:
During this week, we spent the majority of our time finding a way to wire up the circuit correctly.
Eventually, we found a circuit diagram online that worked for what we wanted.
We confirmed that our circuit was working by testing with the sensor at room temperature, which should trigger the blue LED, and warming the sensor up with our hands to 37 degrees celsius , which should trigger the green LED. The photos below suggest that the circuit was working as intended. We did not test the red LED as we did not have a method of warming up the sensor up any further.
We also had to alter the code to accomodate 3 LEDs, which we had not previously done. The new code is shown below.
Updated source code for Ardunio:
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is connected to Pin 2 (digital)
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup(void) {
Serial.begin(12600);
sensors.begin();
// Setting output pins for the LEDS
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(12, OUTPUT);
pinMode(2, INPUT);
}
void loop(void) {
sensors.requestTemperatures();
delay(750);
float temperature = 0.0;
temperature = sensors.getTempCByIndex(0);
if(temperature <= 15.0){
//Blue LED ON
digitalWrite(7, HIGH); }
else if(temperature > 15.0 && temperature < 37.0){
//Green LED ON
digitalWrite(8, HIGH);
}
else if(temperature >= 37.0){
//Red LED ON
digitalWrite(12, HIGH);
}
else{
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(12, LOW);
}
delay(1000);
}We also finalised our circuit diagram after confirming the circuit was working as intended, which is shown below.Circuit Diagram:
Plans for next week:1) Start and finish soldering circuit 2) Discuss and come to a conclusion for the exterior design
References: [1] Gus, pimylifeup, 2025. 




No comments:
Post a Comment