My Arduino & LEDs

apoulin

Well-Known Member
Links? Curious about the probe manufacturer :joint:
PH Sensor and probe kit - $127.99
EC Sensor and probe kit - $191.99

These are some sensors that I found that said they were lab grade which is why they are so expensive, I have not done too much looking around. But I figured if I bought one at a time and added them as I could afford them, that would set up a killer monitoring system for me.

Just like everything else in my build, I would rather take the extra time and spend a little extra money for a better product. If I could get these lab grade sensors monitoring my system, I would be able to use them until the parts went bad. So 5-8 years from now, I could still be monitoring and logging temp/humidity/res temp/res ph/res EC.

Even if I expanded my hydro setup to multiple tubs, I would be able to throw all of this into my control tub and still be able to use all of my equipment.

Honestly I am using a TDS meter right now, I have really been looking for a better way to measure nute strength. This is why the EC sensor has me intrigued, it is expensive, but once I have it I will have very accurate testing tools for years to come. I figured since I have the arduino up and running I would only buy sensors in the future, no more hand meters or anything.

I am worried about doing anything on "the cloud" too! I def think no matter what option I choose I am going to just set up a server on my LAN and have the computer doing all of my leg work, and then be able to view it from my phone/laptop while at home. As long as it logs into a graph, I guess I can check it all when I get home and not have that connectivity away from home.

:peace:bongsmilie
 

apoulin

Well-Known Member
Yea I have been browsing that thread. There are a lot of interesting ideas, many may be imitated but not for the exact hardware/software I have.

Windows 7
Arduino w/wifi
Router
Plus a couple of data logging software options that have been mention above

I'm just excited to get my parts in tomorrow, get everything properly installed and logging. I have to wire up the wifi, get that working and get it communicating with my computer.

The bittersweet part to all of this is that my current grow has maybe a couple weeks left, then I am harvesting and moving. Once I move I won't be able to get another grow going for about a month, so I am going to get all of these sensors working how I want and then not use my setup I have just pieced together.

I am already excited for my next run!!!!


:peace:bongsmilie
 

Abiqua

Well-Known Member
Yea I have been browsing that thread. There are a lot of interesting ideas, many may be imitated but not for the exact hardware/software I have.

Windows 7
Arduino w/wifi
Router
Plus a couple of data logging software options that have been mention above

I'm just excited to get my parts in tomorrow, get everything properly installed and logging. I have to wire up the wifi, get that working and get it communicating with my computer.

The bittersweet part to all of this is that my current grow has maybe a couple weeks left, then I am harvesting and moving. Once I move I won't be able to get another grow going for about a month, so I am going to get all of these sensors working how I want and then not use my setup I have just pieced together.

I am already excited for my next run!!!!


:peace:bongsmilie
Kinda sucks you have to get it all running and then put it all away to wait :) but its probably worth it.....

another program about digging out the link on aqua/hydroponics....Xively is an online API that will monitor your sensors and graph..

another reason I ask about sensors, is that I worked in a lab at one time...really the quality of measurement is determined more by the quality of the calibration standard [usually a solution]....I don't think it is all that necessary...since the chain of custody is lab settings is more of a oops prevention than a guarantee of quality...over a "lower" priced sensor....

All I am saying is that I think you could save yourself at least half by reading up on the sensor circuit and what the best material for the probe measurement, is.... then put it together....For instance, look for the ORP Kit, it is nice, but the probe alone can be found for about $38-43 and that circuit is not hard to build, this is arduino after all, just my thoughts,, sorry if I keep hijacking the thread

Trying to order a wifi module tonight to work with my adhoc network and then I can ditch the cable to the Duino....also received some parts myself tonight...


Mainly just a Nano 3.0 16bit, they are freakin tiny!

 

Attachments

apoulin

Well-Known Member
Kinda sucks you have to get it all running and then put it all away to wait :) but its probably worth it.....

