I made soil moisture by plaster and nails it works pretty well, but I have some problems regarding to the light i need to provide as output for this soil moisture sensor. I copied the code here that I got from other site but I change it a little bit.
When I run this code I get very small amount of light as output from the led, but I want to know how can i increase the power of led’s light. I would really appreciate it if you could help me.
const int VAL_PROBE = 150; // Analog pin 0
const int MOISTURE_LEVEL = 0; // the value after the LED goes ON
Well, I would check your current on your LED and make sure your Arduino can handle the current (Dont quote me, but an arduino can support 40 mA on a pin). If it is not, you could wire up a N-MOSFET or other transisitor to the resistor and LED. Also make sure your resistor is the right value.
If you’re using the LED on the Arduino that’s attached to pin13, it’s just not going to be very bright. That’s all there is to it. If you want a bright LED you’ll need to use an external one. Use a resistor to limit the current through it to about 20 mA (typical level for most LEDs).