https://youtu.be/ojhrVsBs0nM
I noticed in the video they never press the run-simulation button so I can't verify if theirs worked or not. Here's my sim as well as code:
https://www.tinkercad.com/things/5Hp8Hi ... t=circuits
```// moisture and soil pump set
// declare variables for pins
const int sensorPin = A0;
const int sensorPower = 8;
const int LED1 = 2;
const int LED2 = 3;
const int pumpPin = 11;
// variable for sensor reading
int sensor;
//delay time between sensor readings (milliseconds)
const int delayTime = 1;
//wet and dry thresholds - these require calibration
int thresh = 600;
void setup () {
// set pins as outputs
pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(sensorPower,OUTPUT);
pinMode(pumpPin,OUTPUT);
// initialize serial communication
Serial.begin(9600);
}
void loop() {
//power on sensor and wait briefly
digitalWrite(sensorPower, HIGH);
delay(10);
//take reading from sensor
sensor = analogRead(sensorPin);
//turn sensor off to help prevent corrosion
digitalWrite(sensorPower,LOW);
//print sensor reading
Serial.println(sensor);
if(sensor>thresh){
digitalWrite(LED1,LOW);
digitalWrite(LED2,HIGH);
digitalWrite(pumpPin,LOW);
}
else{
digitalWrite(LED1,HIGH);
digitalWrite(LED2,LOW);
digitalWrite(pumpPin,HIGH);
}
delay(delayTime);
}
```
Once again, the LEDs work as expected but the motor does not.
The version I'm trying to build in real life is using parts I have on hand so they vary slightly:
- NPN pn2222A instead of NMOS
-Arduino NANO 3.0 instead of UNO
-capacitive soil sensor instead of resistance
I tested the parts in a different setup to make sure the hardware works. Here's the diagram:
https://www.tinkercad.com/things/iJYYGD ... t=circuits
This appears to work, and so does swapping the POT for a moisture sensor. The only missing part of the puzzle is how to get the threshold to activate the sensor. Some help would be greatly appreciated. Thanks

