Hello everyone,this is my first project with arduino nano esp32; i have three(03) relays K1,K2,K3 that need to be activated (D6,D9,D12 HIGH) when the temperature is greater then 32 deg. fahrenheitor moister is equal to 0 ( I am using digital output for moister sensor).Disactivated when temperature is equal or less than 32 deg fahrenheit or moister equal to 1.Thank you guys.
Please edit your first post and remove the capital letters except where they belong
Then add you code, using code tags when you do
What do you mean by code?
this is a transformer 110-220vac in to 12vdc out to power the nano
- The IRFP252 MOSFET cannot be fully turned on by 3v3.>>>>>> i am just illustrating the schematic for understandig my project , for now i am using these modules i bought from amazon
please ignore the values and names of the parts , ill put down what i used.thank you so much
- When we do not get accurate information about your project is about we cannot give you help.
well that what i was asking for , i tried to , but no luck lol
ahh you where asking me for the code that didnt work , let me find it , basically i watched 2 youtube videos one for the moister sensor and one for the temperature , when i tried to combine them together it didnt work .ill find it . thx
-
Hence the problem; new users buy components without knowing how to interface one module to another.
-
Relay board schematics need to be created for these PCBs before we can determine how to connect them to the controller.
Example only:
- 5v designators would be 12v
Confused here!! What is this thread about!??
@Proietti See the first post. The OP has a project he might want help with, we're really not quite sure. As usual, lack of significant input doesn't prevent fill-ins.
larry eventhough i am a buiguner to arduino what you sent are basics to me , what i am not familiar with is the programming of c++ what you call code . i got one relay workig with the moister senser, i got one relay working with temperature sensor, my problem is :i want to put both sensors together and use 3 relays all in one code .that?is not basic to me ,once i get it all working with thestuff i bought already made then i can design everything in one board , for now it doesn't look good ,
- Not convinced the ESP32 is properly connected to the relays.
For now forget about the final program, let’s do some checking.
-
Write a simple diagnostic sketch that toggles each relay every 2 seconds.
-
After the relays are proven, add code that confirms the sensors one at a time.
-
If these diagnostic sketches prove the relays and sensors operate properly , we can work on the final sketch.
Start with toggling the relays.
A standard old school 50 Hz transformer?
Apperently not: it must at least have a hidden diode to make dc....
I admire your courage.
Also your building skills.
Your soldering skills however definitely need an upgrade.
Did you use any flux?
Did you check your joints for continuity?
Solder needs to flow, this looks like pasting things together...
-
Also that looks like a home made PCB; with no plated thru holes ?
-
Make sure top and bottom pad pairs are soldered correctly.
thank you so much Larry, here are the two codes i use once i put them together ,they don't work plus i want to add 2 more relays,int AlarmTemp = 32;
void setup() {
Serial.begin (9600);
pinMode(3, OUTPUT);
digitalWrite(3, HIGH);
}
void loop() {
int rawvoltage= analogRead(0);
float volts = rawvoltage/205.0;
float celsiustemp = 100.0 * volts - 50;
float. fahrenheittemp = celsiustemp * 9.0/5.0 + 32.0;
Serial.print(fahrenheittemp);
Serial.println(" Fahrenheit");
Serial.print (celsiustemp);
Serial.println(" Celsius");
Serial.println("**
delay(1000);
if (fahrenheittemp > AlarmTemp) {
digitalWrite(3, LOW);
}
else if(fahrenheittemp <- AlarmTemp) {
digitalWrite(3, HIGH);
}
}
second code
int Relay = 13;
int sensor = 8;
int val;
void setup() {
pinMode(13,OUTPUT); //Set pin 3 as OUTPUT pin, to send signal to relay
pinMode(8,INPUT); //Set pin 8 as input pin, to receive data from Soil moisture sensor.
}
void loop() {
val = digitalRead(8);
if(val == LOW)
{
digitalWrite(13,LOW); //if soil moisture sensor provides LOW value send LOW value to relay
}
else
{
digitalWrite(13,HIGH); //if soil moisture sensor provides HIGH value send HIGH value to relay
}
delay(400);
}