Technologists That Build Their Own Systems

  • Thread starter Mepis
  • Start date
  • Tagged users None
Ignignokt

Ignignokt

350
93
So - the meter will set you back maybe $250.00. I like the dew point output - but I could calculate that myself. I think this is the easy approach to integrating a CO2 meter with a Raspi to create a controller that can be monitored and manipulated over a network. That is one aspect where most other controllers will cost you dearly to get network access. And even then - they do not let you customize (I really hate that).

I digress.

So - first cost cutting option is to obtain the CO2 sensor itself. The AMPRO meter uses a sensor that is available from sources in China - Winsen. I've seen them for a variety of prices, however the best deal I've found so far is:

http://sandboxelectronics.com/?prod...art-5v3-3v-interface-for-arduinoraspeberry-pi

As it turns out - this sensor has a serial output and has a similar data stream. I've found the Raspi to be otherwise problematic for direct integration - so I've used small arduino controllers that then connect to the Raspi over a USB port. Part of the reason for this is to disable the built in recalibration. That can only be done over the I2C interface.

So with a Raspi (~$35.00) and the sensor (~$70.00) you can have a network accessible CO2 controller and monitor for a bit over $100.00.

My current incarnation of the design uses only a SAMD Arduino (like the zero) with a wireless network connection to a Pi running MQ server. The idea was to move to a IOT compatible framework like MQTT.
 
M

Mepis

45
18
That looks really interesting I'm going to have to come back and take a look at it again later or tomorrow. I'm not seeing how you're pulling data from the handheld scanner. I'm also really tired, just woke up, and only got a few hours of sleeps thanks to my catholes...

I'm currently dumping time into HerbJourney. After I get that to a more usable product, I might take a stab at integrating your work and design with it. I plan on adding Pi support to it later on for logging, so this fits right in there. It might be a little bit, but I'll be looking at and contributing to the source.

I guess I should digress a bit. From when I put up this post, after numerous talks with an awful lot of people, I decided to take what I was building and turn it into an open source thing anyone can install on their own server or just go to the website and use. I'm keeping it open-source for security / trust / privacy issues. I settles on a name and am calling it HerbJourney. The website is live and usable now, though consider it in an Alpha form ATM. If anyone wants to use it, I'm looking for feedback for use and any potential bugs.

At any rate, I didn't see a github link or anything for yours. Do you have one? If you don't, or would prefer not to attach your Github account / real information to this, do you mind if we have a quick chat sometime so I can get a better idea of how you have things wired, your ideas for the CO2 logger, and post it to a github repo under my account? HerbJourney (Garden Tracker on Github) is already out there with my information so I don't mind posting a repo at this point.
 
M

Mepis

45
18
Still not awake, but I'm seeing where you are pulling the info now. I'm not completely understanding the assignment though. Can you explain how the assignment is working?

declare -i sample=`echo $val1 | sed -e 's/C//' -e 's/ppm//'`;

I'm getting that you're assigning an int value to sample through an echo statement but I'm not understanding everything after the piping '|' operator? What is sed and what do those switch flags do?
 
Ignignokt

Ignignokt

350
93
The data stream from the meter looks like this. Two Lines - the first is a header and the next is actual data.

$CO2:Air:RH:/DP:WBTf9
C1176ppm:T79.3F:H34.2%:d48.6F:w60.9F16


( I had to add the '/' to keep the smiley from replacing the text)

So the data is:
CO2 Level in PPM
Temperature internal to the sensor
Humidity
Dew point
Wet Bulb Temp

I do not save or use WBT.
 
Ignignokt

Ignignokt

350
93
declare -i sample=`echo $val1 | sed -e 's/C//' -e 's/ppm//'`;

So you can see - lots of extraneous text that needs to be filtered.
For the PPM reading, I just want the integer contained in $val1. I used 'sed' to strip the 'C' and 'ppm' text.
 
M

Mepis

45
18
That makes sense. I'm wondering if it would be worthwhile to buy external sensors for the pi or just the device and interface it with the pi? The easy of connecting this thing up seems easy enough.

