LAB 2 Embedded
LAB 2 Embedded
LAB 2 Embedded
OF AGRICULTURE AND
INSTITUTE FOR BASIC
TECHNOLOGY
SCIENCES, TECHNOLOGY
AND INNOVATION(PAUISTI) (JKUAT)
l d
Page 1 of 21
Directed by Leonel GAMVOU TAKLAI
Figure 1: ZYTD520 12V DC 30RPM Redüktörlü Motor - 37mm ...................................... 7
Figure 2: IRF740 N-channel Mosfet 400V-10A ............................................................... 7
Figure 3: Songle SRD-05DC-SL relay ............................................................................. 8
Figure 4: 4N35 optocoupler ............................................................................................. 8
Figure 5:Breadboard prototyping ..................................................................................... 9
Figure 6: Jumper wires .................................................................................................... 9
Figure 7: The MSP430FR5969 ..................................................................................... 10
Figure 8: Resistors ........................................................................................................ 11
Figure 9: Circuit of DC motor using MOSFET ............................................................... 12
Figure 10: Fotek SSR-50DAa........................................................................................ 14
Figure 11: AC load ........................................................................................................ 14
Figure 12: power supply for driving AC load .................................................................. 15
Figure 13: Circuit diagram of relay and AC load ............................................................ 15
Figure 14: Assembly program for running DC motor using MOSFET .......................... 16
Figure 15: result of turning DC motor using MOSFET ................................................... 17
Figure 16: Result turning Coil using MOSFET .............................................................. 18
Figure 17: Lab work result of AC load ........................................................................... 18
Page 2 of 21
Directed by Leonel GAMVOU TAKLAI
ABSTRACT
This lab work aimed to design and implement interface circuits for controlling a DC
motor and an AC load using MOSFET, relay, and optocoupler. The circuits were tested
using MSP430 Assembly code. The DC motor was controlled using both MOSFET and
relay-based circuits, while the AC load was driven using a solid-state relay module. The
developed circuits demonstrated successful control of the motor and load, and the
MSP430 Assembly code verified their functionality. This work provides a foundation for
the development of more complex control systems using microcontrollers and electronic
components.
Page 3 of 21
Directed by Leonel GAMVOU TAKLAI
AIM
The aim of this lab work is to design and test interface circuits for controlling a DC
motor and an AC load, using MOSFET, relay, and optocoupler, with MSP430 Assembly
code. The circuits will be implemented, and successful control of the motor and load will
be demonstrated.
Page 4 of 21
Directed by Leonel GAMVOU TAKLAI
INTRODUCTION
The control of electric motors and loads is essential in many applications, including
robotics, automation, and energy management. In this lab work, we aim to design and
implement interface circuits for controlling a DC motor and an AC load using MOSFET,
relay, and optocoupler. The circuits will be tested using MSP430 Assembly code, and
their functionality will be verified. The developed circuits will demonstrate successful
control of the motor and load, and provide a foundation for the development of more
complex control systems using microcontrollers and electronic components. However, In
the rest of our work, we will first show you the materials and the method used to carry out
each task, then the result obtained and the discussion. We will end with a conclusion.
Page 5 of 21
Directed by Leonel GAMVOU TAKLAI
I. MATERIALS AND METHODS
In this part, we are going to see the materials and methods employed to achieve
respectively the task 1 and task 2.
ZYTD520 DC motor,
IRF740 MOSFET,
Songle SRD-05DC-SL relay,
4N33 or 4N35 optocoupler,
Breadboard,
Jumper wires,
MSP430 microcontroller,
MSP430 LaunchPad development board,
Resistors (220 ohms, 10k ohms),
Power supply (12V).
a. ZYTD520 DC motor
The ZYTD520 is a brushed DC motor that operates at 12 volts and has a maximum
speed of 5000 revolutions per minute. It is a commonly used DC motor due to its low cost
and relatively high power output.
Page 6 of 21
Directed by Leonel GAMVOU TAKLAI
Figure 1: ZYTD520 12V DC 30RPM Redüktörlü Motor - 37mm
b. IRF740 MOSFET
The IRF740 is a power MOSFET transistor that is used to switch the DC motor on
and off. It is designed to handle high currents and voltages and can be controlled using
a low-voltage signal from a microcontroller. It connect by connecting the source (S)
pin to ground, gate (G) pin to control signal, and drain (D) pin to load.
Page 7 of 21
Directed by Leonel GAMVOU TAKLAI
c. Songle SRD-05DC-SL relay
The Songle SRD-05DC-SL is a 5V relay that can be used to control the DC motor.
When a voltage is applied to its coil, it switches the motor on or off. It is commonly used
for switching high-power loads in electronic circuits.
d. 4N35 optocoupler
Page 8 of 21
Directed by Leonel GAMVOU TAKLAI
e. Breadboard
f. Jumper wires
Jumper wires are wires used to connect the components on the breadboard. They are
typically made of copper or aluminum and have a plastic insulation coating.
Page 9 of 21
Directed by Leonel GAMVOU TAKLAI
g. MSP430 microcontroller:
h. Resistors
Resistors are electronic components used to limit the current and protect the
components from overvoltage. The 220-ohm resistor is typically used to protect the LED
of the optocoupler, while the 10k-ohm resistor is used to limit the current through the base
of the MOSFET.
Page 10 of 21
Directed by Leonel GAMVOU TAKLAI
Figure 8: Resistors
i. Power supply
The power supply is used to provide the circuits and the DC motor with a 12-volt DC
voltage. The voltage and current rating of the power supply should be chosen to match
the requirements of the circuits and the DC motor.
a. Circuit to implemented
For doing this circuit we needed livewire software, this circuit contain DC motor
having two terminals, and then we have one MOSFET having three terminals describe in
the materials parts.
Page 11 of 21
Directed by Leonel GAMVOU TAKLAI
Figure 9: Circuit of DC motor using MOSFET
There are several methods that can be used for the lab work, however we used
the following method to connect each of two (02) parts.
Page 12 of 21
Directed by Leonel GAMVOU TAKLAI
o Write a program for the microcontroller to set the MOSFET gate pin to
high to turn on the motor, and low to turn it off.
I.2.1. Requirements
Include certain materials used to do task 1, we also use Fotek SSR-50DA, AC
load, and power supply.
Page 13 of 21
Directed by Leonel GAMVOU TAKLAI
a. Module relais statique Fotek SSR-50DAa
The Fotek SSR-50DA is a solid-state relay module that can switch high voltage AC
loads using a low voltage DC input signal. It is designed for safe and reliable operation,
and can handle loads up to 50A without the need for a heat sink.
b. AC load
An AC load in our context refers to incandescent lamps that can use an alternating
current (AC) power supply.
Here we are using a lab socket which can provide 110v as a power supply, let’s see
it as a picture.
Page 14 of 21
Directed by Leonel GAMVOU TAKLAI
Figure 12: power supply for driving AC load
a. Circuit diagram
The circuit was designed to provide a safe and reliable interface between the
microcontroller and the load, ensuring that the switching device is operated within its safe
operating parameters. Our circuit contain input terminal of the relay connected to the
output pin of the microcontroller, then the output terminal of the relay connected to AC
source in series with AC load.
Page 15 of 21
Directed by Leonel GAMVOU TAKLAI
b. Connecting devices
Here, it is the step that we follow to connecting devices for the task 2. Therefore the
method is the next:
After doing all these works, we executed the assembly code to bling the LED. That
code was used for turning DC motor and driving the AC load.
Page 16 of 21
Directed by Leonel GAMVOU TAKLAI
II. RESULTS
This section presents the results obtained from the implementation and testing of the
interface circuits designed in Tasks 1 and 2, using the specified components and
microcontroller programming.
Page 17 of 21
Directed by Leonel GAMVOU TAKLAI
Figure 16: Result turning Coil using MOSFET
Page 18 of 21
Directed by Leonel GAMVOU TAKLAI
CONCLUSION
In conclusion, we have successfully designed and implemented interface circuits
to control a DC motor and an AC load using various switching devices such as MOSFET,
relay, and solid-state relay module. The circuits were tested using an MSP430
microcontroller and the corresponding assembly code. The results showed that the
circuits operated safely and reliably within the specified parameters. Overall, this lab work
provided valuable hands-on experience in circuit design and programming, and
demonstrated the importance of careful component selection and safety considerations.
Page 19 of 21
Directed by Leonel GAMVOU TAKLAI
REFERENCES
Document references:
Mazidi, Muhammad Ali, and Rolin D. McKinlay. The MSP430 Microcontroller and
Embedded Systems: Using Assembly and C for MSP430. Pearson, 2015.
Razavi, Behzad. Design of Analog CMOS Integrated Circuits. McGraw-Hill Education,
2017.
Website reference:
"Solid-State Relays," Omega Engineering, accessed July 10, 2023,
https://www.omega.com/en-us/resources/solid-state-relays
Page 20 of 21
Directed by Leonel GAMVOU TAKLAI