Jan 28-finished coding!😄新年了

Cheng Pang and Zengzi Li


Arduino with heat sensor

Matthew Oh and 2 OthersEscher Briere
Mason Clish
#include <OneWire.h>#include <DallasTemperature.h>#include <Servo.h>
// Pin configurationsconst int oneWireBus = A0;  // Pin where DS18B20 is connectedconst int servoPin = 12;    // Pin for the servo motor
// Create a OneWire instance to communicate with the DS18B20 sensorOneWire oneWire(oneWireBus);
// Pass our OneWire reference to DallasTemperatureDallasTemperature sensors(&oneWire);
// Create servo objectServo myServo;
// Temperature threshold (in Celsius)const float tempThresholdCelsius = 30.0;  // Temperature in Celsius (corresponds to ~90°F)
void setup() {  // Start serial communication  Serial.begin(9600);
  // Start the Dallas Temperature library  sensors.begin();
  // Attach the servo to the pin  myServo.attach(servoPin);}
void loop() {  // Request temperature readings from the DS18B20  sensors.requestTemperatures();
  // Get temperature in Celsius from the first sensor (assuming only one sensor is connected)  float tempC = sensors.getTempCByIndex(0);
  // Check if the temperature is valid  if (tempC == DEVICE_DISCONNECTED_C) {    Serial.println("Error: Could not read temperature data.");    return;  }
  // Print temperature to Serial Monitor  Serial.print("Temperature: ");  Serial.print(tempC);  Serial.println(" °C");
  // If temperature exceeds the threshold, move servo motors 180 degrees 4 times  if (tempC > tempThresholdCelsius) {    for (int i = 0; i < 4; i++) {      myServo.write(90);  // Move servo to 180 degrees      delay(500);           // Wait for the servo to reach the position      myServo.write(30);    // Move servo back to 0 degrees      delay(500);           // Wait for the servo to reach the position    }  }
  // Wait 1 second before reading the temperature again  delay(1000);}

rhino lasercut

Mason Clish and 2 OthersEscher Briere
Matthew Oh
pine cone window 1.dxf

yes lasercut

new code

oliver choi and Charles Juhas
const int relayPin = 3;   // Pin connected to the relay (controls the pump)const int buttonPin = 2;  // Pin connected to the buttonbool automationActive = false;  // Tracks whether automation is activebool buttonPressed = false;     // Tracks button press state for toggling
void setup() {  pinMode(relayPin, OUTPUT);       // Set relay pin as output  pinMode(buttonPin, INPUT_PULLUP); // Set button pin as input with pull-up resistor  digitalWrite(relayPin, LOW);     // Ensure pump is off initially  Serial.begin(9600);             // Initialize serial monitor for debugging}
void loop() {  // Check if the button is pressed (LOW state)  if (digitalRead(buttonPin) == LOW && !buttonPressed) {    delay(50);  // Debounce delay    if (digitalRead(buttonPin) == LOW) {  // Confirm the button press      buttonPressed = true;  // Prevent multiple triggers for one press      automationActive = !automationActive;  // Toggle automation state
      // Print current state for debugging      if (automationActive) {        Serial.println("Automation system activated");      } else {        Serial.println("Automation system deactivated");        digitalWrite(relayPin, LOW);  // Ensure pump is off when automation stops      }    }  }
  // Reset button state after release  if (digitalRead(buttonPin) == HIGH) {    buttonPressed = false;  }
  // Run automation system if active  if (automationActive) {    digitalWrite(relayPin, HIGH);   // Turn on the pump    Serial.println("Pump ON");    delay(2000);                    // Run pump for 2 seconds    digitalWrite(relayPin, LOW);    // Turn off the pump    Serial.println("Pump OFF");    delay(10000);                   // Wait for 10 seconds  }}

iteration-roof

Yichao Xie and Shiran Guo

post

Charles Juhas and oliver choi
laser cut.dxf
laser cut.3dm

laser cut files

Day 7 - Automation System and Spraying All Sides

oliver choi and Charles Juhas

We are reconstructing the mechanical engineering aspect of the project by utilizing a water dispensing system that could spray all sides. In addition, we created an automation system so that the water sprinkler sprays every 10 seconds for 2 seconds when the automation system is activated.

Mid Review Feedback

Shiran Guo and Yichao Xie

Maybe we can use growable material to make the roof. When a part is missing, it will automatically grow and be fixed.

Efficiency: A more advanced project will have only one backup piece and automatically move there when it detects the roof broken.

day4 journal

Yichao Xie and Shiran Guo

cant use cardboard bc it's burning in the laser cutter. We have to switch to wood



#include <Servo.h>  // Include the Servo library


// Define the pin connected to the pressure sensor (FSR)

const int fsrPin = A0;  // FSR sensor connected to analog pin A0


// Define the pin for the servo motor

const int servoPin = 9;  // Servo motor connected to pin 9


// Define the threshold value to detect pressure (lowered for increased sensitivity)

int threshold = 50;  // Adjusted threshold to 50 for higher sensitivity


// Create a Servo object

Servo myServo;


// Variable to track pressure state

bool isPressureApplied = false;  // Track if pressure is currently applied


void setup() {

  // Start the serial communication

  Serial.begin(9600);  


  // Wait for the serial port to connect

  while (!Serial) {

    ;  // Wait for the serial port to connect (necessary for native USB port boards)

  }


  // Attach the servo to pin 9

  myServo.attach(servoPin);


  // Initialize the servo to its resting position (0 degrees)

  myServo.write(0);  // Set servo to 0 degrees at the start


  // Print a startup message

  Serial.println("Pressure Sensor with Servo Example Initialized");

}  // <-- Closing brace for setup() here!


void loop() {  

  // Read the analog value from the sensor (0 to 1023)

  int sensorValue = analogRead(fsrPin);


  // Print the sensor value to the serial monitor (optional)

  Serial.print("FSR Value: ");

  Serial.println(sensorValue);


  // Check if the sensor value exceeds the threshold (pressure detected)

  if (sensorValue > threshold) {

    if (!isPressureApplied) {

      // Pressure applied, move the servo to 0 degrees

      Serial.println("Pressure Detected");

      myServo.write(0);  // Move servo to 0 degrees when pressure is applied

      isPressureApplied = true;  // Mark that pressure is applied

    }

  } else {

    // Pressure released (sensor value below threshold)

    if (isPressureApplied) {

      Serial.println("Pressure Released");

      myServo.write(70);  // Move servo to 70 degrees when pressure is released

      isPressureApplied = false;  // Reset the pressure state

    }

  }


  // Minimize delay (set to 50ms for faster response)

  delay(50);  // Reduced delay to 50ms for faster response

}



improved code

Embracing the Future: Smart and Responsive Architecture

Fessy iLab and 3 OthersEscher Briere
Mason Clish
Matthew Oh