Controlling the water pump with Arduino

My spinach farm has been doing alright so far. Since the beginning, I always want to add a touch of technology to this mini-agriculture project. It’s only natural that the next step after proving to myself that I can grow and take care of something is to delegate that task to a machine. I want the plant pot to have ability to water the plants remotely and automatically.

Components:

  • Arduino UNO R3
  • 12V mini water pump
  • Jumper wires
  • 2-Relay Module
  • 9V battery
  • Breadboard
  • LED light

Wiring:

Model circuit for how the Arduino, the relay module and the water pump are connected

Read more

The pots, plant pots

You see my plants You see the set up. It’s time for a break from all the techs and reveal the prep process for the mini spinach farm.

Step 1: Gather all takeaway boxes you can find. Component list:

  1. A spoon, to spoon the soil. It doesn’t matter if it’s plastic or metal
  2. A metal fork. It’s extremely important that it’s metal
  3. Pots, a lot of pots…with their lids preferably
  4. Lighter, you would likely need only one
  5. Soil
  6. Seeds, or any choice of plants

Step 1

Step 2: You now have to make holes for air ventilation through the soil.

Read more

Camera setting and photo taking schedule to get the best result

I left the camera turned on to take photos for a full day and was so excited to see the results the next evening. The next evening, I came home to … disappointment. Here are some photos I found that night:

Bad photo ...and another bad photo

As you can see, the photo quality was terrible. I kept getting photos with different stripes of exposure, overexposed, underexposed,or just plain white. A quick search on Google gave me the answer, Apparently, I set the the camera to take the photo right on the first frame, which means the camera has no time to set itself up yet. After several different tries, I came to the perfect setting.

#!/bin/bash
DATE=$(date +"%Y-%m-%d_%H%M")
fswebcam -D 2 -S 20 --set brightness=30% --set contrast=0%  -F 10 -r  640x480 --no-banner /home/pi/camera/$DATE.jpg
Read more

Making timelapse video of my mini spinach farm using a RPi and a Webcam

What you need?

  • A Mini Spinach Farm

  • A Raspberry Pi 3

  • A Webcam

  • A Lego Camera Crane

Here we go!

End result to begin with

View of the farm The almighty Lego Camera Crane

I don’t want to make a mega post so I have written several posts to cover all aspects. This is the technology one which is about how I set up RPi3 to take photos for timelapse. There will be another one on how I made my mini spinach farm. The design for the Lego Camera Crane will not have step-by-step guide until I finish the timelapse and able to unassemble the crane.

Read more

Writing my own KNearestNeighbors classifier in Python (from scratch)

Hello my friends,

I’m revising machine learning by going through the Youtube videos by Google Developers. One of the videos was teaching how to write a scrappy kNN classifier from scratch in Python. The algorithm finds the closest neighbour to the value and classifies the value accordingly. So I think to myself, I can write a proper k-NN classifier from scratch.

The first step is to revise k-NN. I found this lecture notes which explains k-NN algorithm in the simplest terms.

  1. determine k
  2. calculate the distances between the new input and all training data
  3. sort the distance and determine k nearest neighbors based on the k-th minimum distance
  4. gather the categories of those neighbors
  5. determine the category based on majority votes
Read more

Making my own Google AIY Kit

Google recently released the AIY kit in conjuntion with the MagPi magazine. I got an email telling me about this kit 3 days after its release. I regretted instantly for not keeping a closer eye on updates in the makers’ realm. I have since subscribed to the MagPi magazine in the hope that I won’t miss out any cool stuff for the next 12 months.

This morning, I spent an hour looking for a way to get this AIY Kit. I could have gone outside and search for it in the bookstores but it’s Sunday and it’s early. I searched all over the Internet to find somewhere that still has this kit in stock and doesn’t cost £20+. I gave up by my second glass of chocolate oat milk and started looking at the components that make up this kit.

Here is the list as captured on Google AIY Projects, Google’s official guide for the AIY kit.

Screenshot from Google AIY

Read more