Dyah Setyaningsih: Difference between revisions

From Medien Wiki
Line 33: Line 33:


=== Wiring Diagram ===
=== Wiring Diagram ===
[[File:The_Plant_Plant_-_Bubble_Machine_Wiring_Diagram.png|none|thumb|330x330px]]
[[File:The_Plant_Plant_-_Bubble_Machine_Wiring_Diagram.png|none|thumb|350x350px]]
During the process of making the bubble machine, unfortunately I fried my ESP32... I'm still not sure why, but perhaps it was due to false wiring. Thus I made this wiring diagram so that the wiring could be clear. I tried some free tools to make wiring diagram, such as but in the end I stick with EasyEDA to make this. The wiring diagram helps me a lot in reproducing the wiring I wanted to do, as well as to ask opinion from Christian or someone else for consultation.
During the process of making the bubble machine, unfortunately I fried my ESP32... I'm still not sure why, but perhaps it was due to false wiring. Thus I made this wiring diagram so that the wiring could be clear. I tried some free tools to make wiring diagram, such as but in the end I stick with EasyEDA to make this. The wiring diagram helps me a lot in reproducing the wiring I wanted to do, as well as to ask opinion from Christian or someone else for consultation.



Revision as of 16:42, 15 February 2025

Respiring Reflections

This project is called "Respiring Reflections", a bubble machine which is connected with Pothos plants (Epipremnum aureum) in an enclosed environment. Read below to follow the process and the story behind the making of this project.

//TODO: insert pic

First Experiments

In the beginning of our semester, we were given some seeds to be grown at home. This was our first experiments for this class. I was growing Chia seeds (and also apple seeds that didn't really grow into anything) on a piece of cotton and inside a plastic bag. I have not done this since school time, so it was interesting and fun. During our first experiments in growing seeds, we documented our plants' progress. I documented it in form of pictures and diary entries.

//TODO: add pics + examples of diary entries

Motivation

After attending a few sessions of this class, I started brainstorming what could my topic of interest be. Honestly it was a bit confusing and challenging to try combining/connecting plants and electronics somehow. Before this bubble machine idea came up, I had some more ideas and sketched them in my notebook. In the end, I was interested in the respiration process of my plants and decided to make a bubble machine which can visualize the respiration process/cycle of my plants. I think bubbles are fun and matches the concept of respiration, since they are somewhat transparent/translucent, and we cannot really observe the plants' respiration. With the bubbles, I was trying to simulate or reflect the respiration, hence the project name "Respiring Reflections".

//TODO: add initial sketches

Before the bubble machine idea, I already decided to grow Pothos plants from cuttlings and documented their growth. During the process, that was where I started to think: "Are my plants breathing? They seem fine, their leaves are green... but are they really okay?" The idea was that the soap bubbles quantity would be according to the CO2 level of the plants' enclosed environment, divided into three categories: Low, Medium and High CO2 level. When the CO2 level in the plants' environment rises, then there will be more soap bubbles. In order to do so, I watched videos and read blogs/forums related to the DIY bubble maker machine, until I had a plan on the materials needed and how to make it.

You can find my initial project mood board here: https://miro.com/app/board/uXjVLBm7F8w=/?share_link_id=117991010729

Materials

  • ESP32
  • CO2 sensor MH-Z19C
  • Stepper motor 28BYJ-48
  • Stepper motor driver module ULN2003
  • PWM fan AMD Ryzen 7 1700
  • 10kΩ resistor
  • Power supply 12 volts
  • Buck converter 12 volts to 5 volts
  • Acrylic sheets
  • Bubble sticks
  • Soap bubble liquid
  • Lots of cables...

Wiring Diagram

The Plant Plant - Bubble Machine Wiring Diagram.png

During the process of making the bubble machine, unfortunately I fried my ESP32... I'm still not sure why, but perhaps it was due to false wiring. Thus I made this wiring diagram so that the wiring could be clear. I tried some free tools to make wiring diagram, such as but in the end I stick with EasyEDA to make this. The wiring diagram helps me a lot in reproducing the wiring I wanted to do, as well as to ask opinion from Christian or someone else for consultation.

Since I wanted this installation to be a standalone one, I powered the ESP32 with the power suppy of 12 volts, through a buck converter of 5 volts, 1 Ampere. For this, I went to an electronics store in Erfurt (Bastlerland) and showed my wiring diagram for this project. The guy in that store recommended me this solution and I followed it.

Code

To program the ESP32, I used Visual Studio Code with PlatformIO extension. Here are the codes I uploaded to the ESP32 to run the bubble machine:

main.cpp:

#include <Arduino.h>
#include <AccelStepper.h>           // Load the AccelStepper library
#include "MHZ19.h" 
#include <HardwareSerial.h>

#define motorPin1  12               // IN1 pin on the ULN2003 driver
#define motorPin2  14               // IN2 pin on the ULN2003 driver
#define motorPin3  27               // IN3 pin on the ULN2003 driver
#define motorPin4  26               // IN4 pin on the ULN2003 driver

AccelStepper stepper(AccelStepper::HALF4WIRE, motorPin1, motorPin3, motorPin2, motorPin4);

#define BAUDRATE 9600

/*CO2 sensor*/
#define RX_PIN 16  //wire green here (8)                                    
#define TX_PIN 17  //wire blue here (9)  

/*CO2 sensor variables*/
MHZ19 myMHZ19;
HardwareSerial mySerial(2);
unsigned long getDataTimer = 0;
void verifyRange(int range);

int CO2;
int8_t Temp;

int currentCategory = -1;  // To store the current CO2 category

int newCategory;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);               // initialize the serial monitor

  stepper.setMaxSpeed(1000.0);      // set the max motor speed
  stepper.setSpeed(100);            // set the current speed/initial speed

  mySerial.begin(BAUDRATE);    // sensor serial

  /*CO2 sensor*/
  myMHZ19.begin(mySerial);     // pass to library
  myMHZ19.autoCalibration(); 

}

