Saturday, 22 February 2025

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]




No comments:

Post a Comment

Poster