Electronics in Nature | DIY Environmental Sensing Box With Arduino Uno and Moisture, Temperature and Humidity, and Light Intensity Sensor πŸ’¦πŸ”₯🌳🌦🌚

by gardensofthings in Circuits > Arduino

1360 Views, 8 Favorites, 0 Comments

Electronics in Nature | DIY Environmental Sensing Box With Arduino Uno and Moisture, Temperature and Humidity, and Light Intensity Sensor πŸ’¦πŸ”₯🌳🌦🌚

Electronics in Nature | DIY Moisture, Temperature & Humidity Sensors Box with Arduino πŸŒ³πŸ‘ΎπŸŒ¦πŸŒ»

The Electronics in Nature box aims to engage children with nature and electronics. The box explores the use of three different environmental sensors (soil moisture, temperature and humidity, and light intensity) and of three different actuators (LEDs, servo motor, and speaker) to represent the measured values.

In Summer 2022, three Electronics in Nature sessions were held with school children in an urban park in London. Each of the sessions introduces the children to a new sensor and electronic circuit and combines forest school activities to test the circuit.

Below are short descriptions of each session and each circuit:

Soil Moisture & LEDs

The first circuit introduces the measurement of moisture content. The circuit uses two nails to measure the moisture of various media, three LEDs to visualise the moisture of the soil (pink for "Dry", green for "Average Moist", and blue for "Very Wet"), and a LCD Screen to read the moisture value in percentage. Once built, the circuit is tested in the mud mixtures created by the children, giving the opportunity to discuss how various types of materials (eg. sand, gravel, grass, saw dust, clay, compost) absorb and retain water.

Temperature and Humidity & Servo Motor

The second circuit introduces the measurement of temperature and humidity. The circuit uses a DHT22 temperature and humidity sensor and a small servo motor. The speed of rotation of the servo motor adjusts according to the values recorded. The higher the temperature, the fastest rotates the motor, and the lower the temperature, the lowest rotates the motor. 

Before testing out the circuit between bright sun and shade, a flower or wind turbine like structure is built to add on top of the servo motor. This object will help to visualise the rotational speed. 

Photo Resistor & Speaker

The third circuit explores light intensity and our relationship with light and sound. The circuit is built using a photo resistor and a small speaker. Depending on the reading of the sensor (in shade, in full sun), a different melody is being played. 

A collaboration between Paula Harvey, forest school teacher and Aude Vuilliomenet, PhD Student at the CE Lab at The Bartlett UCL. And big THANK YOU to the London National Park City (LNPC) for supporting this project.

Supplies

Electronics in Nature - Components.jpeg
Electronics in Nature - Wood Box.jpeg

Here is the list of components, you will need to build this circuit. Some are the same that we used in circuit #1, some are new. If you need to purchase any of the components, have a look at The PiHut, eBay, CPC or Amazon. By shopping around, you will find reliable and fair price components. 

Electronics:

Powering the Circuit:

Others

  • Some breadboard wires (male-male)
  • Soldering Iron
  • Wood Enclosure (see below for the design files)

Programming Your Arduino Uno

Program your Arduino Uno

The Electronic in Nature box is made out of three programs. The first code measures the soil moisture and lights up an LED according to the measured valued. The second takes a temperature and humidity reading and use the value to adjust the speed of rotation of a servo motor. The third measures the light intensity and sends musical pitches depending of how bright it is. These three programs have been turned into function, as only one code can be sent to the Arduino Uno at a time.

Thanks to Robson Couto for its GitHub repository arduino-songs. It is an amazing resource of melodies to be used directly in an Arduino sketch. Five of these sketches have been cut shorter to be used for the melody to be play for each light intensity from dark to very bright!

Wiring Component & Building the "Electronics in Nature" Box

LEDs 220 Ohm Resistor Soldering Preparation.jpeg
Light Intensity - Step 1.jpeg
Light Intensity - Step 2.jpeg
Battery Pack. Push Button. StepUp Converter.jpeg
Temperature Sensor 10K Ohm Resistor Preparation.jpeg
Box Face - Step 1.jpeg
Box Wiring - Breadboard. Nail. Speaker.jpeg
Box Wiring - Overview from the top.jpeg
Solar Panel - Step 2.jpeg
Solar Panel - Step 1.jpeg
Solar Panel - Step 3.jpeg

Understand your components

You will find the wiring diagram for this project below. Before starting the wiring, you may want to consider a few thing.

  1. What are the components that can be solder together before building the box?
  2. How are you going to power your Arduino and your circuit?

