With the arrival of our moisture sensor, we were able to begin experimenting with the use of two inputs on our breadboard. To test the moisture sensor, we initially set up a device in which an LED is illuminated in the presence of moisture; an adapted bit of code from the internet meant to notify a user when soil requires watering.
As you can see, this device uses an if else statement similar to what we will use in our final project. When the sensor reading exceeds a given value, the LED turns on; we will adapt this to include our code for servo movement so that the servo will only move (dependent on the LDR) when the sensor reading is sufficient.
After doing this test, we wired our arduino up using our servo and both inputs in order to test the code written in our previous blog post; in our final product the moisture sensor will be embedded in soil and we will have an updated kinetic design. Changing some values and tinkering with our code, we found it to work very well with our inputs. We now must find the perfect value for moisture in soil, and also how the addition of 2 more leaf components will effect the angle our servo is required to move.
Combining the code for the LDR/Servo movement with the code for moisture sensor/LED behaviour, this demo shows the result.
For our second project, the movement of the flower will be dependent on the reading taken by an LDR, but will be underpinned the reading taken by a moisture sensor. This means that the flower will open as the intensity of light in it’s environment increases; unless the moisture level in the soil is lower than a given value. in which case nothing will happen. Here is our code:
This code makes use of an if else statement, with our code for LDR input/servo output running if the moisture level is sufficient, and returning to the top of the loop if not. Still waiting on our moisture sensor to arrive, we are unsure about the value for moisture at which the code for the servo movement will run, so we shall conduct an experiment to find out the optimum value when we have access to the sensor.
Our finished kinetic design is now in the queue to be 3D printed. As shown in the image above, the pivots will be printed as part of the base and are attached to the centre of each leaf. Alligned vertically from each pivot is a loop for which fishing wire may be attached, as this is what will connect our servo motor to each component.
This week we finished our kinetic design for the flower and it’s pivots using a rhino CAD model. The pivots are printed directly onto the base in order to ensure precise measurements and to make the assembly easier.
We have been coding for multiple inputs; our design will still open and close as the reading on the light dependent resistor changes, with the addition of a moisture sensor which will be embedded in soil. This could make our design serve a useful function by indicating when the soil needs be watered, using the flower as a measure of light and moisture.
The outputs on our code are the servo motor, controlling the movement of the flower and an LED whose brightness is dependent on the moisture reading. We hope that the flower opening, paired with the varying brightness of the LED will make our project enthusing to watch.
Since last week, we have refined the flower design using CAD. We have decided to have two ‘rings’ of flowers to achieve a more natural aesthetic, rather than the claw-like design from our first project. Here is the bulb shape of the initial ring:
To streamline the mechanism and to make our 3D printed parts more useful, the hinges for the flower components will now be integrated into the pieces themselves, making them one component rather than many.
To develop our code, we have been considering new inputs and outputs for our design. An LED will be an output for when the bulb opens, and we have been experimenting with the idea of the mechanism not reacting to changes in light when there is no one around to see. We can implement this with a proximity sensor.
Having decided on a final idea, we will now be developing and refining the kinetic design and making our prototype. The design relies on a servo motor rotating from one set position to another in reaction to light as a sensory input.
Rigid wires will be freely attached to the servo gear, with the other end in a fixed position attached to the ‘flower’. When the gear rotates from position 1 to position 2, the parts of the flower will be pushed outwards about a pivot at their base.
Our next step will be to make the physical components of the design, and write the code for the angle change in the motor as a response to a light sensor.
In our second arduino session the main learning points included using resistors to limit the flow of current, and how they can be utilised in series and parallel circuits. We looked into the use of push-buttons in our circuits and some more advanced code to supplement our knowledge for the coming project. The left-hand image shows the circuit setup we used for our button-blink arduino code, including the use of a push-button and resistor.
During our own time we also played around with some sketches and ideas to gauge, further more, what our design will do function wise and how it will look. We explored different mechanisms we could use to mimic plant behaviour, and considered how we could use the arduino uno and our C++ code to make our concepts happen.
After learning about Arduino in our first session with our basic code to make an LED blink, we realised there were vast possibilities for the concept of our first project.
Initially, we looked into how sensory inputs in physical computing can replicate nature; in the form of sound, touch, heat, movement and light. We explored how a deep-water clam would react to changes in temperature by opening it’s shell, and how plants react to light by facing their photo-sensitive leaves towards the source.
We found plants to be the most diverse in their response to sensory inputs; with some carnivorous plants catching their prey by closing around it (a response to the insect’s movement as it struggles), whilst more conventional plants have a huge range of responses to light and temperature change. These include wilting, adjusting the orientation of their leaves, re-seeding, new growth and even losing their leaves all together in the colder seasons.
We will look to research plants’ reactions to sensory inputs and mimic this in our first Arduino project.