Site has been down

You’re currently reading this via a virtual server running on top of this server, which is hosted out of my residence in southern Maine. For the most part, I generally enjoy the challenges and obstacles that come with self-hosting this website but it becomes very very annoying in cases where there is physically nothing I can do. Take these past two days for example.

Storm!

Sometimes it snows a foot in an hour and the power goes out for a few days. Not much I can do about it, sorry for the inconvenience. If it’s any consultation, Twitter isn’t hosted out of their parent’s house and you can follow me there where I typically post if my site is up or down.

Thanks for reading!

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiPlanter 2 | Installing a 3rd Instance of the PiPlanter

Ten days ago I finished installing the third ever instance of the PiPlanter in a lab in the physics department at my college! I went with the the rack mounted design as I did this past summer, and am going to be growing Basil, Cilantro and Parsley as opposed to tomatoes. Here are some photos of the new setup:


There are a few major changes that come with this new instance. The first and foremost being the addition of LED grow lights. I’ll post a new version of the code with LED routines included when I think it’s polished enough. The second difference is that a tray of soil is being used as the growth medium for the plants as opposed to pots of soil. This will more than likely be the configuration I use moving forward. The final difference is the actual type of plants being grown. I’m moving away from tomatoes because there will be nothing to pollinate the flowers in the winter as well as the fact that I cook a lot and it will be neat to have spices that I can use on a day to day basis.

The first 10 days of growth has gone well. Here’s a video of them growing so far:

Thanks for reading!

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiPlanter 2 | DIY Lite Version Release!

Since I returned to college the PiPlanter has been running without me having to do any maintenance on it at all. The plants are still alive and growing and all processes associated with the PiPlanter are still going. I figure now is a good a time as any to bring together all of the work I’ve done to till this point in one concise post.

This does NOT mean I’m done working on future versions of the PiPlanter. I’ll hopefully write another post stating goals for the future sometime soon. Now onto the build tutorial.


 

The Hardware

 

First, the hardware of the project. A good place to start would be the parts list:

In the previous version of the PiPlanter, I didn’t have a concrete parts list for the project. Hopefully I’ll be able to keep this spreadsheet updated if the project changes. A lot of these components are mix and match, you could use pretty much any pump (The math for volumetric pumping is done with this pump) or any tubing or any power supply that can do 12v and 5v. A computer PSU would work great as well.

This is the hookup guide for the system:

(Thanks to tamps for the help!)

The two sets of header blocks are to be replaced by the moisture sensors, and the motor replaced with the pump.

For a physical configuration, I’ve found through multiple times doing this that mounting it on a wire rack works the best as seen here:

Edit (10/19/2014) Here is the same group of plants two months later without any direct human interaction. They grew from the light in the window and used up all of the water in the reservoir which was totally filled before I left.

To distribute the water to the plants, attach the vinyl tubing to the outflow of the pump and seal off the other end of the outflow tube. Run the tubing along the plants and drill holes wherever you’d like the water to exit.

You’ll also need to install the camera module in the Pi and point it wherever you’d like the frame of the photo to be.

 

The Software

As a preface, I’d like to at first say that this software was written entirely by me. I’ve never had any formal training in programming of any kind, so if there are obvious flaws with my code please let me know. That being said, I’ve found that this system is very effective and has worked for me and kept my plants alive for months.

All of this runs off of a base install of raspian on a raspberry pi model b.

There three major parts to the software. First, the prerequisites:

You’ll need to enable SPI on your Pi in order to use the MCP3008 ADC. Do this by running the following commands:

Comment out the spi-bcm2708 line so it looks like this:

Then run this to make it more permanent.

And finally reboot your Pi with:

Then the php code that renders the pChart graph. More details for installing pChart here and officially here.

And now the star of the show, the python script:

Before running, make sure you make the following changes to the script:

You’ll need set up access to twitter API’s, seen here. You’ll need to input your information about your twitter app into into 331-334 of this script.

You’ll need to input information about your YouTube account on line 429

