#include //include library which implements software serial port, for comunication SoftwareSerial mySerial(0,1); const int LED =7; const int MOTOR =10; void setup() { // put your setup code here, to run once: Here we are configuring speed of the serial port mySerial.begin(9600); //bits per second, 9600 is standard speed //pinMode(sensorpin,OUTPUT); pinMode(LED,OUTPUT); pinMode(MOTOR,OUTPUT); } void loop() { // put your main code here, to run repeatedly: digitalWrite(LED, HIGH); // enciende el LED int humidity=analogRead(2); mySerial.print("Humidity is:"); mySerial.println(humidity); if(humidity > 760){ mySerial.println("Sensor en suelo seco"); digitalWrite(MOTOR, HIGH); }else if(humidity < 750){ mySerial.println("Sensor en agua"); digitalWrite(MOTOR, LOW); } delay(2000); }