Have Goal; Need advice to create arduino sensor...

Hi All,

First time poster here. I'm an applied statistician, primarily interested in arduino for data collection (sensors -> arduino -> server -> database), and secondarily to learn more about microcontrollers/sensors. Most of my projects are data capture (get data, send it somewhere). One of the projects is an extension (for my garden- if soil is dry, then water, wait 12 hours, repeat)

Background:
I did some research in undergrad using matlab and a breadboard, so I know some basics; worked as a software engineer, so I can set up dev environments, have experience with systems administration. Hope to use python scripts on my server to capture data from the arduino.

Goals: Get Projects 1 and 2 working (and start project 2 in a way that it would support the extensions)

Project 1: "Easy" Project- data capture and storage.

Motivation: I'm working on spatiotemporal models of temperature, and I want to collect high spatial resolution temperature data (will go on my bike for my 25 mile commute to work and on the car roof)

Hardware idea: arduino + temperature probe + gps + sd card + battery + LCD + enclosure.

Software: read temp, lat/long, time, write to sdcard.

I read several forum postings, tutorial articles, etc and believe that having a DS18S20 temperature sensor on an arduino should work (but I don't know how to put a lead of an arbitrary length on it). That seems like the place I'll start (arduino + temperature). Haven't played with the SDK, but assume that it's pretty easy to do (I have little experience with assembly, but looks like I don't need to know too much?). Here are some initial questions:

  • What's the difference between an arduino and a freeduino?
  • How do I count I/O needs?
  • Which arduino model(s) would I want to buy?
  • What would you recommend for a hardware starter kit for these 2 projects (maybe I want a total of 3-5 arduinos at the end of the day?) Thinking an LCD, some temp sensors, light sensor, maybe sd card shield, maybe wifi unit (shield?), a gps, ... (no idea what accessories I need to connect the sensors to arduinos) Opinions on online stores?
  • what is a good way to enclose the arduino in a weather proof container? (tupperware with dessicant inside?)

Project 2: Collecting garden data

I want to measure temperature at 3 locations (above ground, 5 cm below ground, 10 cm below ground), light level, humidity if possible (saw something about an SHT-15), and soil moisture (really want to know the resistance of the soil, I have some home made sensors). I want this to sit in a remote location (my garden), and I don't mind storing data on an SD card, but would prefer to setup a wireless link to an atom server about 100' away. I assume battery power is the best option. The software side is "simple": read input from sensors, transmit, wait 30 min, repeat.

So the questions here are:

  • what is a good way of putting leads of various lengths on to the temperature sensors to get the sensor to 5 or 10 cm deep?
  • suppose I just want to read and transmit voltage from a circuit (eg I provide thermocouple wire, or I connect it to homemade moisture sensor or to homemade anenometer). (please correct my abuses of electrical terms- like voltage and circuit if I misuse them) Hopefully once I crack open the SDK this will become obvious.
  • what is a good way to enclose the arduino in a weather proof container? (tupperware with dessicant inside?)
  • is wireless ready for primetime? I want to focus on the data analysis, not on arduino troubleshooting. (I prefer 802.11, but might be able to work with bluetooth?) I saw some units on sparkfun for $70-90 each... seems pricey.

Project 2 (extension 1)
I have some old weather station parts (anenometer specifically). I can calibrate it on the server side if I can figure out how to connect it to the arduino. I don't think it uses any power but that it generates current, creating voltage as it turns? It's cable to the old weather station looks like a phone line.

Project 2 (future extension)
Ideally I would like to automate my garden watering. I was motivated by this post
(not allowed to use links on first posts)
Basically the software side would be: at 6am, read moisture levels; If in range 1, turn on water for k units of time, if in range 2, turn on water for k+1 units of time, etc; (would use weather forecasts in the future...)

  • Any idea what hardware I would use? I'm assuming some kind of servo/solenoid something? (No idea where to look to find that kind of thing)
  • Or, is there hardware (diy) to turn a 120v outlet on/off?
  • Suppose I had all that working and still had free time. Could somebody point me to a way to transmit to the arduino? (say an integer between 1 and 10). In the networking world, it would be nice to have the arduino query a webserver on my atom server (or any server, or just know to 'listen' every k hours)

Please let me know if you think that another platform would be better suited to either of these projects, but from what I've read, it seems like arduino is the perfect solution- small, low power, flexible, inexpensive, open source, etc.

Thanks in advance for all comments. I can blog about the process in detail as a way of saying thanks.

Best,
Blair

1 Like

Sounds like an interesting project. You might want to check out Xbee for the wireless. There is a good review page on Ladyada.net of the different types. Xbee Adapter

Thanks Pauly. I (back) ordered a started kit from adafruit earlier along with a gps and gps data logger shield and a couple of sensors for temperature, light, etc.

Sorry to be so clueless about wireless, but how do I receive data from the xbee and get it into python? I read the description, but it wasn't totally clear if the xbee explorer usb was for programming the xbee or for recieving its transmissions.

Is it

arduino+xbee <---> [pc <--usb-->xbee]

I found a python-xbee library on google code, but it looks a bit outdated... Do I hook up an xbee to my computer...

I think this post is about as good as I could find http and-then forums.trossenrobotics.com/tutorials/how-to-diy-128/xbee-basics-3259

Thank you much,
Blair

but it wasn't totally clear if the xbee explorer usb was for programming the xbee or for recieving its transmissions.

The XBee explorer performs both functions.

I think many of your questions are answered, and found with a bit of Mr Googles help.

Ones I haven't seen, and I am interested in :slight_smile: are:

what is a good way to enclose the arduino in a weather proof container? (tupperware with dessicant inside?)

My starting thought is a water proof torch/flash light, maybe with some plumbers PTFE tape, and epoxy to seal holes, but I am planning on using IR for data comms so it may solve problems which you don't have.

Is the LCD essential in the device? It requires a reasonably transparent piece of enclosure, which may limit your enclosure choices.

RS components sell watertight cases, and so may be a reasonable place to start http://uk.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&Nr=AND(avl%3Auk%2CsearchDiscon_uk%3AN)&tfgSearch=Y&N=4294954595&Ns=I18NPrc1_uk&Nso=0#resultArrow

To make searching easier, you might want to look at the appropriate standard definitions for types of enclosure. These apply in Europe:

then google for a match, e.g. ip65.

HTH
GB-)

Oops. I forgot to comment ...

Any idea what hardware I would use? I'm assuming some kind of servo/solenoid something? (No idea where to look to find that kind of thing)
Or, is there hardware (diy) to turn a 120v outlet on/off?

Do you need the Arduino to turn the water on/off, or can that be your host/server?

An area of concern is the amount of power needed for an occasional bit of sensing is quite low, so the whole thing could run off a battery for a long time, or even be solar powered with a small panel. Further, it isn't super critical. If it dies due to a flat battery, and you miss a few hours data, it is annoying, but probably not mission critical.

EDIT: When you need to control an external device like a pump, your power need may go well beyond a simple self contained sensor system. I've noticed a few threads describing solenoids 'latching' on or off, but that may overly limit your options. Think about powering irrigation from something else, with comparable power requirements, or use the irrigation systems power to run the sensor.

Another concern is when you want to control external systems, like a water pump or irrigation system, failure may have a large impact, like flooding your crops, which may be much more hassle than losing some data.

EDIT: Control the irrigation system with something with comparable levels of availability, or use something which makes it is easy to detect failure, and react appropriately.

Just something to think about.
HTH
GB-)

