analog inputs..

Skip to first unread message

Jul 8, 2013, 12:49:08 AM7/8/13

I am starting to look at micro controllers, I have no idea how to read diagrams or schematics yet because before I spend time learning that I want to ask if it is actually doable.  Right now I am looking into the feasibility of using the launchpad for a garden watering project.  I am trying to figure out how many analog inputs are available for a launchpad and how extendable it would be down the road.  My goal is to measure the soil moisture and figure out if watering is actually needed in my raised beds.  However, down the road I would like to add other sensors.  I could see I would want to collect other information from sensors such as temperature, humidity and rain amounts in addition to the moisture level in the soil.  It would be nice at some point to manually control the watering schedule based upon upcoming weather forecasts over a WIFI type connection.  However, these last items are down the road and not planned anytime soon, my priority is soil moisture sensor but I am trying to keep in mind upgrade ability because I will want to add other sensors and functionality over time.  Making a long story short, if this is not the best tool for the job I need to look elsewhere and not spend time on something that cannot do the job long term.

I am considering the use of controls in an outdoor watering project now that I would start testing next spring.  I would like to use it to manage watering my garden as needed.  I have seen several DIY soil moisture sensors but they are analog based using current between two poles in order to determine how much water is in the ground.  I imagine it might also work as digital input but how it would work right now is not very clear so I am sticking with analog and figure it out as I go.  I would like to do several in each bed say 6 samples but I don't want a controller for each bed.  I would like to use several controllers with one being the master and the others as slaves that report back moisture values in the soil that the master will use to determine if watering is needed.  The master would need to be able to turn on the water (output) using a valve control much like what you see in the link below.  I have a total of 7 raised beds in my garden that are 4' X 12' in size.

1.  Is it fair to say this controller could do the job?  It might mean I need more controllers but that might not be unreasonable.  However if this controller is better suited for other types of input that is understandable.  I understand that hardware/software is not be a one size fits all solution.

Jeffrey Schwartz

Jul 8, 2013, 9:00:02 AM7/8/13
This gent used an Arduino, but a Launchpad would probably work as well.
> --
> You received this message because you are subscribed to the Google Groups
> "TI Launchpad" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
> For more options, visit

Jul 8, 2013, 10:18:37 PM7/8/13
Your link is very cool and is close to what I have been looking for online.  Thanks for your reply. 

Ian Kitterman

Jul 9, 2013, 10:04:46 AM7/9/13
If you are starting out, I would definitely check out Energia, it is a port of wiring for the launchpad and allows you to pull Arduino sketches. Check out and i have attached the code I am using to have a moisture sensor control a relay (which you need to control the relay through a transistor see 

Jul 11, 2013, 6:02:10 PM7/11/13
I saw this article when I was searching before I posted and found it uses Arduino.  One reason I was considering the launchpad over others is the power usage is really low.  I did not know there was a port that would allow usage of sketches in launchpad so this may open a bigger online repository.  Powering this device will be batteries and maybe a solar panel down the road since I will not have access to a power grid.  I need to figure out if using a transistor as a relay will work power wise given the number of water sensors I am wanting to use in each bed.

Thank you very much for the additional information on launchpad and the associated port.


Jul 11, 2013, 7:21:37 PM7/11/13
...just be mindful that the msp43x devices cannot source/sink anywhere near the same amount of current as the atmega in an arduino, so you need take care, here...

Jul 16, 2013, 8:13:45 PM7/16/13
Is this a warning that it may not be possible to control these valve timers in the link below?  I was hoping to use it when the time came to turn the water on/off to water my raised beds.  I find it odd with my raised beds even without mulch some beds go dryer much faster than other so just turning on the water for all my beds is a bad idea when trying to conserve water and prevent run off

Ideally the master would ask the other slave controllers of the same type to check water measurements in their beds.  Very much OOP :)  and based on the results turn on the water for those bed.  I have done some testing using my finger along with observing drain off and it takes less then 10 minutes using soaker hoses attached to a faucet to water my beds.  That is with all 5 beds 4'X12' running at the same time, so fewer beds would mean less watering time would be necessary.

Thanks for your comments as it makes me ask additional questions... which is always a good thing.


Jul 16, 2013, 10:09:51 PM7/16/13
No no - it's a warning with often seen cautionary tales (on the 'net) -- folks getting projects from the arduino domain, porting the code across to run on another mpc, but then without realizing the significant hardware differences between the devices themselves that need to be considered as well. This is particularly so when comparing I/O specs on the 2 devices ; the Atmega chips have limits of 40ma per pin (but no more than 100/150ma per; around 20ma per pin), whereas the launchpad is spec'd at 6ma per pin (but no more than 48ma per port) ; that's a significant difference, and when implementing hardware control (designed around an atmega) without change, it may be enough to kill an msp43x in practice  =) 

