arduino moisture sensor values

Hey guys i have made this program but im a little concerned because my values from my moisture sensor jump around quite a bit and if the sensor values are wrong for to long it may keep the heaters on for too long which can cause a fire i did use an if statment instead of while im just trying differnt ways here is my code... #include LiquidCrystal lcd(7,8,9,10,11,12); int sen = 5; int hOn = 6; int mot = 3; void setup() {   Serial.begin(9600);   lcd.begin(16,2);   pinMode(hOn, OUTPUT);   pinMode(sen, OUTPUT);   pinMode(mot, OUTPUT);   lcd.print("Start Up");   lcd.setCursor(0,1);   lcd.print("Complete"); } void loop() {   digitalWrite(hOn, HIGH);   digitalWrite(mot, HIGH);   digitalWrite(sen, HIGH);   analogRead(4);   delay(5000);   digitalWrite(sen, LOW);     int val = analogRead(4);   int good = 451;   int bad = 450;   lcd.clear();    while(val <= bad)   {     lcd.clear();     lcd.setCursor(0,0);     lcd.print("Heaters On.");     lcd.setCursor(0,1);     lcd.print(val);     lcd.setCursor(4,1);     lcd.print("UpT:");     lcd.print(millis()/1000);     digitalWrite(hOn, LOW);     Serial.print (val);     Serial.println (" Moisture Level Is Bad ");     digitalWrite(mot, LOW);     delay(120000);     digitalWrite(mot, HIGH);     delay(300000);     digitalWrite(mot, LOW);     delay(120000);     digitalWrite(mot, HIGH);     delay(60000);   }   while(val >= good)   {     lcd.clear();     lcd.setCursor(0,0);     lcd.print("Heaters Off.");     lcd.setCursor(0,1);     lcd.print(val);     lcd.setCursor(4,1);     lcd.print("UpT:");     lcd.print(millis()/1000);     Serial.print (val);     Serial.println (" All Is Good ");     digitalWrite(hOn, HIGH);     digitalWrite(mot, LOW);     delay(120000);     digitalWrite(mot, HIGH);     delay(300000);     digitalWrite(mot, LOW);     delay(120000);     digitalWrite(mot, HIGH);     delay(60000);   } }

Topic by yaene21 5 years ago  |  last reply 5 years ago


Zigbee Soil moisture project issue

In a project I am doing, I have to send analog readings of a soil moisture sensor through zigbee. I have connected the sensor Vcc to 5v and ground; the zigbee Vcc to 3.3v and ground. The analog pin of sensor to Txx pin of adapter on which the zigbee is mounter. On the coordinator zigbee, i/o packets are being recieved..but it is always giving value of "020a" or "020b" irrespective of the data from sensor. I have also fed the analog data of sensor through voltage divider to keep it within 1.2v range..can you suggest what I am doing wrong??

Topic by kahoko22 3 years ago  |  last reply 3 years ago


PLEASE HELP!!!!!! Moisture sensor plan not working - or is it me :-(

Can anybody PLEASE help, I am in the UK and eager to grow melons next spring. I need to know when the roots of the tub need water so decided to make a moisture sensor. I found a ‘plan’ online, bought about £20 of components (I need two sensors) and have spent all afternoon TRYING to get it to work. One was connected via a circuit board and the other without. Neither work, the LED comes on on both versions but does not go out when the terminal probes are put in water, as they would when the plant roots are moist. i enclose the original internet plan and a (poor) picture of my ‘‘air connection’ version....should this plan work? And if so, why isn’t it? thanks in anticipation

Topic by TN1946 1 year ago  |  last reply 1 year ago


Is aluminium lose its electrical conductivity when it is oxidised ? Answered

I have a soil moisture probe that is generally use for gardening projects. So I read some articles that tell about oxidation of this probes in a week. I wanna make soil moisture sensors that I can use it in my experiments and you know inexpensiveness is important rule of DIY :). I planned to use aluminium plates as resesitive soil moisture sensor but I have still some doubt that oxidation of aluminium affects to conductivity or not ?  I will use the sensors for a year or at least 7-8 months. So I worry that couldn't measure soil moisture properly.

Question by JeoleX 2 years ago  |  last reply 2 years ago


ELECTRONICS: PLEASE HELP - Plant moisture sensor not working - or is it me???

Can anybody PLEASE help, I am in the UK and eager to grow melons next spring. I need to know when the roots of the tub need water so decided to make a moisture sensor. I found a ‘plan’ online, bought about £20 of components (I need to make  two sensors) and have spent all afternoon TRYING to get the online schematic to work. One attempt was connected via a circuit board and the other in air connections. Neither attempt works, the LED comes on on both attempts but does not go out when the terminal probes are put in water, as they would when the plant roots are moist. i enclose the original internet schematic and a (poor) picture of my ‘‘air connection’ version....should this plan work? And if so, why isn’t it? thanks in anticipation