Thank you all for the excellent advice. My arduino starter kit + extras should be arriving tomorrow from adafruit. I have gone from zero knowledge to > 0 knowledge in about 10 hours of reading, and found that many of my questions are rather trivial given the right webpage. The project 1 (temperature + gps data logger) should be straightforward. I'm going to start with a gps + datalogging shield from adafruit, and a basic temperature probe (TMP36).

My knowledge has increased exponentially since I posted, and here's where my current progress is (current knowledge-wise progress since my arduino hasn't arrived yet and I couldn't find a simulator online in less than 3 min of googling).

As far as the garden arduino (garduino, growduino) project, I found many related projects (links available to anybody interested), with several on instructables.com, and at least one in the forums here, but none exactly like what I'm going for (I have an outdoor garden, ~2500 square foot garden, and make decisions about planting and watering based on soil temperatures at different depths, soil moisture, weather forecasts, etc)

To measure the temp at different soil depths in my garden, I'm planning to get a quad thermocouple interface (it seems a lot simpler and time saving compared to configuring 3 or 4 thermocouple interfaces myself).
http://ryanjmclaughlin.com/shop/quad-thermocouple-interface-12/
I'm still not 100% sure of the differences between an AD595 and a MAX6675, but it appears to be pins (14 vs 8), and perhaps one is capable of reading very low temperatures? I have discovered datasheets, but still haven't figured out what info on them will be most useful, and I haven't started saving/cataloging them either (organization opinions welcome).

