Week 12 (09.11 – 15.11): Automatic watering system for plants


Software (Marius):

This week I have been working on some power savings features for our system. It seems to be several ways of doing this, and how much power can be reduced by using these methods seems questionable. Some of the methods I’ve looked into are:

  • Using low-power libraries (Most of the libraries I’ve come across puts the Arduino to sleep for 8 seconds).
  • Using the built-in power-saving features (This includes using interrupts to wake the Arduino).
  • Slowing down the Arduino clock (This can cause boot loader issues and potentially damage the Arduino).
  • Reducing the voltage supply to the board.

After some investigation, I figured out that I wanted to try an external library I found. This will make the Arduino go to sleep for 8 seconds each time the function is called and potentially help reduce the power consumption. One of the pros of using this method is that you can loop the same code for as long as you’d like, but how much power will be saved by using this method is rather questionable, and we will have to do some tests on this before concluding.

So let us say that we want the system to operate once every 12 hours. This would mean that the power saving function will have to be executed 450 times/hour, and 5400 times for the Arduino to sleep for 12 hours.

  • 60 minutes = 3 600 seconds.
  • 3 600 seconds / 8 seconds = 450 times.
  • 450 times * 12 hours = 5400 times.

Programming the power-saving feature:

First of I started by including the necessary library and added three variables that will function as the hours between each watering procedure and a counter/max value for a while loop.

I then created the function that will cause the Arduino to go to sleep for 8 seconds.

Figure 02: PowerSavingsMode.

When the vehicle detects two black lines (a black line on each of the line follower sensors) the vehicle should stop.

Figure 03: The vehicle has detected two black lines.

When the vehicle has stopped due to the detection of two black lines it will either turn around 180 degrees and continue the plant watering operations or put the system to sleep.

  1. The first time the system encounters two black lines, it will increase the blackLineCounter by 1 so (blackLineCounter = 1). It will then turn around and continue the plant water operations.
  2. The second time it encounters two black lines, the blackLineCounter will be increased to 2, and the else-statement will be executed. This while-loop will be executed for approximately 12 hours (give or take a few minutes as I don’t know how accurate this will be). After the while-loop is completed the sleepCounter and the blackLineCounter will be reset and the system will go back to the plant watering operations once again.
Figure 04: Executing the sleep function.

It remains to see if this will function as intended. I have not been able to test this as one of the other group members have all the Arduino components right now.

Mechanical (Shadi and Per-Terje):

During this week, we had finished printed all the remaining parts of the robot, and we fixed the 3d printer, but when we started printing the outer cover, the 3d printer broken down again, and we discovered the cause of those issues was the quality of the filament. So we decide not to print the outer cover since it will take a long time to get new replacement parts.
Anyways, all main parts are now ready for assembly during the next week .


Leave a Reply