Topic by TN1946 1 year ago  |  last reply 1 year ago


does any 1 know how to make a sensor to detect cornering in a car and road moisture?

Im thinking an Infared diode that reflects on the road into an infared phototransistor for the road mositure (water) sensor. ( i have one problem with this its going to be placed under a car how will it keep clean?) i guess i just gotta to find a good spot. Also for the cornering sensor ( more like a G sensor but it has to be sensitive.) how will it be sensitive enough ? Its for a justy 4wd traction control system im thinking off ( note to all justy enthusiast i dont have it yet)

Question by josh1001 7 years ago  |  last reply 7 years ago


How can I make a grain moisture content sensor that can withstand high temperature?

We are working on a multi-grain dryer (controlled by Arduino Mega) that dries a corn to its required moisture content (mc). If the mc is near the required (ex. 12-14%), the dryer will stop automatically. We need to make a sensor that can withstand up to 140F while the drying is ongoing. Meaning, the sensor is inside the dryer reading mc every couple of hours. If there is any device, will the reading be affected by the heat? we are pretty low on budget now so we couldn't afford to buy any pricey device and I think its hard to ship to our country in terms of period since we are pretty much running out of time for our evaluation.

Question by Albert JohnG 2 months ago  |  last reply 2 months ago


Unable to send soil moisture data to Thingspeak.com through serial communication.The code is provided below

The hardware connection is done properly but even though the sensor data can't send through wifi after including apikey and other relevant information.

Question by DEO Kumar das 1 year ago  |  last reply 1 year ago


I need t make a simple water (moisture) sensor to connect to a talking catfish plaque.

I have a concrete basement (swimming pool style) no drains or sump pump. Its below ground level so no where for the water to go ! So if my boiler blows or leaks I will have a very ugly swimming pool. And all my workshop will be floating. I have this cool talking catfish plaque. Its 6VDC batteries and a Transformer for AC plug in power.  I need a simple switch to activate the plaque. I tried two wires from the switch it has , put in water, no luck. I tried the alum. foil type posted instruct. that does not work either. So any suggs.? Thanks Simple is better. I can solder and read simple scematic .stuff. But KISS.

Question by triumphman 8 years ago  |  last reply 8 years ago


Birdbath - Turn off submersible pump when water get too low or it will burn / stop working.

I have two birdbaths. I need a way to move / circulate the water to stay fresh.I bought two mini 3-6v submersible pumps but they don't have the auto shut off feature to prevent motor burn out. I know there are water / soil moisture detector sensor modules for pumping water in when water get too low. BUT what I want is to control the submersible pump in the birdbath. Turn ON the submersible pump when water is high or full. Turn OFF the submersible pump when water is too low or empty.I have searched all over the internet (eBay, Amazon, YouTube, and here) but found nothing.

Question by OutdoorD 9 months ago  |  last reply 9 months ago


Help with arduino!

Hi , i was looking for someone to write some code for my arduino. im having issues and would like to see where im wrong. I have an adafruit motor controller and a moisture sensor. i would like the motor controller to turn motor4 on when my sensor reads a certain variable and off again when it reads another . that is all please let me know thanks 

Topic by DylanM40 2 years ago


Will two or more IIC devices share the same IIC pins on arduino? Answered

HI,All I got 4 IIC soil moiture sensors, could be named A,B,C,D.but my arduino nano only have one set of IIC pins.i want to set IIC soil moisture sensor's chips internal timer to go sleep mode each at diffirent period.so arduino could take correct readings from one sensor at a time.i want to know if the sensor overlapping of same ardiuno IIC pins feasible?my second question is suppose it is feasible.how can arduino to know which sensor is being taking readings.i mean arduino may think signal taken from the IIC pins several time in a day may mean only one IIC device is being connected.it could not distinguish which is A or B,etc..I wanted it to distinguish which is which.But i don't know how. gada888

Question by gada888 3 years ago  |  last reply 3 years ago


How do i remotely track if a planted tree is alive or not?

Remotely i need to track/monitor if planted trees are alive or not, growing or not. So could you tell some parameters/characteristics of living trees like pH level of soil, moisture level, voltage across it when tree is alive. & required electronic sensors, technology for remote tracking/monitoring. 

Question by radkol 2 years ago  |  last reply 2 years ago


Automatic Irrigation using d1 mini

