Category Archives: Projects

An automated green thumb in the garden

My wife and I love eating fresh food. Fresh cut herbs cost as much as the whole living plant. So we start buying these fellows in their pot. However, in the winter the days are too short, they won’t grow. So I decided to build a lightened garden to give them what they need. In fact, it is not a new idea, I plan to build a computer controlled garden for a while.

I need  to start somewhere and develop my gardening skills and understand how to automate the thing. This first project is much like a prototype. I gather some junk I accumulated around the house, and I build this little oasis.

Smart garden without electronics

The reflectors

I begin with the reflectors. I build them from old floor heater front panels. I cover them with aluminum foil. They are not wide enough to cover the entire light. So when we sit we can see the direct light. However, they do the trick.

Reflector build with aluminum foil

Reflectors assembly

Here is the complete assembly of the garden, before the paint. Before I start, I already know that my light was too high. In the next one, it will be adjustable. When I built it, I had no clue of the height of the plants I will grow in it.

Fluorescent lightening

I use two 45 watts fluorescent bulbs I pick from my studio box. They are full spectrum 5500k lights. I use it for two weeks now, and the plant seem to have enough light. In my readings, I found that the best temperature is 6400k. I plan to purchase some real fluorescent tube grow lights after the holidays.

Smart garden assembly before paint

The moisture sensors

These bolts will be the moisture sensors. I gravelled about two inches of the bottom of the planter. The bottom sensor will tell if they are too much water. The side sensor will keep track of the soil moisture. Both will be hooked to and Arduino. I hope it will work! I had not tested yet.

Moisture sensors

Moisture sensor head

The controller

This is it for now. The next part is where the fun begins. For me at least! I can not do things the simple way. So I want this garden as automated as possible. Here’s a sneak peak.

Smart garden diagram

Arduino data logger and humidity temperature moisture sensors

Marvin let me drive easily

In this second version of the software, I managed to be able to slide my thumb to the OSC controls. I explain. When you move an OSC slider, a bunch of commands are sent. Not just the start position and the end position, but many position behind these last two. On the Marvin robot, the commands are received and computed by the Raspberry Pi then send to the Arduino board through the serial port. The problem is at this point. The serial command are very slow, and there are queued. So when I moved my thumbs to accelerate it take a while to the robot to get to the speed. Worse, when I hit the panic break button, it has the queue all the commands sent before.

So I manage to put all the commands in a list. Them only send the last one when the serial port is ready. Look a bit easy, but I had to learn a bit more of Python and understand how to create threads. The fun thing? I had fun doing it : )

Noiseless actuators

I finally manage to find a way to make actuators that are enough powerful, small and the most important, noiseless. Since this robot will move all day long, it is essential not to hear it. I tried three types of motors: servos, DCs and steppers. It is not a secret for everyone, theses servos are terribly noisy. The gearbox of miniature DC motor I tried next is too noisy too. At last, I ordered a small stepper with a gearbox and it will be the one selected for the task. So I will replace the three servo motors with these steppers connected to a threaded rod that will move the swash plate.

I’ll have to 3D print some parts to fit all this together, but the essence is there. Now I have to learn to CAD.

There are the two motors, the stepper and the small geared DC one

Small step motor and miniature geared DC motor

Testing the small step motor

Testing the small geared step motor

Do you hear something?

You probably saw a bit more of the project I am currently working on, the robot flower. I have completed the second prototype and it works as expected. Now, I want to give the robot the ability to interact autonomously with the environment. Not just be controlled has with the Wii Nunchuk.

I want the robot to interact with many things, but first, I wish it to detect which direction the sound come from around it. Then the flower could orient itself this way.

Sound detection technique

In think using three microphones and measure which one receive more sound will permit to know the sound direction. I saw some complex project in which they also acquire the distance by triangulation. This is too complex for what I want. The direction is enough.

Then I start digging the web for some schematics. I found many electret microphone amplifier build around an operational amplifier (Op-Amp) chip. So I check for cheap and preassembled ones on eBay. I bough different models before I get one that works as expected. Almost all the microphones breakout boards I found only detect impacted sounds, like hand clapping. I need one enough sensible to capture voice.

Electret microphone circuit boards

The advantage I found with these microphones is that it possible to connect them directly to an analog to digital converter. Then the signal can be interpreted by a microcontroller.

Testing the microphones

To find the best one for me, I first check with my DSO Nano oscilloscope what is going on at the microphone circuit output. But the real test has been to hook the microphone to my Arduino ADC input. Then with Processing, I plotted the value of the analog input on my screen. This way I really saw how they reacted to sounds and what can I get from it.

Multiplexed analog to digital converter

Then came the time I tried with two. I quickly faced the fact that the Arduino ADC reads only one input at once. It cycled to read all entries. The delay to switch from one to another take a few milliseconds. Because my idea is to get the highest microphone input at precisely the same time, using this method is useless. This delay broke all my expectation of simplicity.

After some thinking and Googling, I saw a way to use the Arduino’s ADC as a comparator.  This idea may be interesting for testing purpose, but it only works with two inputs. I continued my research and look for other microcontrollers, circuits or chips. I saw some very expensive professional devices, no microcontrollers that can do that, and finally a bunch of  ICs (AD7865) specialized for that task. However, I did not found any breakout boards for theses simultaneous-sampling ADC ICs and build one is a project by itself. So I slept on that.

Compare analog inputs

The next day I imagine another way. Not tested yet. I will need to put some parts and wires together first. My idea is to compare each input with an Op-Amp, then send the digital logic output to the Arduino.

Compare three inputs

The microcontroller will be able to understand which microphone is the highly stimulated. I think it will be possible to sample the data over a short period of time, then average the result to know which direction the sound come from. So the next step is to put all this on my proto board and test my theory!