Another automation system (controlled environments)

Hi everyone

I've been lurking around the arduino forums for some time and there are some really great ideas floating around. I've started a thread before aking some advice on communications between the arduino and python and had some contructive feedback.

Saying that I woke up this morning questioning my strategy as to how I'll get this project working.

As the title suggests I'm interested in controlled environments and as such want the arduino to be the "brains" behind the operation. Now I have been working on this project for a few months and come across a number of obsticles but I feel however that the way I'm approaching this is not that efficient. I know this is an "arduino" forum, although I feel I need to explain all technoliges I use to give the reader a better understanding on what I am trying to accomplish.

My project in a nutshell: Sensors are attached to inputs in the arduino mega. Relays are attached to outputs on the arduino mega. A raspberry Pi, which hosts the webserver and mysql database, is attached to the arduino mega. My goal is for sensor readings to display on a website and relay setpoints (entered on website) to controll arduino outputs. I also want this to be as near to real time as posible but Im happy with say a 20second delay between entering in data and then the arduino receiving the data.

At the moment sensor values are stored on mysql, which is read by the webserver. Relay setpoints are read into the webserver and stored in mysql. Reading to and from the arduino is done with python scripts. I actually use two scripts, one for logging purposes and the other for updated sensors/relay information. The problem I face is sending sensors values to mysql and receiveing relay information from mysql at the same time ( I can do separately).

So I would like to know how I accomplish my project in an efficient way that hopefully will run smoothly which will not corrupt strings or use unneccesary resources. I have seen forums on using EEPROM but its so confusing to me and I dont know why I cant accomplish this by just reading into or reading from mysql. I've tried to look for threads with similar goals but have struggled to find any meaningfull or well explained documentation

Any feedback is appreciated!

This seems like a lot of work!

What you basically want to do is make a webserver to display settings and values for your environmental control?
For these kind of projects i use things like arm processors that have Ethernet on-board and just develop everything
in one chip.
Don't you think this could save some time?

I use arduino's for controlling some servo's together and RGB led's and that stuff, for the more complex stuff i use
things like the stm32f407 and for things to run linux you could use things like rasberry-pi.

But this is just my opinion so if anyone has other ideas feel free to correct me.

Thanks for the reply

Yes essentially I want a website to display sensors values. I then want to to able to adjust values (on the website) to control relays. For example turn lightx on at 9:00 and turn off at 21:00. While Tempx is greater than 30C turn on fan, etc.

Taking into account that I have the webserver working and the sql database working and am able to communicate between it all. Saying that I can't send and receive serial at the same time, I can either send out sensor data from the arduino or receive data into the arduino but NOT one after the next. I hope this makes sense, its all confusing!

So really my question is what options do I have.

You need something like this —

apduino.org

apduino.com

1ChicagoDave:
You need something like this —

apduino.org

apduino.com

yes I am trying to make something similar to that but not requiring the user to register. Another example is yieldbuddy.com