Hello. I, as a beginner in electronics, want to share my small practical experience with other novice lovers. Some time ago I ordered myself an Arduino, I received it, a circuit board for testing and several radio components. I tried various examples with LEDs, etc. experiments. I wanted to connect the electric motor, which was also included. I tried to connect it directly to the controller's legs, but it was not there. It turns out that arduino produces insufficient current in order to rotate the electric motor. It turns out that in this case, when you need to control a large current, you use an amplifier with transistors, and for amplifying the current you need a
circuit with a common collector (Emitter follower) .
Here is my electric motor control circuit:
Two transistors work as a composite transistor, this is necessary in order to increase the gain over current. The electric motor is powered by a separate power source, the Arduino is powered by USB.
')
Below is the Arduino program code (a converted Fade example).
int brightness = 50; // how bright the LED is
int fadeAmount = 1; // how many points to fade the LED by
void setup() {
pinMode(9, OUTPUT);
}
void loop() {
analogWrite(9, brightness);
brightness = brightness + fadeAmount;
if (brightness <= 50 || brightness >= 255) {
fadeAmount = -fadeAmount ;
}
delay(30);
}
The program in the cycle changes the value on the PWM output No. 9 from 50 to 255 and back, with the electric motor gradually gaining momentum, then slowing down, and so on.
The scheme is simple and allows you to turn the engine in only one direction. In order to turn the engine in different directions, a certain H-bridge is used, the study of which I have not yet reached.
Thanks
Ocelot - he told me some things that helped me a lot in studying this issue.