Need help : MOSFET Power Switch SPX-19799

Hello,

I’m trying to get the MOSFET Power Switch SPX-19799 working wired to an esp 8266. (https://www.sparkfun.com/products/19799)

My sketch is programmed to send a low/high signal to the SPX’s CTL connector.

The serial of the virtual switch function in blynk responds well… the message “switch high” and switch low "appears on activation. The output gpio of the esp is a digital pin (2) on a feather huzzah.

But the SPX stays always on low ( blue led activated)… i have to disconnect the wire between the 8266 gpio and the CTL on the spx to inteerupt the 12v output.

What have i forgotten ? should i use an analog output on the esp ? should i connect something to the SPX VCC ?

Thank you in advance, alan

Can you post photos of your setup?

Is the ctrl pin actually going high and low when measured with a voltmeter?

Thank you all for your answers.

I could get further in the observations.

I have 3 MOSFET Power Switch SPX-19799 and 3 8266 , and the behavior is the same on all the 3. It means it’s not a defect of one of my power switchs.

What is functional ?

when i startup the esp + switch without the link on the digital pin ( pin 2 to CTL from switch) , everything boots.

when i connect the esp digital pin 2 to the CTL switch AFTER the boot, every thing stay stable AND the virtual blynk switch works perfectly. blue LED on esp and red LED on switch

What is NOT functional ?

when then i restart the esp (physical button on the esp) and the virtual blynk switch is ON with the link on the digital pin to the esp, the esp stays online in blynk…blue LED on esp and red LED on switch, the virtual switch does not work.

If i restart the esp (physical button on the esp) and the virtual blynk switch is OFF with the link on the digital pin to the esp, the esp stays online in blynk…blue LED on esp and red LED on switch are turning automatically on, the virtual switch does not work.

IF i resume, everything works if i wire the digital pin 2 to the CTL switch after boot…and if i don’t restart the wired esp…

Later today i’ll try to insert a 470ohm between the pins…

an other idea could be to give a delay to the digital pin before activating after boot…but i’m not able to code this in my sketch.

thanks again, alan https://photos.app.goo.gl/T1UXNW7mFarwTpv18

Blynk sketch

#define BLYNK_PRINT Serial

#define BLYNK_TEMPLATE_ID “”

#define BLYNK_TEMPLATE_NAME “”

#define BLYNK_AUTH_TOKEN “”

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

char ssid = “”;

char pass = “”;

void setup()

{

Serial.begin(115200);

pinMode(2, OUTPUT);

Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);

}

BLYNK_WRITE(V2)

{

if(param.asInt() == 1)

{

digitalWrite(2,HIGH);

}

else

{

digitalWrite(2,LOW);

}

Serial.print(“.”);

}

void loop()

{

Blynk.run();

}

Change your code and move CTRL over to pin 14 and see if that works.

SOLVED !

The idea to change for an other PIN is the one. Strangely, it’s not working with the TX Pin 2, but it definitely works with the RX port 3…

Thank you for your help ! alan

SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !SOLVED !