Latest posts by Ajeng Putri Setyani (see all)
- ADD OWNCLOUD STORAGE CAPACITY - July 20, 2017
- SYNCRONIZATION OF INTER DEVICE WITH OWNCLOUD SERVER - July 20, 2017
- INSTALLATION AND CONFIGURATION OWNCLOUD IN SERVER PART 1 - July 20, 2017
Introduction of DC Motor
DC motor is a motor whose rotors will rotate when given DC voltage. DC is derived from direct current, which means direct current. Examples of these motors are shown in Figure 6.1. This bike is widely used on fans and toy cars or quadcopter cars.
Compilation of Circuit with DC Motor
For the purpose of experimenting with a DC motor, you can use a DC motor from a used car toy or a small fan that uses a voltage of 3-12 volts. The example in Figure 6.3 is a toy fan that uses two 1.5 volt batteries. To conduct the experiment, the fan is modified by adding two cables connected to the switch. The purpose of the use of such cables is for the fan to be controlled via Scratch for Arduino.
To connect both cables in the fan, needed a relay. Examples of relays are shown in Figure 6.4. By default, ie when A and B are not given voltage, C and D are connected, while C and E are not connected. However, if a 5V voltage is given between A and B, C and D are not connected, while C and E are connected. Based on this, we can connect the two cables in the fan forward by providing a voltage of 5V on A and B or not. For this purpose, the circuit as shown in Figure 6.5 needs to be constructed. In this case you can use four male-female wires.
Based on the series, create a new project called fan. Then, compile the script as follows:
The script will turn on the fan for 4 seconds and then turn it off for 4 seconds. This will be repeated constantly.
If you do not have a fan like that, you can buy a mini fan (about 3 x 3 mm) as shown in Figure 6.7 in the electronics store.
To experiment with a fan, the circuit shown in Figure 6.8 needs to be arranged first.
Please note, in the market there are also relays in the form of modules, as shown in Figure 6.9 this module makes it easy to wiring
To put it into practice, you can install the circuit as shown in Figure 6.10 to test the circuit, please use the fan script.
Rotation of DC Motor Be Reversed
DC motor rotation can be made clockwise or counterclockwise. This is simply done by giving the opposite polarity to the DC motor. To understand it. Please make an experiment as shown in Figure 6.11 You need a 3 volt DC motor and 3V battery and its container. You will see the opposite direction of motor rotation between circuit 6.11 (a) and 6.11 (b).
As an illustration, the direction of Dc motor rotation is very useful to make a robot car that can move forward or backward or turn left or right. Well, the forward or backward direction can be done through the direction of motor rotation. Similarly, if you want to set the car to turn left or right. Please see Figure 6.12.
To change DC motor rotation, relay module containing two relays can be used. In this case each motor requires two relays.
Set the DC Motor Speed
For the purpose of setting the motor speed, a component called transistor is required. As long as you put the motor control pin on the PWM pin (pin 3, 5, 6, 9, 10), motor speed can be adjusted. However 4 Scratch for Arduino, only pins 5, 6 and 9 can be used. For this purpose, arrange the circuit as shown in Fig. 6.15. The example of preparation in the breadboard is shown in Figure 6.16.
The circuit in front involves a component called a transistor. The transistor used is TIP120 whose shape is shown in Figure 6.17
To put it into practice, create a new project called speed later, create a script like this:
Keep in mind, the 4.012 figure comes from 1023/255. The number 1023 represents the largest value generated by the analog pin and 255 is the largest value in pin 9 (PWM pin).
Introduction of Servo Motor
Servo motors are a type of DC motor that is specifically designed so that the rotation can be set to point to a certain degree position. Generally the adjustable degree ranges between 00 and 1800 samples of servo motors shown in Figure 6.18.
Servo Motor Testing
To test the servo motor, the circuit shown in Figure 6.19 needs to be arranged first. In this case the red wire on the servo motor is connected to the Arduino 5V pin, the black (or brown) wire is connected to the Arduino ground, and the yellow wire is connected to pin 8 of the Arduino.
After the sequence is set up, create a new project called servo. Then create a script like the following first:
In this case the block is in the Motion group, then, run the script. After that pair the direction pointer to the end of the rotor in the servo motor so that it points to the position of 1800. The result is shown in Figure 6.20
Next, you can complete the following script:
If the above script is executed, the motor will rotate all three positions, ie 00, 900, and 1350. Each is maintained for two seconds.
ervo and LDR motors
In the following experiment, the servo motor will be controlled by the LDR. The motor will rotate according to the light intensity received by the LDR. The required circuit is shown in Figure 6.22.
To put it into practice, create a new project called servoldr. Then create a script like this:
Keep in mind, the 0.1759 figure comes from 180/1023 stating the largest angle on the servo motor and 1023 is the largest value on the analog pin.
Use of Motor Direction and Motor Off
Scratch for Arduino provides a block named motor direction that can be used to set the direction of motor rotation. To understand this, create a new project called servodir and then arrange the script as follows:
Here’s the description of the script in front:
– motor 8 clokwise direction is used to adjust the rotation of DC motor connected to pin 8 clockwise. Rotation length is determined by wait 1 secs.
– Motor 8 off is used to stop motor rotation.
– The anticlockwise 8 direction motor is used to adjust the rotation of DC motor connected to pin 8 counterclockwise. Rotation length is determined by wait 1 secs.