CSE3216-Lab Manual
CSE3216-Lab Manual
CSE3216-Lab Manual
Laboratory Manual
CSE3216
Microcontroller Based System Design Lab
Preface
This course is designed to provide computer science and engineering undergraduates with basic
understanding of the theory and practice of microcontroller based systems. Students will learn
about the internal and external structure of microcontroller based embedded systems. Students
will learn about the design and construction of microcontroller based automated systems.
General Guidelines
Exercises:
Exercises:
A register select (RS) pin that controls where in the LCD's memory you're writing data to.
You can select either the data register, which holds what goes on the screen, or an
instruction register, which is where the LCD's controller looks for instructions on what to
do next.
A Read/Write (R/W) pin that selects reading mode or writing mode
An Enable pin that enables writing to the registers
8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you're writing
to a register when you write, or the values you're reading when you read.
There's also a display constrast pin (Vo), power supply pins (+5V and Gnd) and LED
Backlight (Bklt+ and BKlt-) pins that you can use to power the LCD, control the display
contrast, and turn on and off the LED backlight, respectively.
The process of controlling the display involves putting the data that form the image of what you
want to display into the data registers, then putting instructions in the instruction register. The
LiquidCrystal Library simplifies this for you so you don't need to know the low-level instructions.
The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit mode
requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins. For displaying
text on the screen, you can do most everything in 4-bit mode, so example shows how to control
a 2x16 LCD in 4-bit mode.
Design:
Exercises:
Design a simple calculator using Arduino, available keypad and 2x20 LCD display.
Design a system to show values in seven segment display.
Experiment 4: Interfacing DC motors with motor driver and Arduino.
Objective: Interfacing simple DC motors with motor driver L293D and Arduino. Create the
working procedures of two wheeler car.
Description: A direct current, or DC, motor is the most common type of motor. DC motors
normally have just two leads, one positive and one negative. If you connect these two leads
directly to a battery, the motor will rotate. If you switch the leads, the motor will rotate in the
opposite direction.
The L293D has two +V pins (8 and 16). The pin '+Vmotor (8) provides the power for the motors,
and +V (16) for the chip's logic. We have connected both of these to the Arduino 5V pin. However,
if you were using a more powerful motor, or a higher voltage motor, you would provide the motor
with a separate power supply using pin 8 connected to the positive power supply and the ground
of the second power supply is connected to the ground of the Arduino.
Design:
Exercises:
Exercises:
Design security door system with keypad and servo motor with Arduino.
Experiment 6: Interfacing some sensors with Arduino.
Objective: Interfacing LDR, LM-35 and ultrasonic sensor Arduino and displaying the values in
serial monitor.
Description: The HC-SR04 Ultrasonic Sensor is a very affordable proximity/distance sensor that
has been used mainly for object avoidance in various robotics projects. It essentially gives your
Arduino eyes / spacial awareness and can prevent your robot from crashing or falling off a table.
It has also been used in turret applications, water level sensing, and even as a parking sensor.
The LM35 is a common TO-92 temperature sensor. It is often used with the equation:
temp = (5.0 * analogRead(tempPin) * 100.0) / 1024;
However, this does not yield high resolution. This can easily be avoided, however. The LM35 only
produces voltages from 0 to +1V. The ADC uses 5V as the highest possible value. This is wasting
80% of the possible range. If you change aRef to 1.1V, you will get almost the highest resolution
possible.
A LDR (Light Dependent Resistor) or a photo resistor is a photo conductive sensor. It is a variable
resistor and changes its resistance in a proportion to the light exposed to it. It’s resistance
decreases with the intensity of light.LDR is connected to a 10 Resistance in series. +5 Voltage is
applied to this arrangement. As the light intensity changes LDR value changes thus the voltage
drop on LDR will change and we are going to measure that voltage change.
Design:
Exercises:
Design a simple digital home system with Arduino and required sensors.
Design a simple home automation system with Arduino and required instruments.