another program about digging out the link on aqua/hydroponics....Xively is an online API that will monitor your sensors and graph..

another reason I ask about sensors, is that I worked in a lab at one time...really the quality of measurement is determined more by the quality of the calibration standard [usually a solution]....I don't think it is all that necessary...since the chain of custody is lab settings is more of a oops prevention than a guarantee of quality...over a "lower" priced sensor....

All I am saying is that I think you could save yourself at least half by reading up on the sensor circuit and what the best material for the probe measurement, is.... then put it together....For instance, look for the ORP Kit, it is nice, but the probe alone can be found for about $38-43 and that circuit is not hard to build, this is arduino after all, just my thoughts,, sorry if I keep hijacking the thread
Trying to order a wifi module tonight to work with my adhoc network and then I can ditch the cable to the Duino....also received some parts myself tonight...

Mainly just a Nano 3.0 16bit, they are freakin tiny!

No no no please keep the convo going, I am loving the information and ideas being thrown around here. I was unsure about the sensors, I did see that there were some cheaper sensors and probes that could be bought individually. What you said makes sense, I def think that it would cheaper to build it myself, I was just worried about the quality quality sensors.

I literally just got the package I was waiting for, I was typing this reply and just got a knock on the door from the UPS guy. I will have some updates later on today.

Yea it does suck that it all has to be put away soon, but I guess I can take that as the time to buy my other sensors and get them calibrated and working properly. I was reading and I liked the idea of the server taking a picture of the grow area every few hours and saving it, I think it would be really cool to have a completely logged and graphed grow with a seed to flower picture journal.

:peace:bongsmilie
 

alesh

Well-Known Member
No no no please keep the convo going, I am loving the information and ideas being thrown around here. I was unsure about the sensors, I did see that there were some cheaper sensors and probes that could be bought individually. What you said makes sense, I def think that it would cheaper to build it myself, I was just worried about the quality quality sensors.

I literally just got the package I was waiting for, I was typing this reply and just got a knock on the door from the UPS guy. I will have some updates later on today.

Yea it does suck that it all has to be put away soon, but I guess I can take that as the time to buy my other sensors and get them calibrated and working properly. I was reading and I liked the idea of the server taking a picture of the grow area every few hours and saving it, I think it would be really cool to have a completely logged and graphed grow with a seed to flower picture journal.

:peace:bongsmilie
I'm not sure about that but I think that Arduino might be able to handle photos itself. Maybe it's just me but I'd require Arduino to be standalone ie fully functional w/o a server.
edit: after typing Arduino camera into Google, I'm sure it can be done.
 

apoulin

Well-Known Member
You're inspiring me to try this.
That was my goal man, just trying to give back to the RIU community that has helped me so much. I am just trying to put together a system as cheap as I can, with good components to get the best results the easiest/fastest way possible.

I hope that by the time I have my system set up that anyone can order the parts and hook it up without any issues, this is also why I am not going too far down the circuit building road. Manufactured parts with codes and examples is the way to go in order to show the masses. Computers and small electronics has been a hobby/passion of mine for a while and I am glad I can finally integrate it with the great ganja lol Now if I could just figure out a way to do this all day and get paid......lol

Off to class, then will be hooking everything up!

:peace:bongsmilie
 

ttystikk

Well-Known Member
I'm not sure about that but I think that Arduino might be able to handle photos itself. Maybe it's just me but I'd require Arduino to be standalone ie fully functional w/o a server.
edit: after typing Arduino camera into Google, I'm sure it can be done.
Raspberry pi is another board that's similar and compatible with Arduino. It it is much more video oriented, even has a mini hdmi output with hdtv capability.
 

Abiqua

Well-Known Member
Raspberry pi is another board that's similar and compatible with Arduino. It it is much more video oriented, even has a mini hdmi output with hdtv capability.
The pi is intriguing because it combines a lot more features from the get-go, but its Linux, but these days you can also just run a Windows emulator if you really wanted 2.......