void loop() {
  // put your main code here, to run repeatedly:
  stepper.runSpeed();

  /*CO2 sensor and stepper motor speed logic*/
  if (millis() - getDataTimer >= 250)  //refresh rate: 250ms
    {
        //int CO2; 

        /* note: getCO2() default is command "CO2 Unlimited". This returns the correct CO2 reading even 
        if below background CO2 levels or above range (useful to validate sensor). You can use the 
        usual documented command with getCO2(false) */

        CO2 = myMHZ19.getCO2(false);                             // Request CO2 (as ppm)
        
        Serial.print("CO2 (ppm): ");                      
        Serial.println(CO2);                                

        //int8_t Temp;
        Temp = myMHZ19.getTemperature();                     // Request Temperature (as Celsius)
        Serial.print("Temperature (C): ");                  
        Serial.println(Temp);                               

        getDataTimer = millis();

        // determine the category of CO2
        if (CO2 < 900) {    // lower threshold: 900 ppm
          newCategory = 0;  // Low CO2
        } else if (CO2 < 1000) {   // higher threshold: 1000 ppm
          newCategory = 1;  // Medium CO2
        } else {
          newCategory = 2;  // High CO2
        }
      
        // switch category if the current category is no longer valid
        if (newCategory != currentCategory) {
          currentCategory = newCategory;
          switch (currentCategory) {
            case 0:
              stepper.setSpeed(100);  // Slowest speed
              break;
            case 1:
              stepper.setSpeed(300); // Medium speed
              break;
            case 2:
              stepper.setSpeed(500); // Fastest speed
              break;
          }
        }
  }
}

platformio.ini:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = 
	waspinator/AccelStepper@^1.64
	wifwaf/MH-Z19@^1.5.4

Respiring Reflections - First Prototype and First Trials

For the bubble machine itself, all I needed was a fan, a rotating motor, bubble sticks and a container for the soap bubble liquid. To produce more soap bubbles, the motor needs to rotate faster. The bubble sticks need to dip into the soap bubble liquid and then they will pick up the soap liquid to be blown in front of a fan to produce bubbles. To test out this logic, I made the first prototype out of cardboard. This turned out to be helpful for consideration of measurements for the final prototype. Other than the bubble machine as a whole, I also did trials on the CO2 sensor in the plants' enclosed environment and to determine the closeness of the bubble sticks to the fan to produce the bubbles. Through the trials, I found that the fan was strong enough to blow the bubbles only in specific areas, with a certain closeness. Therefore, I needed to consider and experiment with the distance and placement of the fan towards the rotating bubble sticks.

//TODO: add pics of cardboard prototype + trials

Respiring Reflections - Final Prototype (Winterwerkschau)

final prototype

Self-reflection

self-reflection

Future Work

future work

Gallery

The Plant Plant Gallery (Nextcloud Bauhaus Uni), Password: theplantplant (CO2 sensor first trial pictures are inside)

References

CO2 sensor MH-Z19C
PWM fan AMD Ryzen 7 1700
Stepper motor 28BYJ-48 and stepper motor driver module ULN2003