All our components are great to use with breadboard but less so when they need to be attached to one of the face of the box. One solution to this is to pre-solder these components to a long jumper wire so they can connect directly to an Arduino Pin or into the breadboard in the middle of the box. We did this for the following.

  • The three LEDs. Solder a 220 Ohm resistor to the short leg (negative) of the LED. Then, insert the resistor leg into a male jumper wire to connect to the digital pin of the Arduino. For the remaining leg, the long leg (positive) of the LED insert a male jumper wire and connect it to the positive (+) bus of the breadboard.
  • The speaker. Solder a 220 Ohm resistor to the positive leg of the speaker.
  • The light intensity resistor. On one of the leg solder a (positive) jumper wire to connect it to the positive bus of the breadboard. On the other leg, solder one leg of a 10K Ohm resistor. The non-soldered leg of the resistor will connect to the ground, the soldered leg will connect to an analogue pin of the Arduino.
  • Pre-soldered the 5V step up converter, the TP4056 battery charger, the battery pack and switch button to a soldering board. This will make a neat connection between the part and allow you to attach it in the inside back of the box.

In this project, we are using an Arduino Uno, which is the perfect microcontroller to start with if you are new to electronics. If you have experiences with MCUs, you may notice some of the disadvantages of such a board: no wifi or bluetooth connectivity, limited amount of memory, lower speed. That's said, the Arduino Uno was perfect for our use. In the future, we may well develop a internet-connected version of our "Electronics in Nature" box. So keep an eye out :-)

Wire your components

As writing in the Arduino code for this project. The components are wired to the following Arduino pins. Note that you can modify where your wire your components, but this will need to be reflect in your code.

  • Connect the Arduino 5V pin and GND pin to the positive (+) and negative (-) of your breadboard.
  • Connect one nail to the Arduino analogue pin #A1.
  • Connect the LEDs to the digital pin #2, #3, and #4 of your Arduino, with #2 being the LED indicating "Moisture: Dry" and #4, "Moisture: Very Wet".
  • Connect the temperature and moisture sensor to digital pin #8.
  • Connect the servo motor to digital pin #5.
  • Connect the light resistor to the Arduino analogue pin #A0.
  • Connect the speaker to the digital pin #9.

Give power to your circuit

This Electronic in Nature box will be used outside, in my garden, on my balcony, or even in my local park. As there won't be any plugs in these locations and we may not have a laptop on hand to power the Arduino, we need to think of another way to power the box. Here, we decided to use a rechargeable lithium battery to power the Arduino and add a solar panel to the box to recharge the battery when the box is not powered. The Solar Charged Battery Powered Arduino Uno tutorial is a very helpful guide to help you better understand how to wire the solar panel, the TP4056 battery charger, the 5V step-up converter and the lithium battery. I add a switch just before the lithium battery charger connect to the 5V step up converter, so the step-up converter only received power when the circuit is ON.


Assembling the box

The box has been designed on Rhino in order to be cut by a laser cutter. In the files below, you can find the .dxf file with the measurements for a wooden box made of 6mm plywood.


Enjoy the wiring! Have a look at the circuit schematic, the images and also the video to help you with the building steps. Once this is done, we will finally be able to test the box! 🌳πŸ”₯🌻πŸ₯

Testing the "Electronics in Nature" Box

IMG_9908.jpg
IMG_9631.jpeg
IMG_9906.jpg
B16AD4D9-6775-475B-8C55-D28A4578DDCF.jpeg

Congratulations, you have now finished programming your Arduino and assembling the box. It is time to go outside and test it out. Here are a few ideas for you to test it!

  • Prepare different soil mixture. A popular forest school activity is the so-called "mud-kitchen", where children mix various things together. You can try to use some saw dust, clay, sand, garden soil, pebbles and see how various mixture retain more or less water. Another good exercise is to plant the two nails directly in the soil of your garden and compare the reading with planting the two nails in a flower pots. Do you see any differences?
  • Play with temperature. Use a glass full of ice cubes and put it in front of your temperature sensor, move the box between shade and full bright sun. Do you notice any change in value?
  • Light intensity, try to cover the sensor with a leaf, a piece of bark, a stone. What can you notice?

Thank you for reading through this project. I hope you enjoy it and it will inspire you to use electronics outdoors, especially to learn more about nature and your surroundings environment. Let me a comment below if you enjoy it and feel free to reach out if you have any questions!