Hi Everyone, I reviewed different automatic irrigation system projects here in instructables and other sites as well and i decided to gather parts to do a simple small project myself. One thing that comes hard is the programming part as I don't know any programming language. I'm looking for some help with code merging, explanation and some general guidance. Could you please let me know, point me to right direction and tell me what you think and if requirements are actually achievable? What I would like to achieve: Intention of this project is to have manual and auto irrigation system which will: 1. Measure soil moisture and dependently on the value activate the usb pump which will water the plant (preferably analog output that will show the measurements in %) 2. Manual activating the pump via hardware button and via mobile phone with internet connection 3. Distance sensor which should measure how much water is left in the tank 4. Email notification with info when to water the plants and soil sensor data regardless of the automatic process that has already started 5. Email notification with info about the water in the tank when it’s near empty 6. Dashboard preferably inside the network (not using third party like blynk or others) with access from the internet (I have QNAP that I think can be used). 7. If possible – have amazon echo (Alexa) read the sensor data to tell me the values and comment if the plant should or shouldn’t be watered or the tank should be refiled or not as well as ability to ask Alexa to start or stop the irrigation Hardware: D1 mini: https://wiki.wemos.cc/products:d1:d1_mini Wemos V2 Relay shield: http://hobbycomponents.com/shields/865-wemos-v2-relay-shield My relay is slightly modified: 2 small wires soldered to the vcc and ground so that when it receives the signal on d1 pin it opens and current flows to female usb connector supposedly activating the usb water pump. All this can be stacked together even with soldered wires YL-69 sensor: http://www.oddwires.com/yl-69-soil-hygrometer-humidity-soil-moisture-detection-sensor/ Ultrasonic Distance Sensor (HC-SR04): https://thepihut.com/products/ultrasonic-distance-sensor-hcsr04 USB mini water pump: www.goo.gl/yUABDd Button x4 if needed: Board x4 if needed: sample codes used in other projects: https://randomnerdtutorials.com/guide-for-soil-moisture-sensor-yl-69-or-hl-69-with-the-arduino/ https://create.arduino.cc/projecthub/nekhbet/using-the-yl-39-yl-69-soil-humidity-sensor-with-arduino-968268 https://community.blynk.cc/t/irrigation-relay-with-timer-esp8266-wip/700 Alexa enabled homemade cat feeder example: https://www.hackster.io/darian-johnson/alexa-powered-automated-cat-feeder-9416d4 Thank you very much in advance for your help and support.

Topic by wube 1 year ago  |  last reply 1 year ago


Homica - The remote-controlled 'smart house' using Arduino, iPhone and Apple Watch

Homica is a project that thanks to a smart web platform allows to control in a remote way (using an iPhone and Apple Watch) sensors and actuators installed on the Arduino boards. Homica not only allows to monitor our home in all its aspects through a multitude of sensors but also to perform actions on the whole installed actuators. Moreover, Homica is able to execute actions as results of events. This logic will be called "Homica Profile". Below there are just few examples of "Homica Profiles" that can be created using Homica. If we are not at home and we want that the acustic alarm is activated and all the lights goes on and an email is sent when a motion sensor detect the presence of someone in the house. If our garden has an humidity below a certain value, then we have to water it until the soil humidity will be a specific value. If we want to be notified by email if there is a gas leak. If we want that a number of lights goes on if we clap our hands once and we want to turn them off if we claps twice. If we want that all the lights or some goes on or off with a simple action. If we want that some lights goes on if a motion sensor detects a motion. If we want that some lights goes on when night comes and off when becomes day. If we want that an electric kettle and some lights goes on at a specific hour The most interesting aspect is that we can create all the profiles we need directly using the iPhone application called "Homica Remote" without any Hardware changes.   Complete Project Video https://youtu.be/s520dv2i9Rg Remote controlled by an Apple Watch Video https://youtu.be/ZwCsdlMXShk Remote controlled by voice (Speech Recognizer) https://youtu.be/ixZyjLN6izU

Topic by MicheleC5 3 years ago  |  last reply 3 years ago


Watering Pump with LCD, Arduino. Need some help with code

Hi, Building watering unit with LCD, based on Arduino mega. I couldn't get correct value on LCD. I want to show current sensor readings. Could you please help #include #include LiquidCrystal_I2C lcd(0x27,20,4); int PUMP = 13; int sensor = 8; int val; const int DigitalInPin = 8; int sensorValue = digitalRead(8); void setup() {   pinMode(13,OUTPUT);   pinMode(8,INPUT); lcd.init();                      // initialize the lcd lcd.init(); delay(100); } void loop() {    val = digitalRead(8);     if(val ==LOW)   {   digitalWrite(13,LOW);   }   else   {   digitalWrite(13,HIGH);   }   delay(400); lcd.backlight(); lcd.setCursor(0,0); lcd.print("Soil Moisture:"); sensorValue = digitalRead(8); lcd.setCursor(0, 1); lcd.print(sensorValue); }

Topic by PASHGEN 1 year ago  |  last reply 1 year ago


Intel® IoT Invitational

