Sorry to hear that… I’m pretty sure ESP cannot be fried with my circuit, where GPIO2 is pulled up to 3v3 through 1k and pnp base-emitter junction. Maybe you connected pnp emitter to 12V by mistake? Anyway, I will test this circuit soon as I need to control a led strip too…
Well I had this problem before and my solution was to connect a pot.(20-47k) to the base of the transistor,instead of 1k resistor.Adjust pot to get right bias value then replace with nearest value resistor.
@claytoncamilleri100 Yes firstly i use ESP-01 with external pull up resistor at GPIO2 + 2N2222 to drive a relay and it works fine for me ,except one problem which is 2N2222 is switched on when it’s base is High and i’m already pull GPIO2 up so at restarting ESP (the 2 or 3 seconds it determine its operation mode) the 2N2222 is on (due to the pull up R) and my relay is switched on .
And also it was normally to control as “1” drives the 2N2222 on & “0” drives it off
But then i changed to ESP12 & ESP12E which has a plenty of GPIO and i don’t need to concern about GPIO0 &GPIO2 and pull up R and also i reduce my PCB size
I redid you circuit and it worked fine, no burnt components . Is there a way I can change the logic in the software and not send 0 to turn on the leds?
Better now…
Is the V63 a slider fixed from 1 to 3?
I think you must use other variable for the digitalWrite, you are always using the same (fadeVal) and I guess Blynk is overwriting its value
int fadeVal; // this is teh Blynk variable
int fadeSet; // this is the value sent to the PIN
#define testIRF520 5 //pin for IRF520 testing
BLYNK_WRITE(V63) //MANUAL fan speed setting
{
fadeVal = param.asInt(); // set fader
if (fadeVal == 0)
{
analogWrite(testIRF520, 0); //off
Serial.println(F("FADE set to 0"));
Serial.println(fadeSet);
}
else if (fadeVal == 1)
{
fadeSet = 1;
fadeSet = map(fadeSet, 0, 3, 1, 255); // scale it
analogWrite(testIRF520, fadeSet);
Serial.println(F("FADE set to 1"));
Serial.println(fadeSet);
}
else if (fadeVal == 2)
{
fadeSet = 2;
fadeSet = map(fadeSet, 0, 3, 1, 255); // scale it
analogWrite(testIRF520, fadeSet);
Serial.println(F("FADE set to 2"));
Serial.println(fadeSet);
}
else if (fadeVal == 3)
{
fadeSet = 3;
fadeSet = map(fadeSet, 0, 3, 1, 255); // scale it
analogWrite(testIRF520, fadeSet);
Serial.println(F("FADE set to 3"));
Serial.println(fadeSet);
}
}
Hi @Dave1829,
I have no experience with those devices but I think you should use the PWM signal to the AC line and not to the output. Unfortunately the little board can’t be used for that purpose.
Please check in detail before doing something wrong.