Saturday, 22 February 2025

Week 4

Updated: Feb 27, 2025

Members: Hamad Alsayed, Amanda Guo, Sultan Hassan, Aaron Symonds


Week 4 activities:

During this week, we firstly drilled holes in the top of the boat for the 3 LEDs and then drilled a hole in the bottom for the temperature sensor. We then inserted the circuit into the boat toy and then used electronics grade silicone adhesive sealant to seal and waterproof the entire toy. The pictures below show the LEDs lighting up blue and green after being assembled into the toy and sealed with the silicone. 



We then tested the floating and temperature detection feature by placing the toy in a shallow bucket of water and first seeing if it floats. After we confirmed that it floats, we then cooled off the water to below 30 degrees Celcius (confirmed with a thermometer) and observed which LED lit up. As expected, the blue LED lit up. We then heated up the water to between 30 and 37 degrees Celcius and observed which LED lit up. Again, as expected, the green LED lit up. Finally, we heated the water to above 37 degrees and observed if the red LED lit up, which it did. This therefore confirmed that our toy was fully working as we intended.  


Final project

The photos below show our completed project. Note: the tape is covering the LEDs temporarily from when we glued them in, it will be removed during demonstration. 






Final note: We originally wanted to incorporate a speaker module to the toy that would play various sound cues corresponding to the different temperature boundaries, however, we decided there was not enough time to incorporate it into our final project.


Week 3

Updated: Feb 24, 2025

Members: Hamad Alsayed, Amanda Guo, Sultan Hassan, Aaron Symonds


Week 3 activities: 

During this week, we first connected the battery pack to the circuit and ensured it was working. Initially, we wanted to run the circuit off a 9V battery supply using 3, 3V cells. However, when we tried to connect the batteries in the waterproof battery case to the circuit, no power was being delivered to the circuit. We then swapped the 3V cells to 1.5V cells, which worked. So we ended up running the circuit off a 4.5V battery supply. 

Following this, we proceeded to solder the entire circuit together on veroboard. 




We also discussed what we wanted to use for the exterior of the project, and we decided it would be most suitable to order a floating boat toy which we will then take apart and insert our circuit into. The image below shows the toy we submitted a component order for. 

[1]



We also further edited the code for the Ardunio to accomodate for the temperatures of bathwater as we had previously used temperatures around room temperature for convenice of testing. The final code is show below.

Final code for Ardunio:

#include <OneWire.h>
#include <DallasTemperature.h>

OneWire oneWire(2);
DallasTemperature sensors(&oneWire);


void setup(void) {
  Serial.begin(9600);
  // Setting output pins for the LEDS
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(12, OUTPUT);

  sensors.begin();
}

void loop(void) {
  Serial.print("requesting temp");

  sensors.requestTemperatures();
  Serial.println("DONE");
  float temperature = sensors.getTempCByIndex(0);

  Serial.print("Temperature is: ");
  Serial.print(temperature);
  delay(250);
  if(temperature <= 18.0){
    //Blue LED ON
    digitalWrite(7, HIGH); 
    digitalWrite(8, LOW);
    digitalWrite(12, LOW);
    }
  else if(temperature > 18.0 && temperature < 30.0){
    //Green LED ON
    digitalWrite(8, HIGH);
    digitalWrite(7, LOW); 
    digitalWrite(12, LOW);
  }
  else if(temperature >= 30.0){
    //Red LED ON
    digitalWrite(12, HIGH);
    digitalWrite(7, LOW); 
    digitalWrite(8, LOW);
  }

  delay(250);
}


Plans for next week:

1) Assemble circuit into toy
2) Ensure everything works as intended


References:

[1] Amazon, "Matchstick Monkey, Bathtime Boat Set, Antimicrobial Baby Bath Toy, Easy To Grip, Sensory Learning - Boat Set (1 Wobbler + 1 Boat), 12 Months Old+, Blue", amazon.co.uk. [Online] Available: https://www.amazon.co.uk/Matchstick-Monkey-Bathtime-Learning-Colourful/dp/B09R4187TZ/ref=pd_ci_mcx_mh_mcx_views_0_title?pd_rd_w=ca7r1&content-id=amzn1.sym.d63274d0-bf52-45e7-ae69-2bcf85c5865c%3Aamzn1.symc.ca948091-a64d-450e-86d7-c161ca33337b&pf_rd_p=d63274d0-bf52-45e7-ae69-2bcf85c5865c&pf_rd_r=CPRP57JRGEQSD5WKPF0S&pd_rd_wg=wsYIb&pd_rd_r=789d2bac-0d87-4fc1-925e-51dd8dfcda53&pd_rd_i=B09R4187TZ&th=1. [Accessed Feb. 23, 2025]




Wednesday, 12 February 2025

Week 2

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. 

[1]

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. 

Thursday, 6 February 2025

Week 1

Updated: Feb 24, 2025

