Hi there,
I made a basic arduino sketch to control a dc motor and it works perfectly. here’s the code:
const int motor = 3;
const int potPin = A0;
void setup() {
// put your setup code here, to run once:
pinMode(potPin, INPUT);
pinMode(motor, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int potVal = analogRead(potPin);
int motorSpeed = map(potVal,0,1023,0,255);
analogWrite(motor, motorSpeed);
Serial.print("potVal: ");
Serial.print(potVal);
Serial.print(" ");
Serial.print("motor speed: ");
Serial.println(motorSpeed);
}
And here is my circuit:
Now i would like to use the same circuit, and connect the gate of the mosfet to my esp8266 12-E, and control it with blynk.
I tried doing it and setup a slider in the app and it went very very slow, i only got about 10% of the usual speed.
thanks
shmily