**UPDATES!!** 12/18/15  Thank you so much TO ALL OF YOU for your patience during this process, it means the world to us that everyone has participated in this Invitational. Everyone has worked so hard on their IoT projects, and we have enjoyed all the stories about bringing these creations to fruition. <3 After a long wait, we are finally sharing the finalists with the Instructables Community. Hoping to announce winners Monday or Tuesday! 12/1/15 Hey guys, Just wanted to update everyone as to what is going on with finalist selection and announcing winners. You guys have been so patient in this process, and we are so proud of every project the Instructables.com community has shared using their Intel IoT Edison development kit. The Intel Team is still reviewing projects and code, and will hopefully have their ultimate finalist selection done soon. It has been so hard choosing projects to be considered for the awards as they are all so wonderful! Again, thanks for your patience, and feel free to reach out to intel@instructables.com if you have additional questions. -Audrey 8/17/15 Hey guys! I am so excited to finally set launch dates for the Intel IoT Contest!!! We have a few more packages waiting to be received by Instructables Authors, but then we are good to go. To have your project considered for some of the AMAZING PRIZES just publish your Instructable that includes an Intel Edison between 8/31 and 10/26 and add it to the Intel IoT Invitational Contest Page. With all of our logistics and shipping pretty much wrapped, we are finally getting to review all the project ideas from people who already have Edisons and Galileos submit - you will soon get an email from myself, or Penolopy Bulnick (who is coming back to Instructables to help with future giveaways like this!), approving your idea. I have to say, I am so proud to be apart of such a wonderful community that has been understanding of our delays, and collaborative in helping one another troubleshoot their projects. I can't wait to see what everyone is going to make :) Beaming! -Audrey _________ Here at Instructables, we’re so excited to have a continued partnership with the Intel® IoT Developer Program to celebrate the bright ideas that the Instructables.com community has come up with for the Intel® Edison platform. We’ve been sharing some of the best IoT stories on our site, and are astounded by the growth and creativity blossoming from the Intel Edison Ecosystem. To further encourage great IoT projects being shared to Instructables, we are offering even more Intel® Edison Boards and Intel® IoT Developer Kits to you! We believe in your awesome creative potential, and your devotion to share what you make and learn with other makers and tinkerers. Furthermore, we are so excited to announce the Intel® IoT Invitational!  Intel IoT Projects published from June 8 - August 7, 2015 will be considered to win a Canon 7D mk ii, a Sony Action Cam, an Oscillisoscope, a Sparkfun Giftcard, a Shapeways Giftcard, and More!! WE ARE SEEDING THE INSTRUCTABLES COMMUNITY 300 INTEL® EDISON BOARDS and SPECIALTY INTEL® IoT DEVELOPMENT KITS.  We want to hear what you want to make with the Intel Edison Board. If we like your idea, we will send you a kit! Keep in mind, the kits we are creating during this Invitational differ from the commercially available Grove Starter Kits. It will likely take additional components and ingenuity to make great IoT projects for the Intel IoT Invitational. These are the kits and bundles we are making: Home Automation Kit This kit is designed with home automation and safety in mind. There are 9 sensors in the kit that can detect things like moisture, temperature, flames and gases. There’s also a speaker to sound alerts and a relay to turn something on or off. This kit could easily be extended with additional sensors for the ultimate home automation or safety sensor array. Included in this kit: Grove Air quality sensor Grove Encoder Grove Flame Sensor Grove Gas Sensor(MQ2) Grove Infrared Temperature Sensor Grove Moisture Sensor Grove SPDT Relay(30A) Grove Speaker   Environmental & Agriculture This kit is designed with agriculture in mind.  The 7 sensors in this kit can help you determine light, UV and dust in the environment and based on that information one could rinse a plant off with the water pump and/or water the plant and not waste any water because a flow sensor is included. There is an LED bar for visual output and a dry reed relay to turn things on and off. Included in this Kit: 6V Mini Water Pump G14 Water Flow Sensor Grove Digital Light Sensor Grove Dry-Reed Relay Grove Dust Sensor Grove Gas Sensor(MQ5) Grove LED Bar Grove Moisture Sensor Grove UV Sensor Grove Water Sensor Transportation and Safety This kit is designed with vehicle safety in mind. These 6 sensors can help you keep from getting lost, tell you if you have pulled forward far enough in the garage and even keep your garage from accidentally closing on you. In addition there is an alcohol sensor to determine if you have had too much fun. Included in this Kit: Grove Alcohol Sensor Grove GPS Grove I2C Touch Sensor Grove Infrared Reflective Sensor Grove IR Distance Interrupter Grove PIR Motion Sensor Robotics Create the next robot overlord or at the very least a cool vehicle. This kit has 2 motor drivers and 4 planet geared motors—you supply a chassis.  There are also a few items to determine distance and track a line.  This kit will likely require the most additional items from the maker, but it also provides some useful pieces to get started exploring robotics. Have other ideas—maybe a quad-copter we are eager to see what you create! Included in this Kit: Grove 3-Axis Digital Compass Grove Hall Sensor Grove I2C Motor Driver Grove IR Distance Interrupter Grove Line Finder Grove MOSFET Grove Nunchuck Grove Single Axis Analog Gyro Grove Thumb Joystick Grove Voltage Divider Planet Geared Motor F280 By no means are you limited to just using the parts in these kits, they are just meant to help you get started. Add more sensors, components, and hardware to make the IoT machines of your dreams! This product offering is limited to 300 people who state their case as to why we should send them a board and development kit. USE THIS FORM TO APPLY TO THIS PRODUCT OFFERING This application will close May 25, 2015. ____ Already have an Intel® Edison board from our last promotion? Recently participated in an Intel® IoT Roadshow? Or did you buy your own Intel® Edison kit? You can participate without receiving a board from us, sign up here!   This application will close July 20, 2015. This application will guarantee you a spot in the Intel IoT Invitational. ____ Ready to get started with the Intel® IoT Invitational? Be sure to check out the Intel® XDK IoT Edition as a resource. This will help you create, test and deliver awesome IoT solutions.

