Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Garduino data output problem on: January 29, 2011, 03:29:27 pm
Thanks a ton, I was able to modify the code myself to show correct readings.

I appreciate all the help =)
2  Using Arduino / Project Guidance / Re: Garduino data output problem on: January 29, 2011, 01:55:02 pm
Okay, I have found the problem I was having. It turns out the wires I was using were faulty.

Now, I am getting correct readings from my probes, but there is another small hitch.

Once the serial monitor gives me one reading, it stops. It shows no additional readings.

How would I need to modify the code so it consistently takes readings every few seconds?
3  Using Arduino / Project Guidance / Re: Garduino data output problem on: January 29, 2011, 10:56:19 am
I am using a 10k resistor, as you said. This was the value I was told to use in the instructions.

So currently, what is my best plan of action in order to get this to work? I will try replacing the nails with a separate resistor.
4  Using Arduino / Project Guidance / Re: Garduino data output problem on: January 29, 2011, 12:52:30 am
I appreciate the responses =)

My sensor is hooked up pretty much exactly like this diagram here. I have reverified the connections, and they seem solid.



I am using a solderless breadboard, and am just sticking the wires inside the holes.

One thing is, that I do not yet have the galvanized nails attached to the wires. I was thinking that I could add them later, and I would get the same results from just touching the bare wires together. Am I mistaken for believing this?

Edit : In addition, I'm not familiar with what a voltage divider is?






5  Using Arduino / Project Guidance / Garduino data output problem on: January 28, 2011, 10:23:23 pm
Hi,

I'm trying to get the garduino moisture sensor to work, however, I've been running into a few problems.

I'm using a modified code in which temperature and light are omitted.

Code:
//define analog inputs to which we have connected our sensors
int moistureSensor = 0;

//define digital outputs to which we have connecte our relays (water)
int waterPump = 7;

//define variables to store moisture
int moisture_val;

//setup a variable to store seconds since arduino switched on
float start_time;
float seconds_elapsed;
float seconds_elapsed_total;
float seconds_for_this_cycle;

void setup() {
  //open serial port
  Serial.begin(9600);
  //set the water, light, and temperature pins as outputs that are turned off
  pinMode (waterPump, OUTPUT);
  digitalWrite (waterPump, LOW);
}

void loop() {
  // read the value from the moisture-sensing probes, print it to screen, and wait a second
  moisture_val = analogRead(moistureSensor);
  Serial.print("moisture sensor reads ");
  Serial.println( moisture_val );
  delay(1000);

  //turn water on when soil is dry, and delay until soil is wet (line 41)
  if (moisture_val < 850)
  {
    digitalWrite(waterPump, HIGH);
  }

  while (moisture_val < 850)
  {
    delay(10000);
  }

  digitalWrite(waterPump, LOW);
}

However, once hooked up, and plugged in, the serial monitor is showing me "moisture sensor reads 1023" repeatedly. This is much too high as, the sensor probes are not even touching.

Does anyone know what the problem could be?

Thanks in advance,
Pages: [1]