PiPlanter | Interfacing an ADC, Python, and MySQL [Documentation]

As this post is more of an update, I won’t be adding any explanations, just giving the python code.

This will read 3 values from the adc and put them into the database “adc_database”. It will put them in the table “adc_input_data_4” in the columns “Channel_1″,”Channel_2” and “Channel_3” respectively.

There you go, bigger post coming later tonight.

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.


  1. Love the derp. Love the blog as well – planning on adapting your PiPlanter idea to my situation. Everything has been very informative.

    I’m just wondering, based off your blog and other searching, how one would go about connecting two ADC’s to the RPI to essentially expand the number of analog sensors?

    I have 2 “zones” for planting that I wish to gather all the sensor data from, as well as several hygrometers, working out to about 15 sensors overall. With the MCP3008, it would appear I’m limited to 8 inputs. I was unable to find a larger newbie friendly ADC with more inputs, but I did note the CS0 and CS1 pins that would appear you could use for two ADC’s sharing the SCLK, MISO and MOSI pins?

    I apologize if this is a bit far out for a comment 🙂 But I do appreciate your input!

    1. Hey, I’m not totally sure if that would work out, but It might be worth it to experiment. Please come back if you find out if this works.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.