Inverting the output of moisture sensor circuit

Thread Starter

richardperkin

Joined Sep 25, 2012
14
You can program an ATTiny85 with an arduino. Smaller than the schematic you posted.

Also, I would look at using a comparator or opamp to do a non microcontroller based circuit. Very straightforward. Here's one example. I'd replace the 47K/10K divider with a trimmer pot to allow for adjusting the trip point. Also, I'd add hysteresis and a 100n bypass cap. The 358 could drive maybe a 10mA load (ie an led).
Thanks philba! What voltage would this circuit run on? The other circuit is attractive because it will run on very low voltage, and also the probe polarity alternates, as Alec pointed out above.
 
Thanks for the suggestion, philba... unfortunately it is will be a compact device using the HM-11 BLE module as the central device, which means no microcontroller. True, it would have been really easy to set up using an ardiuno nano or similar. Have planned to use stainless steel probes to minimise the amount of oxidation from the galvanic action.
Have you used an HM-11 before?

I ask because your phrasing is confusing, at least to me. If the HM-11 is working as the central device, what is the peripheral device?

A couple of points that explain my confusion...and my understanding may be less than perfect.

The HM-11 contains a TI CC2541, which has an enhanced 8051-type MCU, which means that it is a microcontroller.

In its ready-to-go form, you will be communicating with it using a serial interface. What will be sending and receiving the serial stream?

The straightforward way of doing this is to have the device setup as a peripheral that provides soil moisture information. In this case, "provides" means that it is a server that gives out the information to a central device (like a phone) that connects to it and asks for information.

The HM-11 would be controlled by another microcontroller (like an Arduino) that would detect and manage the connections by programming the HM-11.

Another approach would be for the device to be setup as a beacon, where it is always broadcasting the soil moisture (again as a "connectionless" peripheral device).

I can see how you are working on the sensor part but I can't see how you are intending to manage the interface and RF part.
 

Thread Starter

richardperkin

Joined Sep 25, 2012
14
Hi Raymond... I'm really just going off some example projects I found for the HM-10/HM-11 BLE module. It seems it is possible to just use the unit in a standalone configuration to transmit a voltage measured on one of the input pins, as demonstrated in the example here where an HM-10 is used to send the output voltage measurement from an LDR... http://www.martyncurrey.com/hm-10-bluetooth-4ble-modules/
So basically my plan is to take the output of the moisture sensing circuit (which would usually drive an LED) and connect it to the HM-10/11 in the same way that the LDR was connected in the example.
Does this seem feasible, or am I barking up the wrong tree?
 
Last edited:

Alec_t

Joined Sep 17, 2013
12,197
it is possible to just use the unit in a standalone configuration to transmit a voltage measured on one of the input pins
If that is the case, then a simpler moisture sensor should work. Apart from the (analogue) input pin, is there a spare digital I/O pin that could be used to drive the probes?
 
Hi Raymond... I'm really just going off some example projects I found for the HM-10/HM-11 BLE module. It seems it is possible to just use the unit in a standalone configuration to transmit a voltage measured on one of the input pins, as demonstrated in the example here where an HM-10 is used to send the output voltage measurement from an LDR... http://www.martyncurrey.com/hm-10-bluetooth-4ble-modules/
So basically my plan is to take the output of the moisture sensing circuit (which would usually drive an LED) and connect it to the HM-10/11 in the same way that the LDR was connected in the example.
Does this seem feasible, or am I barking up the wrong tree?

That looks like a really nice site.

Are you barking up the wrong tree? Well, I don't know, maybe, a little bit - maybe not, if you know what you are getting into.

I did a project with an HM-10 and tested it with an HM-11. You can see the details here. That project simply read and displayed a couple of beacons that were transmitting temperature and humidity. It is still working as I type. It was also a bit of a headache using the HM devices. But what I notice is that the firmware has been updated several times since I did the aforementioned project.

I also notice that there is now an ADC pin and with an AT ADC command. I'm not sure every HM-11 has that and the one I used did not, as I recall. No matter, because having that functionality puts you one big step closer.

I think that you probably want to use it is as a peripheral device and maybe best as a beacon. The site you mentioned does not yet have a section on using it as a beacon but I see that it is planned.

Maybe more important is to get some experience using the module - that is sending and receiving AT commands to get it to do something useful. These can be pretty frustrating sometimes, but if they improved the firmware, maybe they are significantly better now.

Then, test out whether you can connect to the device with something other than another HM-11, which might be very limiting.

Please keep us posted - I am curious to see how it goes.
 

philba

Joined Aug 17, 2017
960
Thanks philba! What voltage would this circuit run on? The other circuit is attractive because it will run on very low voltage, and also the probe polarity alternates, as Alec pointed out above.
It will run on 3.3 or 5V. Or 10 or whatever.

I'm not sure you'd need alternating polarities if you use SS for the probes.
 

Thread Starter

richardperkin

Joined Sep 25, 2012
14
Not sure about a digital output on the HM-10/11 Alec... at least not the type that could be used for something like moisture measurement directly. It seems that the HM-10/11 functionality is limited to I/O rather than running scripts in the way an Arduino would. Btw, I tried opening your Spice model, but seems to be missing the 74HC132 symbol/component and also the 1Meg pot symbol/component - are these library files downloadable from the Linear site?
In terms of using a simpler comparator circuit, such as that suggested by philba above, this is less desirable to me because - if I'm correct (?) - the power draw would be higher than that of the logic circuit. I'd like to minimise the circuit power draw as much as possible.

That looks like a neat project of yours, Raymond! I think it depends on where you get the HM-10/11 module from, because there are copies out there that might be the same in terms of circuitry but aren't the same in terms of firmware and capabilities. As far as I know, I've purchased a genuine HM-11 unit - guess I'll find out shortly when I start assembling and testing! As far as I can tell, you do not need another HM-10/11 to pair with the unit on the bluetooth device - it should be able to be done by a suitable app on an android or iOS device. There are a few apps available for HM-10/11 control and debugging "HM-10 Control" being one of them and another linked here: http://www.hangar42.nl/hm10

Anyway, I'll have a play with the revised Spice circuit that Alec kindly put together, then order the bits and put it all together... and post updates when it does or doesn't work!
 
Top