There may be better alternatives (cheaper) for reading the temperature ranges in my garden, but I couldn't find anything definitive. I plan to stick the thermocouple probes out the side of a vertically buried piece of pvc, with the probes at different depths. The arduino will sit in a weatherproof enclosure on top of the PVC, and I'll run the thermocouple wires up the inside of the pvc. I like the flashlight/torch idea for the enclosure (thanks HTH/gbulmer). I'll also use a CdS photocell to measure accumulated sunlight...

As far as soil moisture goes, I'm not sure- I have been focussed on thermocouple stuff because this seemed easier...
http://www.instructables.com/id/Garduino_Gardening_Arduino/
seems to be an easy approach (step 4).

As far as getting the temperature data to an external database, I'm still not sure what the best fit is. The Xbee seems like a great option, and if I have multiple sensors it's even better. At the moment, I'm still more comfortable with wifi (802.11 rather than 802.15). It looks like it's not trivial to connect multiple Xbees (or it wasn't at some point in the past) or to create a mesh of them. I don't recall finding the power usage differences between 802.11 and 802.15. (goal is to have something battery powered, maybe add the adafruit 6v 1.5watt small solar panel later) Also, I don't know what the price difference would be (for one or two sensors in the garden). I may go with 802.11, but I need to read more. On the Xbee upside, I could do some wireless networking with my neighbors who are about 200m away through somewhat dense forest.

I could always put an Xport and have a solar powered wired-wireless hub in my garden, but that's just asking for problems.

Thanks, Blair

Do you need the Arduino to turn the water on/off, or can that be your host/server?

I'm still trying to figure out what my options are. I have several hundred gallons of rain water/lake water next to the garden. So all I need is the smallest of solenoids to control the gravity feed. Before I was thinking about SSRs (solid state relays), maybe connecting a small pump to my water tank to increase the pressure. Thoughts on control valves for gravity fed watering or SSR + 120v pump?

failure may have a large impact

Thanks gbulmer. I hadn't thought too much about the downsides yet...

Blair - we did a simul-edit :slight_smile:
I added a few words to clarify my thoughts.

If you have a gravity feed water source, that seems ecologically effective. Maybe you could arrange the valve to shut in the event of failure (but I'm no gravity fed watering expert :slight_smile: )

I suppose reasonable questions to think through are:

  • how long will watering take each day, and how fast is the flow?
  • what happens if it fails with water on?
  • what happens if it fails with water off?
  • how long might it be broken before anyone notices and can fix it?

In Houston, they used to water overnight to reduce evaporation, and a stuck valve could water-log gardens. There were storm drains, so it was never a disaster, but plants would suffer. If there is no reliable run-off, a stuck valve might be expensive.

A friend uses a slow drip feed, so a monitoring system would need to be active for the duration of watering, quite a long time.

If you go away on holiday for a week, would failure be a disaster? What could you do to avoid failure or reduce its impacts.

I am not trying to put you off. I strongly believe smarter use of water is critical for our species survival. I'm just trying to stimulate your creative juices into designing a simple, robust solution.

HTH
GB-)