PiPlanter | Going from analog data to the web using python, mysql and php

Here’s a video:

Essentially, the adc reads an analog value and sends it to python. Python connects to a mysql database and adds the data to that. Once the user accesses the php script, a table, containing all of the values, is rendered.
First of all, you’ll need to make a mysql table with the correct specifications:

This creates a table that is found in the python script so it is very important that the TABLE values match as well as the column names.
Here’s that python script:

This reads the values from the adc (it is wired up as seen in this post)
Here’s the php, it reads the values from the adc_input_data_10 table on the adc_database.

This is all very preliminary stuff, and I’ll tighten up the code as time goes on.
Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone, but 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.

Leave a Reply

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