Topic by audreyobscura 4 years ago  |  last reply 3 years ago


Growduino Help?

Hello Everyone, I built a growduino for my dwarf citrus tree. I have an serial LCD display, a pushbutton switch to turn the screen on and off. I also have a couple of relays and LED's. I wanted to see if someone would take a look at my code, and help me figure out why the screen doesn't display my float variables? I've been banging my head against the wall trying to figure it out. Any help is appreciated. Some of the math formulas I have below were customily made to display the format in degree's F, and a moisture value of 0-10. Feel free to ask questions. I will upload a few photos of it later today. Also if it is easier, I can send you my code in .ino format as well. Thank you for your help in advance. Chris #include #include const int TxPin = 2;          //the lcd const int pushButton = 5;     // the number of the pushbutton pin const int redLed =  13; const int blueLed =  12; int val = 0;                    // variable for reading the pin status SoftwareSerial mySerial = SoftwareSerial(255, TxPin);  //initialize LCD and bring in library //Analog Input int moistureSensor1 = 0; int moistureSensor2 = 1;                                                                                     int moistureSensor3 = 2; int moistureSensor4 = 3; int tempSensor = 5; //Digital Input... int waterPump = 8; int heater = 7; //Initialize int variable to store values int moisture_value1; int moisture_value2; int moisture_value3; int moisture_value4; int temp_val; int buttonState = 0;  void setup() { //Open serial port   mySerial.begin(9600);      //intialize LCD     pinMode(TxPin, OUTPUT);     digitalWrite(TxPin, HIGH);         //initialize button depress       pinMode(pushButton, INPUT);     // declare pushButton as input         //initialize and start it turned off..     pinMode (blueLed, OUTPUT);                                                                   pinMode (waterPump, OUTPUT);     pinMode (heater, OUTPUT);     pinMode (redLed, OUTPUT);                                                                                                                      //Not sure if I needed to make these inputs, since I want a reading from them? pinMode(moistureSensor1, INPUT); pinMode(moistureSensor2, INPUT); pinMode(moistureSensor3, INPUT); pinMode(moistureSensor4, INPUT); pinMode(tempSensor, INPUT);        digitalWrite (blueLed, LOW);     digitalWrite (waterPump, LOW);     digitalWrite (heater, LOW);     digitalWrite (redLed, LOW); } void loop() { for(int n=0; n < 3; n++);   {                   // nested loop.. checks for 3 days for(int i=0; i<= 86400; i++);{                 //checks for 1 day. 86400 is how many seconds in a day   delay(1000);       buttonState = digitalRead(pushButton);        // read the state of the pushbutton value:   // check if the pushbutton is pressed.   // if it is, the buttonState is HIGH:   if (buttonState == HIGH) {                                                                           //tells it to do something when pushed moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else? moisture_value3 = analogRead(moistureSensor3); moisture_value4 = analogRead(moistureSensor4); temp_val = analogRead(tempSensor);  //read temp..   mySerial.write(17);                 // Turn backlight on   mySerial.write(12);                 // Clear   mySerial.print("Sensor 1 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value1);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 2 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value2);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 3 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value3);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 4 is:    ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value4);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;   mySerial.print("Moisture average: ");   mySerial.write(13);                 // Form feed   mySerial.print(true_moisture);   // Second line                                                                mySerial.write(12);                 // Clear   delay(3000);                           // Required delay  temp_val = analogRead(tempSensor); // read the value from the thermistor                                          temp_val /= 6.64; mySerial.print("Current Temp in F:"); mySerial.write(13); mySerial.print(temp_val); mySerial.write(12); mySerial.write(18);                 // turn off backlight mySerial.write(21);                 // turn off display    delay(3000);     }   else {     temp_val = analogRead(tempSensor);  //read temp..                                                                                //not sure if I needed another temp value? but wanted to be safe..     temp_val /= 6.64;        while (temp_val < 75.0){                                                                                                       //initialize tempSensor again?     temp_val = analogRead(tempSensor);  //read temp..                                                                                //not sure if I needed another temp value? but wanted to be safe..     temp_val /= 6.64;         digitalWrite (heater, HIGH);     digitalWrite (redLed, HIGH);          mySerial.write(12);                 // Clear                    mySerial.write(17);                 // Turn backlight on        delay(5);                           // Required delay       mySerial.print("Heating Plant");  // First line       mySerial.write(220);                           //play at tone   for(int f; f<600; f++);{                                                                                                              //delay 10min while heating .. check for pushButton     delay(1000); buttonState = digitalRead(pushButton);        // read the state of the pushbutton value:   // check if the pushbutton is pressed.   // if it is, the buttonState is HIGH:   if (buttonState == HIGH) {                                                                           //tells it to do something when pushed moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else? moisture_value3 = analogRead(moistureSensor3); moisture_value4 = analogRead(moistureSensor4); temp_val = analogRead(tempSensor);  //read temp..   mySerial.write(12);                 // Clear   mySerial.print("Sensor 1 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value1);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 2 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value2);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 3 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value3);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 4 is:    ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value4);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay                                                                                                                                         float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;   mySerial.print("Moisture average: ");   mySerial.write(13);                 // Form feed   mySerial.print(true_moisture);   // Second line                                                                mySerial.write(12);                 // Clear   delay(3000);                           // Required delay  temp_val = analogRead(tempSensor); // read the value from the thermistor                                          temp_val /= 6.64; mySerial.print("Current Temp in F:"); mySerial.write(13); mySerial.print(temp_val); mySerial.write(12); mySerial.write(18);                 // turn off backlight mySerial.write(21);                 // turn off display                                                                                   delay(3000);     digitalWrite (heater, LOW);     digitalWrite (redLed, LOW);            mySerial.write(18);                 // turn off backlight        mySerial.write(21);                 // turn off display                     }          }       }     }    } }   //3 days go by.. Now the plant needs water..     moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes     moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else?     moisture_value3 = analogRead(moistureSensor3);     moisture_value4 = analogRead(moistureSensor4); float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;   int w = 0;    while (true_moisture < 5.0 && w < 4);{                //stop after watering 4 times..     w++;     digitalWrite(waterPump, HIGH);     digitalWrite(blueLed, HIGH);        mySerial.write(12);                 // Clear                    mySerial.write(17);                 // Turn backlight on        delay(5);                           // Required delay       mySerial.print("Watering Plant");  // First line       mySerial.write(220);                           //play at tone       delay(8000);                          //tested.. waterpump pumps 1 cup of water per 8 seconds       digitalWrite(waterPump, LOW);  //turns off pump       digitalWrite(blueLed, LOW); // LED off           for(int k=0; k<180; k++);{                                                                                                                      //wait 3 minutes         delay(1000);                  buttonState = digitalRead(pushButton);        // read the state of the pushbutton value:   // check if the pushbutton is pressed.   // if it is, the buttonState is HIGH:   if (buttonState == HIGH) {                                                                           //tells it to do something when pushed moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else? moisture_value3 = analogRead(moistureSensor3); moisture_value4 = analogRead(moistureSensor4); temp_val = analogRead(tempSensor);  //read temp..   mySerial.write(12);                 // Clear   mySerial.print("Sensor 1 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value1);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 2 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value2);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 3 is:   ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value3);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay   mySerial.print("Sensor 4 is:    ");   mySerial.write(13);                 // Form feed   mySerial.print(moisture_value4);   // Second line   mySerial.write(12);                 // Clear   delay(3000);                           // Required delay                                                                                                                                           float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;   mySerial.print("Moisture average: ");   mySerial.write(13);                 // Form feed   mySerial.print(true_moisture);   // Second line                                                                mySerial.write(12);                 // Clear   delay(3000);                           // Required delay  temp_val = analogRead(tempSensor); // read the value from the thermistor                                          temp_val /= 6.64; mySerial.print("Current Temp in F:"); mySerial.write(13); mySerial.print(temp_val); mySerial.write(12); mySerial.write(18);                 // turn off backlight mySerial.write(21);                 // turn off display                                                                                   delay(3000); }       }           moisture_value1 = analogRead(moistureSensor1);                                                     // read the value from the moisture-sensing probes     moisture_value2 = analogRead(moistureSensor2);                                                     //figure out if you should put it there, or in if/else?     moisture_value3 = analogRead(moistureSensor3);     moisture_value4 = analogRead(moistureSensor4); float avg_moisture = (moisture_value1 + moisture_value2 + moisture_value3 + moisture_value4)/4; float true_moisture = avg_moisture/ 112.2064;          mySerial.write(12);                 // Clear                    mySerial.write(17);                 // Turn backlight on        delay(5);                           // Required delay        mySerial.print("Finished Watering");  // First line        mySerial.write(12);                 // Clear               mySerial.write(220);                           //play at tone              mySerial.write(220);                           //play at tone        mySerial.write(18);                 // turn off backlight        mySerial.write(21);                 // turn off display                                 } }

