0% found this document useful (0 votes)
8 views

Embedded System Unit 4

The document provides a detailed explanation of interfacing an IR sensor with Arduino, including necessary components and step-by-step instructions. It also covers serial communication functions in Arduino, highlighting key functions like Serial.begin(), Serial.print(), and Serial.read(). Additionally, it compares RISC and CISC processors, lists advantages of PLDs, and outlines major application areas of embedded systems.

Uploaded by

vikram singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Embedded System Unit 4

The document provides a detailed explanation of interfacing an IR sensor with Arduino, including necessary components and step-by-step instructions. It also covers serial communication functions in Arduino, highlighting key functions like Serial.begin(), Serial.print(), and Serial.read(). Additionally, it compares RISC and CISC processors, lists advantages of PLDs, and outlines major application areas of embedded systems.

Uploaded by

vikram singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Unit 4

Q1. Explain interfacing of IR Sensor with Arduino?


Ans: interfacing an IR (Infrared) sensor with an Arduino is a common task in electronics and robotics
projects. IR sensors can be used for various purposes, including detecting the presence of objects, measuring
distance, or even receiving signals from remote controls. Here's a step-by-step guide on how to interface an
IR sensor with an Arduino:
Components Needed:
1. Arduino board (e.g., Arduino Uno, Arduino Nano, etc.)
2. IR sensor module (e.g., KY-022 or similar)
3. Breadboard and jumper wires
4. Power source (USB cable or battery)
Steps to Interface IR Sensor with Arduino:
1. Connect the Power Supply:
 Connect the VCC (or +) pin of the IR sensor to the 5V output on the Arduino.
 Connect the GND (or -) pin of the IR sensor to one of the GND (ground) pins on the Arduino.
2. Connect the Data/Signal Pin:
 Connect the OUT (or Signal) pin of the IR sensor to any digital input pin on the Arduino (e.g., D2).
3. Upload the Arduino Sketch:
 Open the Arduino IDE on your computer.
 Write or copy an Arduino sketch (program) to read data from the IR sensor. Here's a basic example to get
you started:
output Upload the Sketch to the Arduino:
 Connect your Arduino to your computer via USB.
 Select the correct Arduino board and COM port from the "Tools" menu in the Arduino IDE.
 Click the "Upload" button to upload the sketch to the Arduino.
4. Monitor the Serial Output:
 Open the Serial Monitor in the Arduino IDE by clicking on the magnifying glass icon (or press
Ctrl+Shift+M).
 The Arduino will print "Object detected!" to the Serial Monitor whenever it detects an object in front of the
IR sensor.
5. Test the Sensor:
 Place an object in front of the IR sensor, and you should see the "Object detected!" message in the Serial
Monitor.
That's it! You have successfully interfaced an IR sensor with an Arduino. You can modify the Arduino
sketch to suit your specific project requirements, such as adjusting the sensitivity or adding more complex
logic based on the sensor's input.

Q2. Explain the function related to serial communication in arduino ?


AnsSerial communication is an essential feature in Arduino that allows you to exchange data between the
Arduino board and a computer or other external devices. It's commonly used for debugging, monitoring, and
controlling Arduino projects. The Arduino platform provides a set of functions and objects to work with
serial communication. Here are some of the key functions and objects related to serial communication in
Arduino:
1. Serial.begin(baudrate):
 This function initializes the serial communication with a specified baud rate (data transmission speed)
between the Arduino and an external device (usually a computer). For example, Serial.begin(9600); sets the
baud rate to 9600 bits per second.
2. Serial.print(data):
 This function sends data to the serial port for output. It can accept various data types, including integers,
floats, and strings. For example:
3. Serial.println(data):
 Similar to Serial.print(), this function sends data to the serial port, but it also adds a newline character (\n)
at the end of the data. This is useful for formatting output on the serial monitor. For example:
4. Serial.read():
 This function reads the next byte (character) of incoming data from the serial port. It returns the data as an
integer representing the ASCII value of the character.
5. Serial.available():
 This function returns the number of bytes (characters) available for reading in the serial input buffer. It's
often used with Serial.read() to check if there is new data to be read.
6. Serial.write(data):
 This function sends a byte of data to the serial port. It's commonly used to send binary data or control
commands to external devices.
7. Serial.flush():
 This function waits for all outgoing serial data to be transmitted. It ensures that data in the output buffer is
sent before proceeding with other code. It's useful when you want to make sure that all data is sent before
doing something critical.
8. Serial Monitor:
 The Arduino IDE includes a Serial Monitor tool that allows you to interact with the Arduino over a serial
connection. You can use it to send commands to the Arduino and receive data from it. To open the Serial
Monitor, click on the magnifying glass icon in the Arduino IDE or use the Ctrl+Shift+M keyboard shortcut.

Q3. What is Different Between RISC V/s CISC Processors/Controllers?


RISC V/s CISC Processors/Controllers:

RISC CISC
Lesser no. of instructions Greater no. of Instructions
Instruction Pipelining and increased execution Generally no instruction pipelining feature
speed
Orthogonal Instruction Set (Allows each instruction Non Orthogonal Instruction Set (All instructions
to operate on any register and use any addressing are not allowed to operate on any register and
mode) use any addressing mode. It is instruction
specific)
Operations are performed on registers only, the Operations are performed on registers or
only memory operations are load and store memory depending on the instruction

Large number of registers are available Limited no. of general purpose registers
Programmer needs to write more code to execute a . A programmer can achieve the desired
task since the instructions are simpler ones functionality with a single instruction which in
turn provides the effect of using more simpler
single instructions in RISC
Single, Fixed length Instructions Variable length Instructions

Less Silicon usage and pin count More silicon usage since more additional
decoder logic is required to implement the
complex instruction decoding.
With Harvard Architecture Can be Harvard or Von-Neumann Architecture

Q4. write the Advantage of PLDs


Ans ADVANTAGES OF PLDs:
o PLDs offer customer much more flexibility during design cycle

o PLDSs do not require long lead times for prototype or production-the PLDs are already on a distributor‟s
self and ready for shipment
o PLDs do not require customers to pay for large NRE costs and purchase expensive mask sets

o PLDs allow customers to order just the number of parts required when they need them. allowing them to
control inventory.

o PLDs are reprogrammable even after a piece of equipment is shipped to a customer.

o The manufacturers able to add new features or upgrade the PLD based products that are in the field by
uploading new programming file

Q5. What are the major Application of Embedded System ?


Ans Major Application Areas of Embedded Systems:
Consumer Electronics: Camcorders, Cameras etc.
Household Appliances: Television, DVD players, washing machine, Fridge, Microwave Oven etc.
Home Automation and Security Systems: Air conditioners, sprinklers, Intruder detection alarms, Closed
Circuit Television Cameras, Fire alarms etc.
Automotive Industry: Anti-lock breaking systems (ABS), Engine Control, Ignition Systems, Automatic
Navigation Systems etc.
Telecom:Cellular Telephones, Telephone switches, Handset Multimedia applications etc
Computer Peripherals: Printers, Scanners, Fax machines etc.
Computer Networking Systems: Network Routers, Switches, Hubs, Firewalls etc.
Health Care: Different Kinds of Scanners, EEG, ECG Machines etc.
Measurement & Instrumentation: Digital multi meters, Digital CROs, Logic Analyzers PLC systems etc.
Banking & Retail: Automatic Teller Machines (ATM) and Currency counters, Point of Sales (POS)
Card Readers: Barcode, Smart Card Readers, Hand held Devices etc.

You might also like