On line 473 you’ll need to input your mysql information.

 

Output Demos

The PiPlanter is very connected. It renders graphs of data, takes images and renders timelapse videos.

Here’s a standard tweet showing the plants:

Here’s a tweet showing a day’s worth of data in  a  graph render:

Here’s a tweet showing a week’s worth of data in a graph render:

Here’s a timelapse video of three days:

Follow @PiPlanter_Bot for updates on my plants.

That’s pretty much it! Please feel free to modify this code for any use you’d like.

All of my research on this project can be found here.

Thanks for reading, and please leave a comment if you like my work!

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiPlanter 2 | Updating Dependencies

In addition to the directions in this post on getting the ADC working, the following must be run to get the current version of the PiPlanter up and running.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiPlanter 2 | Moving again

I bought a wire rack from walmart and put the PiPlanter back inside my house. Hopefully the plants will live longer than they did last year so while I’m at college I can continue to develop on this model. Images below.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiPlanter 2 | Solving Broken Pipe Errors [Errno 32] in Tweepy

If I haven’t mentioned it already, https://twitter.com/piplanter_bot IS the new twitter account for PiPlanter. Like last time, I’m using the tweepy library for python to handle all things twitter for the project. What I’m NOT using this time is Flickr. From a design point of view, it wasn’t worth it. It was too complicated and had too many things that could go wrong for me to continue using it. Twitter is more than capable of hosting images, and tweepy has a very simple method of passing these images to twitter. Recently I moved the whole setup indoors and mounted it all onto a shelf seen here and it came with a set of strange problems.

Long story short, what I think happened was that since I moved them to a different location, the complexity of the images increased, causing an increase in the size of the images themselves. A broken pipe error implies that the entirety of the package sent to twitter wasn’t sent, causing the tweet not to go through. I first started to suspect this problem after seeing this:

 

The graphs were going through just fine, but images were seeming to have a hard time. You can’t tell from this photo, but those tweets are hours apart as opposed to the 20 minutes they are supposed to be. Once I started having this problem, I bit the bullet and integrated logging into my project which produced this log:

Hours and hours of failed tweets due to “[Errno 32] Broken pipe”. I tried a lot of things, I figured out that it was the size of the images after seeing this:

Photos that were simple in nature had no problem being sent. After scaling the image size down, I’ve had absolutely no problem sending tweets.


If you are tweeting images with tweepy in python and getting intermediate Broken pipe errors, decrease the size of your image.
Thanks for reading.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiPlanter 2 | New Code Version / Temporary Setup

Hello! Here are some images of the new grow setup:

and here is the working version of the code:

I’ll do a much more thorough post when the project is further along. For those playing along at home, you can see that I’ve totally re-written the code for this new version. So far, it has much less functionality but much more stability and flexibility.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiPlanter 2 | Another Plant Update

They’re getting bigger!

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

Smart Speaker | Modifications and Repair of Lepai LP-A6FM/USB

When trying to charge a cellphone via the USB port on the amplifier, I blew a power resistor and the 5v regulator on the amp. The following images show the repair process:

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

Smart Speaker | Full Working Prototype

Here is a video of the whole thing working:

The whole system works! If you look at this post, which basically shows the whole thing can be battery powered as well. The following photos show the way the cable is run out the back of the housing. Both sets of the 3 wires are tied together and then to the output of the digital pot:

Contrary to what I thought, the 10k ohm digital pot can change the volume just fine! To be safe though, I ordered an SPI digital Pot that can do 50k ohm resistance.

Here is the new working version of the code as well:

The only difference between this one and the last version I posted was the height of the check value. I made it further away from the sensor.

Before the code is “finished” I would like to add a few things. The first being an averaging loop in the raw input ; instead of just using variations of map(analogRead(IR_rangefinder),20,600,0,9); each time, I’d like to maybe write my own function that is more general for assigning comparison. The downside to this however is that it may slow things down and the top priority with this project is keeping it fast and accurate.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.