I like that you can log data as well as collect it and send it all in one unit..Arduino is compatible with just a little hardware add-on....too....

Especially good for those who want an almost out of the box, hi def capable recorder....
 

_MrBelvedere_

Well-Known Member
Of course you need the charts and reports to impress management!
lol
Anyone know anything about Plotly. It says it is a real-time graphing program that is for the arduino, there is a tutorial for using a DHT22 Sensor w/arduino. All of the sketches are written, it is well documented. There were a lot of remote sensor examples and the graphs had no indication of what they were monitoring, so maybe security wouldn't be an issue as long as there aren't any video/picture feeds:leaf:

I can't wait for my parts to get here so I can get it all set up and logging, that is the first step lol At that point choosing a way to easily graph them should be pretty easy considering all of the suggestions on here.

I know the EC sensor and PH sensor are pricey >$100 each. What are your thoughts on this? Which would you buy first and why?

:peace:bongsmilie
For everything you have in mind for your controller, would really recommend getting an Intel NUC and start with programming that because it's going to be way faster to learn to program on a quick machine then a slow Arduino. The NUC should be the main controller and the brains of the operation. You can have their Arduino "do one or two simple things well" like connect to the sensor and send data in real-time to the NUC. The NUC will be able to have multiple Arduinos talking to it over Wi-Fi or ethernet. The NUC will give you a nice responsive display- not a super slow laggy display from an Ardurino. I would start with a NUC and one sensor and then use any graphing API on the NUC to show you the readings. With the NUC you could quickly save the data in a POSTRGESQL db. Writing the log data to postgreSQL will be much better and faster than writing to a flat file. Reading and writing flat files is often times a disaster because of file locking problems.

http://zetcode.com/db/postgresqlpythontutorial/

Good luck take one baby step at a time or it will be hard as crap to learn :)

For example, just get the Ardurino to poll every 5 minutes and read the sensor data and display it in realtime console (don't worry about graphing it) (it sounds like you already accomplished this step)

Then set up the db on the NUC

Then update the ardurino code to INSERT realtime data into the db during the 5 minute poll.

Then write some code on the NUC to SELECT records from the db and display the records in console. (Just to smoke test that the data is there and you can select it)

Then write some code on NUC that uses a chart API to SELECT records from db and display them.


With baby steps like this you are not biting off more than you can chew, it is fun and not frustrating :) and you will end up with a stable system that is rock solid and your plants will be healthy :) All I would do is build a system that will send a text msg ALERT and for extra credit blink all the desk lights in your house on and off if the reservoir is bone dry. Maybe an audible alarm. In other words just something to alert you when things have gone terribly wrong (power failure, reservoir failure, light failure, temperature extremes, etc) That's the most practical use. If everything is put into one giant controller then that's a single point of failure for everything.

To send a txt all you have to do is set up a SMTP2go relay that will send an email to [email protected] and the email will go to your phone as a text message for free.
http://www.tutorialspoint.com/python/python_sending_email.htm
 
Last edited:

_MrBelvedere_

Well-Known Member
Here is example code based on the above db tutorial...

First create a table in the datatabase named roomtemperature

Code:
create table roomtemperature (polltimestamp datetime, temperaturereading int4);
Then this code will work to read the most recent sensor reading from the roomtemperature sql table and if the temperature is greater than 90 degrees send an email/txt message alert
Code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

#import the postgresql library
import psycopg2
import sys
#import the smtp library
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

con = None

