Smart[er] Irrigation

In my last post I talked about the irrigation controller I have been working on for my parents farm.  The project is still a work in progress due to having problems getting a reliable cell signal out on the farm.  I’ll definitely be writing a post soon that gives more detail about where that project currently is at.

While working on the irrigation controller, I was thinking that the system could be greatly improved by using soil moisture as a metric for watering.  With the current design where a remote user is able to dynamically schedule waterings, the user must also pay attention to weather conditions to make informed schedules.  Getting real time data back to the user would help aid in schedule making.  Ideally, the user wouldn’t even need to worry about scheduling, instead specifying a rule-based system where waterings occur until all sensors are in a nominal range.

One of the classes I decided to take for my last semester is Electronic Systems Design (EE 333) taught by Dr. Gary Tuttle.  For this class we are able to choose two projects to work on over the semester, creating a schematic and placing it on a board.  The first project is an analog soil moisture sensor, which I’ll write a post about once the boards arrive and are populated.

The second project is for EE 333 is much more challenging and the main subject for this post.  I decided to tackle creating a soil moisture that fits the application I described above.  To make a successful sensor, I determined it must be completely wireless.  This means the communication must be through some wireless protocol and the device must also be charged with solar energy.  I have been a long-time fan of the ESP32, so it only seemed like the natural choice for this project.  I have used the ESP32 before with MicroPython installed on the Pycom FiPy dev board.  I wanted to go lower level this time, so I decided to use the ESP32-WROOM module and use the ESP-IDF to program the board in C.  One of the highlights of the ESP32 that makes it a great fit for the MCU is ESP-MESH, which is a mesh network API Espressif has developed.  ESP-MESH is built on top of WiFi and seems pretty straight forward to work with.

For the first project, the circuit measures the resistivity of the soil with two electrodes placed on the bottom of the board.  While this method works, the electrodes will become corroded after prolonged use and would require the whole board to be replaced, which would be costly.  I have done some research and found that capacitive soil moisture meters are longer-lasting and potentially more accurate.  Capacitive soil moisture sensors work by measuring how the soil’s dielectric permittivity affects the fringe field created by a capacitor traced out in the circuit board.  Since the traces are insulated from the soil, the sensor won’t corrode or oxidize.

Back to the ESP32.  One of the other highlights of the ESP32 is the capacitive touch pins.  Basic testing I conducted showed that the capacitive touch pins can be used to measure the permittivity of soil.  In the picture above you can see my test environment, which consisted of an ESP32 DevKitC, which I have been prototyping with, and a crude capacitive soil probe.  The soil probe is two insulated copper plates placed on each side of a wooden steak, with one wired to ground and the other wired to a touch pin.  There was a noticeable difference in the value of the pin as I placed it in wet soil vs dry soil.  If the difference is enough to accurately measure moisture content is still a question, but it looks like I will definitely be able to calculate an approximate level.

This week I started developing the schematic and writing the code for the ESP32.  I also created a page on Hackaday.io.  I will be posting there more often with updates and will write another post for this website once the project is finished, or at least at the end of the semester.  The circuit schematics will be posted on the hackaday project page and the code can be found on my GitHub account.

GitHub Page

Hackaday.io Page

Indra Irrigation Controller

Nothing has been more exciting over the past few years than developing an understanding of the overall depth and breadth in the field of computer engineering.  As I get closer to finishing my computer engineering degree at Iowa State I have gained a lot of passion for embedded systems, software and hardware development.

Indra is a personal project that I developed, encompassing all of the areas I’m interested in.  It is a full stack IoT solution that ranges from circuit & board design to web server development.  There are even some other fun areas thrown in, like designing and printing enclosures.

Continue reading “Indra Irrigation Controller”

LED Bike Light

This was a small little project I worked on in the summer of 2016.  While taking my first circuits class, I wanted to experiment with placing some LEDs on my bike.  During this time the weatherproof WS2812 addressable RGB LED strips hit the Sparkfun store and I wanted to place a meter strip on my bike!

Like I said, this was while I was taking EE201: Electric Circuits, so my knowledge of designing circuits was minimal.  Thankfully there’s this beautiful thing called the internet, so whatever I didn’t yet learn from the classroom could be discovered by a quick Google search.

The overall design of the circuit was fairly minimal.  A Sparkfun Pro Micro, which is a ATmega32U4 placed on a breakout board with a USB programmer, was used to control the LED strip.  A Sparkfun Power Cell board was used to both charge the Lithium Polymer battery and step up the 3.7 V output to the 5 V needed to power the board and LEDs.  The biggest problem with using the Power Cell was that the DC-DC boost converter was limited to 500 mA of current draw, which was about half of the current needed for the meter of LEDs to display peak brightness.  Besides these two boards, a capacitor was added as a voltage buffer for the output from the DC-DC converter.  A switch was also added to turn the output on or off from the converter.  A resistor was also added to the signal line for the LED strips.  The components were then soldered to a prototype board that was way to big for what I needed.  I was still a soldering greenhorn at the time and did a slightly less than mediocre job at soldering the board together.  You can see my work below.

My less than perfect soldering job for the board.

The majority of the project was spent debugging my solder job.  I ended up having to learn how to use a spring loaded solder vacuum to clean some of the traces, as a short was the cause of most of my problems.  Once the soldering was finished.  Code was uploaded to the Micro and I had a pretty rad looking bike.  The final product can be seen below.