DE503 | Science, Maths and Analysis

In this module, I present my comprehension and application of mathematics, statistics, and scientific principles. Here you will see some coding, some lab reports, experiment write-ups, and other mathematical and scientific analysis.

Scientific Principles

> Soil and Water Experiments

The relationship between soil moisture and resistance is an important area of research for the development of my products.

Electrical resistance is a commonly used method for measuring soil moisture, as it is relatively simple, non-destructive, and can be done in situ.

In this experiment, I aimed to investigate the relationship between soil moisture and resistance using a custom-built resistance meter and soil samples.

By analyzing the data collected, I aimed to gain a better understanding of how changes in soil moisture affect electrical resistance, and how this relationship can be used to improve the development of my products.

Monitoring, Interpreting and Applying Results

 

> Coding

The code below was based on the code to make an Arduino Ohm Meter by EarthBondhon.

This code, which is written in C++, measures the resistance of the soil, by using creating a 220Ohm resistor ohmmeter to measure the resistance of the soil. The input voltage of the Arduino is 5V.

If the soil is below a certain resistance, the code sends power to the green LED which tells the user that the soil is appropriately moist. The threshold can be changed in the code depending on the soil. If the resistance is below the threshold, then the red LED is powered.

My next steps will be to correctly display the resistance thresholds by presenting more user-friendly information on the LCD, instead of the resistance.

Every plant’s soil is different and should therefore be set up during initialization; the resistance of the soil when dry, and when wet, should be recorded by the device, and then parameters will be set by working out a percentage threshold of dry and wet soil.
i.e. if the resistance of the soil is 500Ohms when wet, the dry soil could be when the resistance is 500% of this. The research will have to be done.

Known Issues

  • LCD screen prints repeating (could be wiring issue)(SOLVED)

 

// include the library code:
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 2, d5 = 3, d6 = 4, d7 = 5;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
const int sensorPin = A0;  // Analog input pin that senses Vout
int sensorValue = 0;       // sensorPin default value
float Vin = 5;             // Input voltage
float Vout = 0;            // Vout default value
float Rref = 220;          // Reference resistor's value in ohms (you can give this value in kiloohms or megaohms - the resistance of the tested resistor will be given in the same units)
float R = 0;               // Tested resistors default value
int led = 9;

void setup() {
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("03/05/2022");
  Serial.begin(9600);      // Initialize serial communications at 9600 bps
}

void loop() {
      sensorValue = analogRead(sensorPin);  // Read Vout on analog input pin A0 (Arduino can sense from 0-1023, 1023 is 5V)
  Vout = (Vin * sensorValue) / 1023;    // Convert Vout to volts
  R = Rref * (1 / ((Vin / Vout) - 1));  // Formula to calculate tested resistor's value

  lcd.print("R:");                  
  lcd.println(R);                    // Give calculated resistance in LCD Screen
  delay(1000);                          // Delay in milliseconds between reeds
  Serial.print("R: ");                  
  Serial.println(R); 

R = Rref * (1 / ((Vin / Vout) - 1)); 
if (R < 30000)
{
digitalWrite(9, HIGH); digitalWrite(8, LOW);
}
else
{
digitalWrite(9, LOW);
if (R > 30000)
{
digitalWrite(8, HIGH); digitalWrite(9, LOW);
}
else
{
digitalWrite(8, LOW);
}

}}

 

> GROWfessor Prototype #1 Schematic

Below you can find the schematic and bill of materials for the GROWfessor, which was made using TinkerCAD.

Unlike the circuit diagram on DE501, this schematic is a lot more technical, and includes symbols instead of images, to convey certain components. You can click the download button below, to download a folder that includes a .pdf of the schematic, and a .csv file of the bill of materials.

> GROWfessor Prototype #2 Schematic

Below you can find the schematic and bill of materials for GROWfessor’s 2nd Prototype, which was made using TinkerCAD.

Unlike the circuit diagram on DE501, schematics are a lot more technical, and include symbols instead of images, to convey certain components. You can click the download button below, to download a folder that includes a .pdf of the schematic, and a .csv file of the bill of materials.

 

Analytical Skills

> Analysis of Prototypes

Analyzing a prototype allows me to identify any flaws or areas for improvement before moving on to mass production. The areas I will be analyzing are the following:

  1. Dimensions – includes size, surface area, mass, and volume.
  2. Assembly – includes parts and process of assembly.
  3. Functionality – includes factors such as durability, ease of use, and user experience.
  4. Durability – includes safety and potential hazards.

> 29/11/2022 – Analysis of GROWfessor Prototype #1

Dimensions

The dimensions of this prototype are 100mm x 200mm x 80mm (lwh). It weighs 941.75 grams and has a total surface area of 12650.57 square millimeters. The area for the plant pot can hold 77 cubic millimeters of soil.

The cuboid form factor of the prototype proved to be quite unergonomic requiring a lot of space to work on. However, the unorthodox shape may be attractive to some customers. The open section next to the pot section makes it easier for wire assembly and maintenance.

 

