Page 277 - ARM Based Microcontroller Projects Using MBED
P. 277

9.2 PROJECT 1—SIMPLE BRUSHED DC MOTOR CONTROL           263











            FIG. 9.3  Program PDL.


































            FIG. 9.4  Program listing.


            OFF are defined as 1 and 0, respectively. The program runs in an endless loop formed using a
            while statement. Inside this loop the motor is activated for 10s, then stopped for 5s, and then
            again activated for 10s. This process continues until stopped manually by the user.



            9.2.7 Using a Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET)
              A MOSFET transistor can be used for motors requiring larger currents instead of a bipolar
            transistor. Fig. 9.5 shows the circuit diagram with an IRL540-type MOSFET transistor. This
            MOSFET has logic level gate drive and is therefore compatible with microcontroller output
            circuits. It is also possible to use a relay instead of transistor for even larger voltages and cur-
            rents. This is shown in Fig. 9.6.
   272   273   274   275   276   277   278   279   280   281   282