I think I would also prefer to dump the data to a SQL DB. That would make presentation easier. Essentially, I would love to interface what you made with HerbJourney so that people have an easy way to build external sensors and log it to their journal. At some point I'm going to have to build an API to abstract the hardware from HerbJourney and let the user do whatever they see best. But I would love to have an easy instruction thing setup where I could say "download this iso, flash it to sdcard, install on Pi, connect sensor to pi, turn it on" kind of deal. This device looks like it would be easy to do all that with.

If I can scrape together funds at some point I'm going to buy one of those Amprobe senors.
 
Ignignokt

Ignignokt

350
93
I know lots of folks use the Pi itself for sensors. But rarely are they using more than one or two. I'd never consider this route until they put 4 cores in the Pi2. Even then - Running the OS and other stuff makes reliable timing of samples a bear. I've done lots of design - with various budget targets. The Pi does the OS and Web really well. Can run a script reliably. But I2C is not all that swell. I've found using Arduino for I2C and connecting that to the Pi over USB offers yet another benefit - you can put the Arduino development environment on the Pi. I've done this a number of times.

Life is too short and Arduinos are cheap.

I've attached 6 sensors to Arduino I2C and run reliably for months.
 
M

Mepis

45
18
I haven't played with i2c much. And you're right, life is to short. Unless you think you couldn't get a reliable reading once every 30ish minutes, I'd just go straight to the arduino. You can get a zero (maybe someday) and an arduino for maybe $15ish? That's to cheap to pass up for reliability for an interface/controller to push data to the web.
 
Ignignokt

Ignignokt

350
93
You can get a suitable Arduino SAMD (zero compatible) for about $20 now.
https://www.adafruit.com/products/2772

For ~$35 you can get the lowest power draw wireless chip on-board.
https://www.adafruit.com/products/3010

I just received a package this morning from Malaysia with 2 zero-compatibles that have a wireless device that can transmit a low-speed data stream up to 20 miles - and LiPo support. $34. Dude - in my world, life is pretty good with exchange rates being what they are.
 
Ignignokt

Ignignokt

350
93
One of the things to keep in mind with automation - If you don't somehow close the loop (sense reality) - bad things are bound to happen. And 30 minutes is forever. I'm comfortable with a 10 second sample rate for the CO2 valve because I set the flow rate at the tank - you adjust it for the size of the space. For my 5x9 right now - about 4cuft/min. I set the flow to be for a rapid working level attainment without too much overshoot in level - 1200 to 1500 is the desired range. Much more is probably wasteful and makes the enclosure unfit for humans for any length of time.
 
Savage Henry

Savage Henry

960
143
Can one of these
Be used thru a raspberry pi to log soil moisture and trigger a timed irrigation event, or would it be best to get a logger/controller from the same manufacturer as the tensiometer?

I'm going to try out a couple analog versions to get the feel of them and dial in my pump timers, but it would be awesome to eventually have the irrigation fully automated.
 
Ignignokt

Ignignokt

350
93
Can one of these
Be used thru a raspberry pi to log soil moisture and trigger a timed irrigation event, or would it be best to get a logger/controller from the same manufacturer as the tensiometer?

I'm going to try out a couple analog versions to get the feel of them and dial in my pump timers, but it would be awesome to eventually have the irrigation fully automated.

Not directly. Raspi is 3.3v only.

Option “RSU-V” - Voltage Output IRROMETER could be used with level shifting as simple as a resistive divider. You would then have to re-scale the output based on the divider ratio.

Thanks for bringing this sensor to my attention! I am slothful and need to automate watering or go DWC.
 
M

Mepis

45
18
Man, I was just thinking about going dwc the other day, I suck at judging the wet/dry cycles by feel, always been more of a numbers guy.

Me to. That's why I'm making Herb Journey for people - to help with those kinds of things.

@Ignignokt I was thinking more of a 30 minute sample time for general data logging. You're controlling co2 levels with your setup and not only monitoring. I can understand why you wouldn't want a 30 minute interval. I think for controlling even 10 seconds might be to long.