Assembly

The process of assembly for this prototype proved to be relatively easy, thanks to its open compartment as previously mentioned. The parts used can be seen in the bill of materials below.

I was able to slot the 16×2 LCD in its slot easily, but the LEDs could not fit in its holes due to a manufacturing error, where the holes were covered.

a still from the prototype assembly video, showing the assembled wires, and the red LED activated, meaning no or dry soil.

The probes were secured using superglue so that they would stay at a constant distance whilst measuring the resistance. This also provided some protection from any water leaking into the wiring from the pot section.

 

Functionality

This prototype used an LCD and a red and green LED to feedback on the status of the soil; too dry activates a red LED and a negative message on the LCD., and good soil activates a green LED and a positive message on the LCD.

a still from the prototype assembly video, showing the LCD displaying a negative message

The LCD worked well, and could also be used during development to show resistance readings. However, the LEDs looked like an afterthought, which could be down to the fact that their holes didn’t manufacture properly as mentioned above.

 

Durability

The prototype proved to be quite durable in use for a few hours. However, after a few hours of use, the anode probe which measures the soil’s resistance wears away. This hinders the functionality slightly, as there is less ‘probe’, so it can’t go as deep as before.

However, its functionality isn’t completely destroyed; as long as there is a contact from the wire, long or not, the readings can take place.

 

Conclusion

To sum up, this prototype represents a significant step towards creating a product that can help plant enthusiasts maintain healthy plants by monitoring soil moisture levels.

> 28/04/2023 – Analysis of GROWfessor Prototype #2

Dimensions

The dimensions of this prototype are 150mm x 150mm x 150mm (lwh). It weighs 1981.36 grams and has a total surface area of 183193.01 square millimeters. The area for the plant pot can hold 236 cubic millimeters of soil.

The form factor of this prototype is a lot more ergonomic compared to its predecessor. It is a fully rounded cube with 20mm fillets. This allows it to be soft to the touch, with a less flat look to it. However, with its larger shape, it can be a bit more difficult to handle.

Its section for wiring and other components is smaller and enclosed, compared to its predecessor’s bigger and open compartment.

 

Assembly

The process of assembly for this prototype was a bit harder than its predecessor. The compartment for its “brains” is quite small and I struggled to get my hands in there.

It also became apparent to me that short wires were not malleable enough to fit inside the compartment; therefore, the Arduino has to be left outside. The parts used can be seen in the bill of materials below.

However, I was able to slot the 16×2 LCD in its slot albeit with a bit more difficulty.

a still from a video showcasing the new prototype. You can see the wiring and its compartment (right)

The probes come from the bottom into the soil rather than the side, to be as close to the roots as possible; where osmosis takes place.

Functionality

This prototype only used an LCD compared to its predecessor which used an LCD and a red and green LED. The LCD displays a message the same way as before; when the soil is too dry a negative message is displayed on the LCD, and good soil displays a positive message on the LCD.

a still from the assembly video of the second prototype. the LCD is displaying a negative message

The LCD works well and can be used during development to show resistance readings. The absence of the LEDs, gives the prototype a cleaner UI, with only one point of feedback; however, this also means that the user has fewer ways to get feedback.

In the last prototype, if the LCD malfunctioned then the LEDs could communicate with the user. But in this prototype, the LCD would be the only way for the user to know the status of the soil

Durability

This prototype also proved to be quite durable in use for a few days but also suffered issues with corrosion. The anode probe which measures the soil’s resistance wears away after a few hours of constant power. However, as highlighted before, its functionality isn’t completely destroyed; as long as there is a contact from the wire, long or not, the readings can take place.

However, a unique issue with this prototype is the issue of water leaking through to the compartment below, where the electronics would be housed (if they fit).

soiled water residue left behind by water leaking above from the pot section

However, this can be solved by placing tissue/absorbent material under the leak, or on the bottom of the pot section so that water doesn’t leak through.

Conclusion

To sum up, this newer prototype may seem like it introduces more problems, but it also justifies a lot of changes, such as a change to shape and size. It also encourages me to reflect upon other ways in which soil moisture may be measured to avoid constant corrosion. This is also a significant step towards creating a product that can help plant enthusiasts maintain healthy plants by monitoring soil moisture levels.

> Function Analysis via IDE’s Serial Monitor

Whilst working on any code using Arduino IDE, I find the Serial Monitor to be an incredibly useful tool. It allows me to keep a close eye on the data being sent between my microcontroller and other components in my circuit. I can see any inconsistencies that might arise

Below you can see an example of me using IDE’s serial monitor to analyze the readings that it reported to me. This will tell me whether I have assembled the prototype correctly or not.

a clip from the video showing off the first prototype. you can see me using IDE’s serial monitor to track resistance readings.

As a result of this analysis, I understood that not only was the assembly correct, but my code and electronics functioned correctly too. Now I could use this prototype wiring (and code) as a foundation block for any other future versions or prototypes of the GROWfessor.