Not that any of this will stop you - the Launchpad will turn on (and off ;) anything an Arduino can control, it's just that the latter can source/sink greater current and that tends to make hardware designs depend on that facility, rather than creating a driver circuit (to turn the actual device on/off) for the mpc to control ...which is more or less the way you have to do it with Launchpad (but I would argue that's the way it *should* be done for any mpc really). I couldn't find any useful specs on the valves you linked to but suffice it to say you will likely need some sort of driver/interface between the launchpad and any device to be controlled by it, and that's where these specifications matter (hence my warning 8)...

Thanks also for that link - I've been looking for valves like that for some time.


Ian Kitterman

Jul 18, 2013, 12:38:58 PM7/18/13
I agree with Don, there are lots of examples of driver circuits out there, also this guy has the cheapest humidity/temp sensors i've seen

Oleg Koptev

Jul 18, 2013, 5:12:52 PM7/18/13
Regarding sensors and other similar electronic stuff, Chinese crapstores are beyound competition :)
Look to Buyincoins - they have really cheapest sensors I've ever seen (retail prices, of course)
For example:
DHT11 temp/humidity sensor -
DHT22 temp/humidity sensor -
Dig there a little and I'm sure you've find nice things for little money.

Please don't consider this post as advertisement - I'm not linked to BiC in any way, only as satisfied buyer.


Freely listen and download our EP on
Слушай и бесплатно скачивай наш EP на

2013/7/18 Ian Kitterman <>


Jul 18, 2013, 9:11:25 PM7/18/13

Jul 21, 2013, 10:08:28 AM7/21/13
This looks like what I was looking for in a soil moisture sensor.  I will take a look and thanks for the link because I had not come across sensors that were reasonably priced leaving the DIY moisture sensor.  I will do some homework and see how they hold up.  Might be better to use the DIY in the end if I have to replace them every year due to corrosion and exposure to the elements.


Jul 21, 2013, 10:50:55 PM7/21/13
If they proved suitable for the task, at a couple of dollars per unit.. gee, I'd buy 20 of the things, perhaps
more if the seller offered a bulk purchase discount (many do, and it never hurts to ask). The actual probe
longevity will depend on the soil Ph & metal/coating used in the probe construction, and one would imagine
they chose something suitable. (the actual enemy is surface oxidation on the probe surface), but perhaps
what you're realy paying for here, is the comparator circuit & trimmer pot all nicely soldered in SMD. In
effect, that lets you attach probes of any design/material you choose, and you simply calibrate the board
to suit (try to keep the surface area of custom probes close to that of the supplied example)... question you are going to need answer, is how much do you need to know about the actual soil moisture
level? The sensors I linked to have both digital (low/high state) and analog (a voltage between 0-5v) outputs ;
if using the digital output, you would calibrate the probe to switch signal state at or just before your soil 'dry point',
and this indicates 'watering required' ; conversely, using the analog output requires feeding that signal into an
ADC, a deriving a number value that correlates with soil moisture content % (and hopefully the probe's makers
have already graphed that for you, or you'll have to do it yourself ;) ... the answer matters quite a bit..

For instance, if I just wanted to keep my 7 beds of veges irrigated and growing well, I probably don't care
what the *actual* soil moisture % is ; all I care about is that my tomatoes get the water they need, and are
not over-watered, and so I only look at the sensors' digital outputs, waiting for them to go high (indicating
dry point), which results in the water being turned on for 'x' amount of time. The reason I don't care about the
actual moisture % is that I sat down a calibrated the trip point beforehand to coincide with the driest soil
condition I wish to have ; if a certain plant type/bed requires more water, I increase the 'x' factor for that bed...

...I may have 7 (or more) automated watering valves, and as many (but likely more) sensors to be monitored,
so what do I do?...errm.. perhaps use the I2C port of the launchpad, attach a RTC (real time clock) to that, and
2 (or more) mcp23017 serial i/o port expanders to obtain 32 input/output from 2 launchpad pins. If I wanted to,
I could use I2C transceiver chips, and extend that I2C bus all around the garden, with multiple mcp23017's
as remote I2C slaves, the launchpad end being the master device....(and you've got all but 2 of the launchpad
i/o to do other stuff with)....or somesuch'n'similar.

..if you go the other way, and want to utilize the sensor's analog output(s), it becomes more complex..  ;)

Jul 28, 2013, 9:16:51 PM7/28/13
Thank you so very much for taking the time to post this response.  It answered a lot of my questions specifically the usage of master/slave, extendability of the sensors and the pitfalls of going analog instead of digital as well as the pseudo code example you included.  I spent the last week or so trying to understand which launchpad of the three types to purchase.  I am still working on the answer because from a code standpoint 16K is not a lot of space for a program which is all the msp430 provides over the C2000 and Tiva C.

In terms of how much moisture is in the soil it will be OK to ball park it.  If they go a little dry it causes the roots to go deep which is desirable but over watering is bad. Thanks again for the additional information

Reply all
Reply to author
0 new messages