try:
   
    con = psycopg2.connect("dbname='testdb' user='janbodnar'")
    cur = con.cursor()
    print 'looking in db and get the most recent record based on the poll timestamp descending datetime'
    cur.execute("select temperaturereading, polltimestamp from roomtemperature order by polltimestamp desc limit 1;")

    row = cur.fetchone()

    while row:
        print 'we got a record, yeahh'
        # get the single record we need.
        row = cur.fetchone()
        #if the room is too hot send txt alert using email trick
        if row['temperaturereading'] > 90:
            print 'it is hot as fuck in this bootch'
            # see http://www.smtp2go.com/docs/python/
            username = 'USERNAME'
            password = 'PASSWORD'
            msg = MIMEMultipart('mixed')

            sender = '[email protected]'
            recipient = '[email protected]'

            msg['Subject'] = 'Room Temp Alert'
            msg['From'] = sender
            msg['To'] = recipient

            text_message = MIMEText('It is too hot in the room dammit', 'plain')
            html_message = MIMEText('It is too hot in the room dammit', 'html')
            msg.attach(text_message)
            msg.attach(html_message)     
     
            mailServer = smtplib.SMTP('smtpcorp.com', 2525) #  8025, 587 and 25 can also be used.
            print 'starting sendmail'
            mailServer.ehlo()
            mailServer.starttls()
            mailServer.ehlo()
            mailServer.login(username, password)
            mailServer.sendmail(sender, recipient, msg.as_string())
            mailServer.close()
            print 'Alert sent'

except psycopg2.DatabaseError, e:
    print 'Error %s' % e  
    sys.exit(1)
 
 
finally:
 
    if con:
        con.close()
 

Attachments

Last edited:

jtizzle

Member
This is right inline with some of my goals also. I have the background as well as quite a few micro controllers lying around. My first thought when you mentioned video or even scheduled pics was the raspberry pie, but the nuc is a full computer -heck just use a spare brokeass laptop that you have collecting dust - it will perform the same function as the $300+ nuc. Albeit power conservation comes to mind with either . I don't think one needs that level of computing power to perform some simple monitoring and / or automation. It's easy to let things get blown out of proportion.
If you have a simple micro controller based system that allows you to monitor and set timing for lights, then I think you are doing well. If you would like to step into the realm of automation, or event based actions, I think you may want to move to the microcomputer realm ie beaglebone / raspberry pie and realtime. I believe a microcomputer such as one of these will allow you to eventually build to all that you've mentioned -logging /monitoring / automation with the proper probes and solenoids /actuators.
I personally am interested in a custom led light controller using an arduino (or similar) micro controller that I can build on to easily set light schedules remotely and do some simple logging. You have already done all this work! Thanks! I must say that I also would consider an scr or high power mosfet to switch power vice a 5 volt relay. I have a mess load of 12 and 24vdc relays that are rated at 30A. I would feel much more comfortable with this level of overkill. A pull-up resistor and separate power supply may be required as the arduino cannot source much current for the relay coil, but I would feel allot safer switching large voltages with a beefier relay... perhaps even a contactor.
Thanks for starting this awesome thread! I am here for the duration. Things are definitely happening!


Sent from my iPhone using Tapatalk
 

heckler73

Well-Known Member
@apoulin or others have you gotten started yet? Or gathering dust? :)
I'm just waiting for parts to dribble in. Got my M3 taps today for mounting star PCBs.
Need to find a 2.5mm drill bit, though :lol: or whatever SAE equivalent I have lying around.
My cct (post-Arduino) still has an issue with timing, and I may add a delay, so that part is still in the breadboard phase.
Shipping from China has been mighty slow these days. I'm not sure why. Maybe it's peak season?
I have a Hantek 20MHz Oscilloscope coming (hopefully...unresponsive sellers, sigh), so that will help speed up my testing since I won't need to do it at the University. Time is the critical ingredient in all this. That's one thing which is difficult to buy from China.
 

apoulin

Well-Known Member
@apoulin or others have you gotten started yet? Or gathering dust? :)
Has been gathering dust lol I have been moving and enjoying my last harvest a little too much :blsmoke:

I just started a new thread for my new project. It is a 2 door storage cabinet which will eventually get the arduino brains added to it. One step and a time lol

bongsmilie:peace:
 
Top