Question by cburns02135 6 years ago  |  last reply 4 years ago


arduino not following my else statment

Ive got a issue with my arduino moisture sensor readings because my if and else statments. my else statment will not follow it at all here is my code.. // 11 sen // 7 heater // 4 analog sen int sen = 11; int hOn = 7; int mot = 3; void setup() {   Serial.begin(9600);   pinMode(hOn, OUTPUT);   pinMode(sen, OUTPUT);   pinMode(mot, OUTPUT); } void loop() {   digitalWrite(mot, HIGH);   digitalWrite(hOn, HIGH);   digitalWrite(sen, HIGH);   analogRead(4);   delay(5000);   digitalWrite(sen, LOW);     if (analogRead(4)>=410)   {     Serial.print (analogRead(4));     Serial.print (" Moisture Level Is Bad ");     digitalWrite(hOn, LOW);     digitalWrite(mot, LOW);     delay(120000);     digitalWrite(mot, HIGH);     delay(300000);     digitalWrite(mot, LOW);     delay(120000);     digitalWrite(mot, HIGH);     delay(60000);   }   else if (analogRead(4)<=409)   {     Serial.print (analogRead(4));     Serial.print (" All Is Good ");     digitalWrite(hOn, HIGH);     digitalWrite(mot, LOW);     delay(120000);     digitalWrite(mot, HIGH);     delay(300000);     digitalWrite(mot, LOW);     delay(120000);     digitalWrite(mot, HIGH);     delay(60000);   } } // i have tryed just a plain "else" statment and also another plain "if" statment

