TimoR
April 1, 2020, 7:10pm
1
Hello Blynk Community,
while i was trying to control my DC motor with a L9110s my digital Pins D5 and D6 suddenly stopped working. I loaded an (empty) new sketch on my board to see if there is a mistake in my code, but the pins still didn’t react.
When i am measuring the outputs the digital pin D5 always shows 3,3V. The pin D6 always shows 1,6V. Even if i try to change the status in the code, the pins always remain in output 3,3V and 1,6V.
I tried a lot to control them or change their status, but they never seem to react. I don’t get it. Do I need to define a certain pinMode in the code? Or are the pins just destroyed?
PS: It is just with these two pins. All the other ones work.
Best regards
Timo
What specific ESP8266 device are you using?
billd
TimoR
April 2, 2020, 6:38am
3
Hey Bill
i am using is a NodeMCU Lua Amica Modul V2 ESP8266 ESP-12F WIFI Wifi Development Board.
Gunner
April 3, 2020, 12:08am
4
If you are using actual code for pin control, AKA digitalWrite()
etc, then YES you need the appropriate pinMode()
for each pin used.
Post your sketch, we can have a look.
billd
TimoR
April 5, 2020, 10:09am
6
#define BLYNK_PRINT Serial
#include <ESP8266WebServer.h>
#include <SimpleTimer.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
const int A1A = D5; // WarmwasserkugelhahnA
const int A1B = D6; // WarmwasserkugelhahnA
const int B1A = D4; // KaltwasserkugelhahnB
const int B1B = D7; // KaltwasserkugelhahnB
// temperature sensor
int Thermistorstatus;
int ThermistorPin = 0;
int Vo;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;
// starting loop from simple timer
SimpleTimer timer;
void WarmwasserKugelhahn(){
WarmwasserKugelhahnA ('R');// Turn motor A to RIGHT
delay(3000);
WarmwasserKugelhahnA ('0');
Serial.println("Stopp");
delay(3000);
}
void KaltwasserKugelhahn(){
KaltwasserKugelhahnB ('L');// Turn motor B to RIGHT
delay(3000);
KaltwasserKugelhahnB ('0');
Serial.println("Stopp");
delay(3000);
}
// loop for temperature sensor
void Temperaturmesser(){
Vo = analogRead(ThermistorPin); // ESP8266 is reading the temperature on analog Pin Number AD0 and declarates it to integer "Vo".
R2 = R1 * (1023.0 / (float)Vo - 1.0); //following is the calculation for the temperature.
logR2 = log(R2);
T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
T = T - 273.15;
T = (T * 9.0)/ 5.0 + 32.0;
T = (T - 32)* 5/9;
Serial.print("Temperature: "); // printing to serial monitor.
Serial.print(T);
Serial.println(" °C");
delay(500); // repeating the process every 1/2 seconds.
}
void WarmwasserKugelhahnA(char d){
if(d =='R'){
digitalWrite(A1A,LOW);
digitalWrite(A1B,HIGH);
}else if (d =='L'){
digitalWrite(A1A,HIGH);
digitalWrite(A1B,LOW);
}else{
digitalWrite(A1A,LOW);
digitalWrite(A1B,LOW);
}
}
void KaltwasserKugelhahnB(char d){
if(d =='R'){
digitalWrite(B1A,LOW);
digitalWrite(B1B,HIGH);
}else if(d =='L'){
digitalWrite(B1A,HIGH);
digitalWrite(B1B,LOW);
}else{
digitalWrite(B1A,LOW);
digitalWrite(B1B,LOW);
}
}
void setup() {
Serial.begin(115200);
pinMode(A1A,OUTPUT);
pinMode(A1B,OUTPUT);
pinMode(B1A,OUTPUT);
pinMode(B1B,OUTPUT);
delay(3000);
timer.setInterval(1000L, WarmwasserKugelhahn);
timer.setInterval(1000L, KaltwasserKugelhahn);
timer.setInterval(1000L, Temperaturmesser);
}
void loop() {
timer.run(); // runs the simple Timer library
}
They could be floating. Did you try a simple non blynk sketch that
digitalWrite(D5,LOW);
Then test the voltage…