Perhaps I can see yours sir?
Currently inconvienient but be aware half smart replies from first timers who think they know everything because they watch youtube, will only get a black mark against you.
We tell you the mistakes people make to help, not hinder.
Yep I am a newbie, very sorry I just want to make this works. Can’t make it from sratch without watching on youtube
False. There was a time when microcontrollers (PICs) did not have YouTube, only books.
Not the same. The power is coming from a mystery power supply off the screen, to the left, that is NOT a 9vdc battery... or the motor in the video might be a 3vdc to 6vdc motor. YouTube does not reward the makers for being honest, only making people "click"... so a great number of "Arduino" YouTube makers are just liars.
I siplified the code to a basic pulse.
//www.elegoo.com
//2016.12.12
/************************
Exercise the motor using
the L293D chip
************************/
#define ENABLE 5
#define DIRA 3
#define DIRB 4
void setup() {
//---set pin direction
pinMode(ENABLE,OUTPUT);
pinMode(DIRA,OUTPUT);
pinMode(DIRB,OUTPUT);
Serial.begin(9600);
}
void loop() {
analogWrite(ENABLE, 255);
digitalWrite(DIRA, HIGH);
digitalWrite(DIRB, LOW);
delay(1000);
digitalWrite(DIRA, HIGH);
digitalWrite(DIRB, LOW);
delay(1000);
}
Thats about all i can say. I'm somewhat new so my knowledge is limited.
If your fan motor does not need to reverse, you don't need a motor driver, just a single transistor depending on the motor's voltage and current ratings, which you haven't said.
Do you have a multimeter to check that "power supply"? Those ship with a few starter kits (like ELEGOO) and I as well as others in the forum have noted that they suck.
Mine burnt out powering the SG90 micro servo that ships with the kit.
Just another thing to check.
If it is ruined or if you want to use something different next time, a buck converter is a great choice and they're very inexpensive and so much better than making your own L7805 linear regulator (vs LM2596 based regulator).
I tried yours sir and it works. But It doesnt work with battery. The power supply comes from the Arduino to The laptop or PC. If its not connected to the pc it doesnt work(obviously)is this normal?
Now I need to connect it to the DHT11 so the dc fan is controlled by the temperature, and the temperature will display on the 16x2 lcd.is it possible? thank you
Apperently your smoke alarm battery is not sufficient to drive the motor. A little help from usb seems enough to get it going.
Buy better batteries! If you make a mistake you may burn out your computer USB....
One of the Vcc entrences does the motors. Use an external power suppy there. The other does the logic. Even 5V from arduino should be enough.
See the datasheet at ti.com to find out which is which...
I do not care about the video.
The cap is not needed to run the motor for the duration of a youtube film.
On the longer run it will protect your stuff from voltage spikes and random behaviour.
since the motor already spins and I can adjust the speed. Should I proceed to put dht11 sensor and connect it to LCD?Thank you
I would invest in the capacitor...
Get one from something old on its way to the rubbish...
In the shop they should be a few dollars per ten...
If you have voltage spikes, that will cause noise on the dht readings...