Topic by yaene21 5 years ago  |  last reply 5 years ago


Oddball Question, how could you stop a Clearblue Digital pregnancy test result from fading away after 24 hours? Answered

My wife and I had the pleasure of discovering she was pregnant.  We used the new ClearBlue digital pregnancy test which at first i though was gimmicky, but after realized how awesome it was.  We used several other non digital tests and the results were very faint.  Anyone new to this might be left wondering.  But, i digress... The Clearblue digital activates but having the test strip section dipped in urine.  As it wick ups the fluid it activates a "moisture sensor" of some kind, the test activates and you get a little animated digital hour glass.  After several minutes it will say "Not pregnant" or "Pregnant" followed by how many weeks your pregnant up to 6 weeks.  This was very clear and concise test, not squinting of the eyes.  The down side to this test though is that it only displays the results for about 24 hours, then disappears.  Yes I know its slightly bizarro to keep a pregnancy test, but... its one of those memory things.  Anyway, the question I put out is how to keep the test result from not disappearing?  Sure a larger battery capacity, perhaps with a redundant system built, thats the easy part.  Whats tricky is i believe the test strip.  Its most likely measuring a current drop or gain which is whats activating the test.  As it dries out, current is lost and the circuit ceases to work.  Or the saturated test strip corrodes the sensors, perhaps even the battery just dies after 24 hours, though this seems sketchy.  Any ideas would be great

Question by iminthebathroom 6 years ago  |  last reply 6 years ago


How to power IoT devices with a 12v DC source (Like a Solar Power Kit without the Inverter)?

Hello,Iam a novice in electronics but have a passion for tinkering with IoT (Internet of Things) devices and other electronics projects, I have a system setup in my farm that uses the following devices,Raspberry pi 2 (5 Volts 2 amps)Wifi Modem (12 Volts 1.5 amps)3.5inch 250GB Hard disk for data logging (12 Volts 1.5 amps)I plan to use the system to monitor and control the water flow to some of the crops in our farm using soil moisture sensors, solenoid valves and flow sensors.The issue is that the system needs to run 24/7 and is located in a remote rural area where power cuts are frequent. I need to run these devices on a solar power solution so that they can stay off-grid (for power).My question is whether it is possible to power the devices off the DC power that is generated from a Solar power system (Solar panels, some batteries and a charge controller) without the need for an inverter.My reasoning is that the inverter converts the 12v power from a solar panel and batteries into 240v AC power and the DC wall-warts (DC power plugs for devices) convert the 240v AC power back into 12v or 5v for the respective devices. This conversion causes inefficiencies in the solar power system thus losing energy that can be better utilised.Note: We use 240v AC standard in India (in the US they use 120v AC standard), I plan to use a DC-DC Step down regulator to power the raspberry pi 2 off the 12v power provided by the solar power system and other similar regulators boards to power the wifi modem and the hard disk.

