Arduino debug simple setup

Finalizat Postat la acum 3 săptămâni S-au achitat serviciile după ce au fost prestate
Finalizat

The problem: The solonoid valve does not turn off. The voltage on mosfet module output goes from 4.2 V to 4.8 V when motion is detected. It does not goes to 0V and thereby closes the valve.

What have i done wrong?

I have a simple setup:

- Pir sensor AM312

- Nodemcu /ESP (powered by usb)

- Mosfet module IRF520

- Solonoid valve 4.5V

- External power supply connected to Mosfet 5V, 1A

I'm using the following code:

const int pirPin = D5; // PIR sensor pin

const int mosfetPin = D6; // Connect to the IN/Input terminal on the MOSFET module

void setup() {

[login to view URL](115200);

pinMode(pirPin, INPUT);

pinMode(mosfetPin, OUTPUT);

[login to view URL]("PIR Motion Sensor with Solenoid Valve Control");

}

void loop() {

int motionDetected = digitalRead(pirPin);

if (motionDetected == HIGH) {

[login to view URL]("Motion Detected - Activating Solenoid");

digitalWrite(mosfetPin, HIGH); // Send signal to the MOSFET module to activate the solenoid

delay(2000); // Keep solenoid active for 2 seconds

digitalWrite(mosfetPin, LOW); // Deactivate the solenoid

} else {

[login to view URL]("No Motion Detected");

}

delay(10000); // Wait for 10 seconds before rechecking

}

Arduino Electronică Microcontroller Inginerie electrică Programare C

ID Proiect: #38015830

Detalii despre proiect

8 propuneri Proiect la distanță Activ acum 3 săptămâni

Acordat lui:

wyderl24

Hello, I am interested in your job post. Can I help, Check my profile. And feel free to message me. Thank you. Here's my previous Projects: [login to view URL] Mai multe

$5 USD / oră
(1 părere)
1.1

8 freelanceri plasează o ofertă medie de 6$/oră pentru proiect

bchandra1955

I need 5 hours time and one or two meeting with you so that you can try out my suggestions. Regards Brejah

$15 USD / oră
(70 recenzii)
6.1
ngwavalery

Hi am ready to help you rught away. Just inbox me so i start ASAP. I have expertise knowledge on what you want to do. Best regards Valery

$5 USD / oră
(17 recenzii)
4.1
assignsolver

I have read and understood all your project details "Arduino debug simple setup" and I feel my self the best candidate to complete this project with 100 percent accuracy. I am Faisal Mahmood, I have more than 10 Year Mai multe

$2 USD / oră
(12 recenzii)
4.0
Izhar71

I am a passionate and dedicated biomedical engineer, here to work with different clients and help them with the use of my skills and knowledge to solve critical problems. I earned many skills like good grip on MS offic Mai multe

$2.5 USD / oră
(0 recenzii)
0.0
aman888mehra

With my diversified skill set and years of experience in numerous programming languages including C, I am confident about phenomenally dissecting and solving troubleshooting issues like the one plaguing your Arduino-Pi Mai multe

$5 USD / oră
(0 recenzii)
0.0
hassam7259

ALREADY GOT THE SOLUTION. Hey, yes i can help you in your project work. i assure you the quality work and on-time delivery. Let's discuss more in chat. Thanks

$5 USD / oră
(0 recenzii)
0.0