Members: Hamad Alsayed, Amanda Guo, Sultan Hassan, Aaron Symonds


Components list:

Waterproof Temperature sensor Ds18B20 WPSE324

Red LED HLMP-3390

Blue LED C503B-Bcs-CVOZ0461

Green LED MCOI 1363

Arduino Uno R3

4.7kOhm resistor

AA battery x3

Waterproof battery case

Electronics grade silicone adhesive sealant EGSI OC-20G

Speaker module for arduino FIT0449

Micro SD card reader for arduino DFR0229

Micro SD card Netac 32 GB

USB-A to mini USB-B cable 


Week 1 activities:

During this week, we firstly tested all of our components to ensure they were all working as intended. The photos below show us testing the coloured LEDs.




We also downloaded the sample code from the temperature sensor's datasheet to trial the Arduino. 

Sample code:

#include <OneWire.h>

int DS18S20_Pin = 2; //DS18S20 Signal pin on digital 2

//Temperature chip i/o
OneWire ds(DS18S20_Pin);  // on digital pin 2

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

void loop(void) {
  float temperature = getTemp();
  Serial.println(temperature);
  delay(100); //just here to slow down the output so it is easier to read
}


float getTemp(){
  //returns the temperature from one DS18S20 in DEG Celsius

  byte data[12];
  byte addr[8];

  if ( !ds.search(addr)) {
      //no more sensors on chain, reset search
      ds.reset_search();
      return -1000;
  }

  if ( OneWire::crc8( addr, 7) != addr[7]) {
      Serial.println("CRC is not valid!");
      return -1000;
  }

  if ( addr[0] != 0x10 && addr[0] != 0x28) {
      Serial.print("Device is not recognized");
      return -1000;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44,1); // start conversion, with parasite power on at the end

  byte present = ds.reset();
  ds.select(addr);    
  ds.write(0xBE); // Read Scratchpad

  for (int i = 0; i < 9; i++) { // we need 9 bytes
    data[i] = ds.read();
  }
  ds.reset_search();
  byte MSB = data[1];
  byte LSB = data[0];

  float tempRead = ((MSB << 8) | LSB); //using two's compliment
  float TemperatureSum = tempRead / 16;
  return TemperatureSum;
}

However, we did encounter some setbacks regarding the code. While the code compiled successfully, the code would not upload to the Arduino Nano. The photo inserted below is the error code we were getting. After doing some research, we determined that the Arduino Nano is known to be unreliable. Following this, we swapped the Nano for an Arduino Uno R3 and the code was successfully uploaded. 


We also came up with a preliminary circuit diagram, this is shown below.




Plans for next week:

1) Start and finish assembling entire circuit 

2) Test and ensure entire circuit is working order, ready for soldering the week after











Week 0

BACKGROUND AND MOTIVATION 

Updated: Feb 23, 2025

Members: Hamad Alsayed, Amanda Guo, Sultan Hassan, Aaron Symonds


Hot water scalds is the primary cause of burns in babies and young children, as demonstrated by the figure below.

[1]

Approximately 2,000 babies and young children are admitted to A&E following a bath water scald per year. [2] Parents often misjudge the temperature of their children's bathwater due to their skin being thicker than that of a young child. [3] We realised this problem and have found an easy method to resolve the problem. We want to complete a project that involves a temperature sensor that detects the temperature of the bathwater and displays LEDs indicating whether the temperature is suitable for parents to bathe their young children. Furthermore, the sensor system will be in the form of a bath toy to engage with the children. 


Objectives:

1 - The toy should detect the temperature of the water accurately

2 - The toy should then use logic to determine if the water is too cold, too hot or suitable

3 - Depending on the temperature of the water, the toy should light up blue, red or green corresponding to the temperature. 

4 - The toy should float as a regular bath toy would


Ranges of Temperatures:

The ranges of temperatures and their corresponding LED colour is as follows:

  • Temp ≤ 30°  - too cold
  • 30° < Temp ≤ 37°  - suitable temperature
  • Temp > 37°  - too hot


Logic Flow Chart:



Plans for next week:

1) Collect all our components and test them 

2) Start coding the Ardunio 


References: 

  1. [1] A M. Kemp
  2. S. Jones
  3. Z. Lawson
  4. S A. Maguire, Patterns of burns and scalds in children. 2014. 

[2] "Burns and Scalds" rospa.com, para 4 [Online] Available:  https://www.rospa.com/resources/hubs/keeping-kids-safe-(1)/burns-and-scalds. [Accessed Jan. 31 2025]

[3] "Hot Water Scalds" cbtrust.org.uk, para 1 [Online] Available: https://cbtrust.org.uk/get-informed/causes-of-burns-and-preventions/hot-water-scalds/#:~:text=A%20baby's%20skin%20is%20thinner,treatment%20and%20life%20long%20scarring. [Accessed Jan. 31 2025]





Poster