Question by arunprasathmba11 1 year ago  |  last reply 1 year ago


Grow a plant in my locker?

Currently, this is an idea, and i am simply expanding on it. I had this great idea, mostly as a joke, why not grow a plant in a spare locker? I am currently a high school student that goes to a small school, and have way too much time on my hands. As i was looking at the empty lockers we have from students who left, or even just spares, an idea hit me. Why not put one of these lockers to good use? Why not put a plant inside of it, that can sustain most if not all of itself? Have a gallon of water in there, along with an arduino and a moisture sensor, that would end up watering the plant. I would also have an artificial light source to provide light, preferably LED. The hardest bit is the power. All of this would run off of either a SLA battery or two, or maybe a drill battery. I could swap the battery once every day, which means it would need to go for 24 hours without stopping. That, and the weekends, which would be three full days. I first thought about mushrooms, or other dark growing plants, but i find that boring, lacking a challenge. besides doing this just for jokes, i have also wanted to try out the idea of growing a plant fully indoors without the use of natural sunlight. I have never done this, so please feel free to bombard me with recommendations. Again, this is only an idea. I can only assume it's possible. Also, recommendations on parts and methods would be sweet. Some type of light that can be powered on 12-24v, and run off of a SLA or maybe even a lawnmower battery for minimum of 3 days. Also, plant. I was thinking a tomato plant? Some species that doesn't grow taller than 2.5ft? Anyway, that's the idea. If you guys could help with ideas, provide recommendations, or point me in the correct direction, that'd be sweet. Last note, i would like to keep this cheap. I am not going for some extreme garden or anything. Just a single plant, in a semi-self sustaining locker.

Topic by RocketPenguin 4 years ago  |  last reply 4 years ago


Making the pipboy/hitchhikers guide

I've been thinking about this for quite some time, unfortunately I don't have the economy to purchase a mini PC/PC mobile, let alone one powerful enough and with enough space for all the things that I have in mind for this gadget. Though there seems to be a lot of other people on this forum with the cash and possibly the motivation to complete this so I'll try and explain the idea for you. If you've ever read 'The hitchhikers guide to the galaxy' by Douglas Adams or played the new or the old Fallout games you'll have noticed that the common denominator is that in both instances they have nifty little pocket computers with all kinds of information and gadgets. Now I realize that it will be overkill for most people to have a mini Geiger-counter, a gas measuring device and a light sensor attached to it, not to mention to expensive. But it seems odd to me that some of the software options available isn't already included in mini PC's, such as: -Wiki-taxi which is an offline version of the entire Wikipedia. -As many search-able dictionaries as is practical. -A general library of PDF's that you find useful depending on where you are/are going to go, or maybe the PC you get your hands on has enough space to encompass a general library for the entire world like information about herbs, plants and animals in every region of the world Instructables for certain kinds of gourmet dishes for an example could come in handy while traveling the world, anything goes really . -Furthermore it could have stored maps of the entire world, of course not in "hair counting quality" but good enough to find your way if lost, then again some of these mini PC's have GPS built in but you will still need all the map packs for the different regions of the world. -One could add how-to videos of different things that might come in handy if traveling in poor countries or simply backpacking, like braiding and general hand crafting items to have something to sell. Or guides for learning to play a certain instrument and so forth. And so on, there's an endless supply of software one could put on a gadget like this, but that's just half the idea. The other half would be constructing some kind of housing that would allow a person to strap the computer sideways on ones arm so that it's always easily available like a normal wristwatch and preferably protected against shock and moisture/water, furthermore it would be nice to have extra slots in the housing for such things as a small LED flashlight and any kinds of other tools that would be practical for the person in question that makes this thing. This computer would of course need to have a rather big battery capacity as well, and if it has long lasting batteries then several more of the batteries can be incorporated into the housing allowing the user to switch between each of the extra batteries when the original one in the PC runs dry. For off-the-grid travel I'd believe a sufficiently large fold-able solar panel would suffice to charge the device, maybe it could be incorporated into a jacket or simply stored as a liner in the jacket. Now I don't know if this is all easily understandable so if anyone has any questions or maybe someone would even make this then please let me know as this idea is quite dear to me, do post any ideas or complaints as well, I welcome it all. Oh, and in case someone might be bothered by the extra weight this would put on (say your left arm) then simply make another housing for general tools that you can have on the right arm/wrist and balance the weight out so that after a while you wont notice it as your muscles naturally adjusts to the weight, would basically make you stronger in the process.

Topic by wolty 9 years ago  |  last reply 9 years ago