💬 Soil Moisture Sensor
-
I guess I'm not the only one seeking for the correct diagram. It can be found here: http://vanderleevineyard.com/1/post/2012/08/-the-vinduino-project-3-make-a-low-cost-soil-moisture-sensor-reader.html

-
Now that I managed to get my grips on Fritzing, I thought I could share a quick diagram of my own device which I tried to describe above.

Note that the capacitor between the middle point of the voltage divider and GND is just recommended, and its value is orientative.
Not showing battery, radio, reset button, etc., just the soil moisture sensor part.
I've seen other versions using transistors to switch the sensor current, and other variations; I think this is the simplest version of an alternating current sensor and it works very well.
-
Now that I managed to get my grips on Fritzing, I thought I could share a quick diagram of my own device which I tried to describe above.

Note that the capacitor between the middle point of the voltage divider and GND is just recommended, and its value is orientative.
Not showing battery, radio, reset button, etc., just the soil moisture sensor part.
I've seen other versions using transistors to switch the sensor current, and other variations; I think this is the simplest version of an alternating current sensor and it works very well.
@manutremo You may want to put a jumper in on the top power bus that you connect the 100nf capacitor to. It is not clear, at least to me, if that is to VCC or GND. On a true breadboard you would have to do that.
-
@manutremo You may want to put a jumper in on the top power bus that you connect the 100nf capacitor to. It is not clear, at least to me, if that is to VCC or GND. On a true breadboard you would have to do that.
@dbemowsk the convention in these breadboards is that the blue rail is Gnd. You may either connect the two sides or use a Mb102 module to feed both sides at the same time. You may also choose other options.
The capture is not showing the power feed part since it's clear enough and because what it is mainly trying to describe is the moisture measurement part which is the part seemingly causing confusion and the origin of the thread.
-
@dbemowsk the convention in these breadboards is that the blue rail is Gnd. You may either connect the two sides or use a Mb102 module to feed both sides at the same time. You may also choose other options.
The capture is not showing the power feed part since it's clear enough and because what it is mainly trying to describe is the moisture measurement part which is the part seemingly causing confusion and the origin of the thread.
@manutremo said in 💬 Soil Moisture Sensor:
@dbemowsk the convention in these breadboards is that the blue rail is Gnd.
I get that, but if someone were to build that as you have diagrammed with a standard breadboard, it would not work.
@manutremo said in 💬 Soil Moisture Sensor:
You may either connect the two sides or use a Mb102 module to feed both sides at the same time. You may also choose other options.
You, me and other people in here may understand that, but a newbie most likely wouldn't. When I made the comment, I was assuming that that is what you meant, but had to be sure for the newbies.
-
@manutremo said in 💬 Soil Moisture Sensor:
@dbemowsk the convention in these breadboards is that the blue rail is Gnd.
I get that, but if someone were to build that as you have diagrammed with a standard breadboard, it would not work.
@manutremo said in 💬 Soil Moisture Sensor:
You may either connect the two sides or use a Mb102 module to feed both sides at the same time. You may also choose other options.
You, me and other people in here may understand that, but a newbie most likely wouldn't. When I made the comment, I was assuming that that is what you meant, but had to be sure for the newbies.
My posting clearly states:
the capacitor between the middle point of the voltage divider and GND
@dbemowsk said in 💬 Soil Moisture Sensor:
It is not clear, at least to me, if that is to VCC or GND.There's only one cap in the diagram so it should be quite clear.
@dbemowsk
if someone were to build that as you have diagrammed with a standard breadboard, it would not work.I tend to think it wouldn't work with the jumper either if built as diagrammed, since the power source would still be missing.
Don't you think that jumper could possibly lead newbies to confusion into thinking that the power supply needs to be done in a certain way? Or would it be better to avoid overloading the diagram with information irrelevant to the concept being illustrated and just focus on the important part? Certainly a personal decision. I might be wrong but I chose "less is more".
Even newbies getting into electronics understand that diagrams may not always show all the components specially when they are focused and intended to illustrate a specific part of the circuit. even newbies into electronics understand that a power source is always necessary even though it may not appear in the diagram. Almost anyone using a breadboard knows what those rails are, what do the colors mean and that the way to pòwer them is mostly irrelevant as long as they get the proper voltage and current. And for the newbies and the few that may not , the community here will be happy to clarify.
I appreciate your contribution but still fail to see why the diagram is confusing and I still think it responds to its original purpose. Feel free to improve it at your convenience.
-
Try to never try resistive sensors. It is reaaly wrong way. I try to bult few resistive. No way.
I try to buld some inductive. Yes, it's possible, but lot of analog parts, difficult to calibrate. No way too.
Capacitive senors is most reliable and has a simple digital schematics.Good luck you on your way)
PS: here is my own sensor http://vegimatics.com/products/current/
want do discuss - wellcome) -
Try to never try resistive sensors. It is reaaly wrong way. I try to bult few resistive. No way.
I try to buld some inductive. Yes, it's possible, but lot of analog parts, difficult to calibrate. No way too.
Capacitive senors is most reliable and has a simple digital schematics.Good luck you on your way)
PS: here is my own sensor http://vegimatics.com/products/current/
want do discuss - wellcome) -
@ul7aajr said in 💬 Soil Moisture Sensor:
Try to never try resistive sensors. It is reaaly wrong way. I try to bult few resistive. No way.
I try to buld some inductive. Yes, it's possible, but lot of analog parts, difficult to calibrate. No way too.
Capacitive senors is most reliable and has a simple digital schematics.Good luck you on your way)
PS: here is my own sensor http://vegimatics.com/products/current/
want do discuss - wellcome)I'm currently building a sensor that uses the Chirp devices. I want to chain them together. You can get them for 4 dollars each.
-
@ul7aajr said in 💬 Soil Moisture Sensor:
Try to never try resistive sensors. It is reaaly wrong way. I try to bult few resistive. No way.
I try to buld some inductive. Yes, it's possible, but lot of analog parts, difficult to calibrate. No way too.
Capacitive senors is most reliable and has a simple digital schematics.Good luck you on your way)
PS: here is my own sensor http://vegimatics.com/products/current/
want do discuss - wellcome)I'm currently building a sensor that uses the Chirp devices. I want to chain them together. You can get them for 4 dollars each.
-
@neverdie They support I2C. So in theory you can connect a whole bunch to a pin. I'm trying to figure out if I can detect all of them and then automatically give each a unique ID.
-
@dbemowsk Changing the Chirp's I2C address is very easy actually.
#include <I2CSoilMoistureSensor.h> #include <Wire.h> I2CSoilMoistureSensor sensor(0x20); // connect the reset pin (5) of the Chirp to a pin on your Arduino. It will create a small reset signal. This tells the chirp it should not be a stand-alone ensor, but an I2C connected one. If it receives I1C data shortyl after a reset (few seconds), then it will understand. int resetPin = 4; void setup() { pinMode(resetPin, OUTPUT); delay(1000); digitalWrite(resetPin, HIGH); // sets the digital pin 13 on delay(100); // waits for a second digitalWrite(resetPin, LOW); // sets the digital pin 13 off delay(1000); Wire.begin(); Serial.begin(9600); sensor.begin(); // reset sensor delay(1000); // give some time to boot up Serial.print("I2C Soil Moisture Sensor Address: "); Serial.println(sensor.getAddress(),HEX); Serial.print("Sensor Firmware version: "); Serial.println(sensor.getVersion(),HEX); Serial.println(); Serial.print("Change address to 0x21 ..."); if (sensor.setAddress(0x21,true)) // set Sensor Address to 0x21 and reset Serial.println("... DONE"); else Serial.println("... ERROR"); Serial.println(); } /*loop scans I2C bus and displays foud addresses*/ void loop() { byte error, address; int nDevices; Serial.println("Scanning..."); nDevices = 0; for(address = 1; address < 127; address++ ) { // The i2c_scanner uses the return value of // the Write.endTransmisstion to see if // a device did acknowledge to the address. Wire.beginTransmission(address); error = Wire.endTransmission(); if (error == 0) { Serial.print("I2C device found at address 0x"); if (address<16) Serial.print("0"); Serial.print(address,HEX); Serial.println(" !"); nDevices++; } else if (error==4) { Serial.print("Unknow error at address 0x"); if (address<16) Serial.print("0"); Serial.println(address,HEX); } } if (nDevices == 0) Serial.println("No I2C devices found\n"); else Serial.println("done\n"); delay(3000); // wait 5 seconds for next scan }The default address is 0x20. So my idea is to just keep scanning, and if I find a 0x20 Chirp, then I change its I2C address to 0x21 and higher. Repeat as necessary until all 0x20 devices are gone.
The only thing I'm not sure about is if this is possible. If I can pick them off one by one this way.
-
@dbemowsk Changing the Chirp's I2C address is very easy actually.
#include <I2CSoilMoistureSensor.h> #include <Wire.h> I2CSoilMoistureSensor sensor(0x20); // connect the reset pin (5) of the Chirp to a pin on your Arduino. It will create a small reset signal. This tells the chirp it should not be a stand-alone ensor, but an I2C connected one. If it receives I1C data shortyl after a reset (few seconds), then it will understand. int resetPin = 4; void setup() { pinMode(resetPin, OUTPUT); delay(1000); digitalWrite(resetPin, HIGH); // sets the digital pin 13 on delay(100); // waits for a second digitalWrite(resetPin, LOW); // sets the digital pin 13 off delay(1000); Wire.begin(); Serial.begin(9600); sensor.begin(); // reset sensor delay(1000); // give some time to boot up Serial.print("I2C Soil Moisture Sensor Address: "); Serial.println(sensor.getAddress(),HEX); Serial.print("Sensor Firmware version: "); Serial.println(sensor.getVersion(),HEX); Serial.println(); Serial.print("Change address to 0x21 ..."); if (sensor.setAddress(0x21,true)) // set Sensor Address to 0x21 and reset Serial.println("... DONE"); else Serial.println("... ERROR"); Serial.println(); } /*loop scans I2C bus and displays foud addresses*/ void loop() { byte error, address; int nDevices; Serial.println("Scanning..."); nDevices = 0; for(address = 1; address < 127; address++ ) { // The i2c_scanner uses the return value of // the Write.endTransmisstion to see if // a device did acknowledge to the address. Wire.beginTransmission(address); error = Wire.endTransmission(); if (error == 0) { Serial.print("I2C device found at address 0x"); if (address<16) Serial.print("0"); Serial.print(address,HEX); Serial.println(" !"); nDevices++; } else if (error==4) { Serial.print("Unknow error at address 0x"); if (address<16) Serial.print("0"); Serial.println(address,HEX); } } if (nDevices == 0) Serial.println("No I2C devices found\n"); else Serial.println("done\n"); delay(3000); // wait 5 seconds for next scan }The default address is 0x20. So my idea is to just keep scanning, and if I find a 0x20 Chirp, then I change its I2C address to 0x21 and higher. Repeat as necessary until all 0x20 devices are gone.
The only thing I'm not sure about is if this is possible. If I can pick them off one by one this way.
-
@alowhum That is nice. Some I2C devices have it hard coded and do not allow this from my understanding.
-
@dbemowsk True. But it's another reason why I think the Chirp devices are pretty great soil sensors.
-
@ul7aajr said in 💬 Soil Moisture Sensor:
Try to never try resistive sensors. It is reaaly wrong way. I try to bult few resistive. No way.
I try to buld some inductive. Yes, it's possible, but lot of analog parts, difficult to calibrate. No way too.
Capacitive senors is most reliable and has a simple digital schematics.Good luck you on your way)
PS: here is my own sensor http://vegimatics.com/products/current/
want do discuss - wellcome)I'm currently building a sensor that uses the Chirp devices. I want to chain them together. You can get them for 4 dollars each.
@alowhum
Not sure I2C is a good idea excepting case all sensors inside one room. It can be used just for testing to make it easy. As usual RS485 used to connect any sensors to nework. And there is Modbus protocol over RS485 that enable to use not only custom sensors, but kind of devices can be usefull in automatic systems. For example pump controllers, valve controllers....So.. no good perspecrives to go
-
Well, the Chirp doesn't support that protocol, so..
It does have a mini arduino inside. Perhaps you could reprogram it. Then I will happily have a look ;-)