This did get me thinking a bit. I don't remember seeing any safety mechanisms for the valve control open and close procedure. A timing flag to wait x amount of time if it is closing before opening again. I could see in some environments that threshold number getting tripped rapidly and raising and lowering above and below that threshold and driving that solenoid nuts with constant moving (opening and closing). It would be like hitting the garage door opener a lot.

@Savage Henry Ada fruit had a couple of moisture sensors that were like ~$5 and compatible with a direct connection to the pi. They were all i2c based though. I think with a water meter you could have a lot more lenience with accuracy since its a lot more of a fuzzy measurement anyway (a lot wider of a threshold for accuracy here). @Ignignokt might have more knowledge with the i2c interface then I would though. Still, I think that could eliminate the Arduino though.

What I haven't found is a solenoid that is compatible with a direct connection to the pi. They require more power then the pi can put out. There are a bunch of relays on adafruit though that could control an electric garden hose solenoid on Amazon for pretty cheap. I looked into them a couple months back and they looked plausible enough.

At some point I'm going to automate the water and feeding cycle, mostly so I can do it remotely and watch it with a webcam. I was more in a hurry to do it, but then I realized I liked the ritual of taking care of my plants. It would be nice to not be married to it though. I'd like to have data on when it was done, how much and of what when it is, and if I want, to be able to press the button to initiate it (because I'm a child and like pressing buttons...). Funds are going to slow me down for a bit to. One step at a time.
 
We Solidarity

We Solidarity

1,610
263
@Mepis @Ignignokt

I've been doing commercial installs, consulting, and cultivation for 6 years, I would love to help you guys set up a PLC monitoring system, I've been looking for someone who can do the programming. Shoot me a message and I'll show you what I've got so far in terms of compatible equipment.
 
Ignignokt

Ignignokt

350
93
DWC - Deep Water Culture
There are a number of variations folks use that fall in this category - some recirculate nutrients, others don't. This method is pure hydroponic - using a small amount of anchor material (hydroton or whatever).

Among other notable differences are the nutrient concentrations - less than concentrations used with Coco and other non-soil mediums.

As for how to switch AC with a Pi ? Easy-peasy. I've used solid-state relays of this sort
- https://www.amazon.com/uxcell-SSR-2...=1471451229&sr=8-1&keywords=solid+state+relay

However this requires an enclosure to keep shock hazards at bay. I think a better approach for most folks is:

http://www.digital-loggers.com/iot.html

This device can be driven directly from a 3.3v logic output from a Pi or other comparable micro and will switch up to 12A resistive load comfortably.
 
M

Mepis

45
18
I'm pretty comfortable with both options honestly. I've looked at similar transformers in the past. I'd personally go with the transformer just because the garden hose solenoids I've looked at and have saved in my wish list are not pre-wired. The other iot device would work great for a pump.

I always figured on using the solenoid because then I could have a pump running 24/7 and always circulating that water from the resi, whether you're doing soil or hydro. That way everything stays mixed better. Kind of the same principal that a fuel pump operates on a car. It always runs in a closed loop and only opens as needed (sorta, loosely based).

I'm loving this thread folks btw. You folks are giving me all sorts of good ideas and making me think a little. :-)
 
Ignignokt

Ignignokt

350
93
Well, I've pulled in my outdoor

IMG 0445


And now its time to plan the indoor thang.

I came across a compelling project - originally meant to support mushroom growing environments. The project name is Mycodo, written in python https://github.com/kizniche/Mycodo

It provides real-time graphs, PID control, control of relays, sensor data collection and actions driven by sensor inputs. Well written, the code works pretty darned well, with error recovery and messaging done to a finished product level. GPL 3.0 license.
I think it can be adapted to gather data and control my indoor setup. I've built a hardware platform to kick the tires and have it monitor some cuts and seeds for a few months. Underneath the protoboard is a Pi3. There is a CO2 sensor there on the side, and some assortment of sensors (remote temp for canopy, LUX for lamps) to test the code. This design has 12 added I2C buses to support sensors, so I can instrument every plant separately.

IMG 0460
 

Latest posts

Top Bottom