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

2024 Previous

The document covers various technical topics including logical operators in Python, installation steps for Raspberry Pi OS, types of fingerprint sensors, differences between SoC and processor on chip, technical specifications of BeagleBone Black, and an overview of Wi-Fi technology. It also discusses embedded systems, I/O functions in Python, and the architecture of SoCs, along with practical examples and applications. Additionally, it highlights the working principles of fingerprint sensors and the functionalities of library functions in programming.

Uploaded by

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

2024 Previous

The document covers various technical topics including logical operators in Python, installation steps for Raspberry Pi OS, types of fingerprint sensors, differences between SoC and processor on chip, technical specifications of BeagleBone Black, and an overview of Wi-Fi technology. It also discusses embedded systems, I/O functions in Python, and the architecture of SoCs, along with practical examples and applications. Additionally, it highlights the working principles of fingerprint sensors and the functionalities of library functions in programming.

Uploaded by

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

a) Logical Operators in Python

Logical operators are used to perform logical operations on Boolean values. Python supports
three main logical operators:

1. and – Returns True if both operands are true.


Example: True and False → False

2. or – Returns True if at least one operand is true.


Example: True or False → True

3. not – Reverses the Boolean value.


Example: not True → False

b) Steps for Installation of Raspberry Pi Operating System (Raspberry Pi OS)

1. Download the Raspberry Pi Imager from the official Raspberry Pi website.

2. Install the Imager on your PC (Windows/macOS/Linux).

3. Insert the microSD card into your computer.

4. Run the Raspberry Pi Imager and choose the OS (e.g., Raspberry Pi OS).

5. Select the microSD card as the storage device.

6. Click “Write” to install the OS onto the SD card.

7. Insert the SD card into the Raspberry Pi, connect peripherals (monitor, keyboard,
mouse), and power it up.

c) Fingerprint Sensor

A fingerprint sensor is a biometric device that scans and recognizes fingerprints for
authentication and identification.
Types include:

• Optical – Captures a digital image using light.

• Capacitive – Uses electrical current to map fingerprint ridges.

• Ultrasonic – Uses sound waves to create a 3D image.

Used in:
• Smartphones

• Access control systems

• Security applications

d) Difference Between SoC (System on Chip) and Processor on Chip

Feature SoC (System on Chip) Processor on Chip

Integrates CPU, GPU, memory, and


Definition Contains only the CPU
peripherals

Functionality All-in-one computing solution Requires external components

Power & Size Less efficient for embedded


More power and space-efficient
Efficiency applications

e) Technical Specifications of BeagleBone Black

• Processor: AM335x 1GHz ARM® Cortex-A8

• RAM: 512MB DDR3L

• Storage: 4GB eMMC on-board flash + microSD slot

• Connectivity: USB, Ethernet, HDMI

• GPIO: 65 digital I/O pins, PWM, I2C, SPI, UART

• Operating System: Debian Linux (default)

f) Wi-Fi

Wi-Fi (Wireless Fidelity) is a wireless networking technology that enables devices to connect to
the internet and each other over a wireless local area network (WLAN).

Key Points:

• Based on IEEE 802.11 standards

• Operates typically in 2.4 GHz and 5 GHz bands


• Enables wireless internet access in homes, offices, and public

a) i) Python Program to Find Perimeter of a Rectangle

Formula for perimeter of rectangle:


Perimeter = 2 × (Length + Width)

length = float(input("Enter the length of the rectangle: "))

width = float(input("Enter the width of the rectangle: "))

perimeter = 2 * (length + width)

# Output result

print("Perimeter of the rectangle is:", perimeter)

a) ii) Circuit Diagram of Switch Interfacing with Raspberry Pi

Description: A simple push-button switch is connected to a GPIO pin on the Raspberry Pi. A pull-
down resistor ensures the input reads LOW when the button is not pressed.

Here is a simplified ASCII-style representation:

3.3V

[]

[Button]

GPIO ----+----> Pi GPIO (e.g., GPIO17)

[10kΩ]

GND

If you want a proper circuit diagram image, I can find one online for you—would you like that?
b) Basic Architecture of SoC (System on Chip)

A System on Chip (SoC) is an integrated circuit that integrates all components of a computer or
other electronic system into a single chip.

Key Components of SoC Architecture:

1. CPU (Central Processing Unit)

o Core processing unit for general-purpose tasks.

2. GPU (Graphics Processing Unit)

o Handles graphics rendering and sometimes parallel processing.

3. Memory (RAM, ROM, Cache)

o On-chip memory for fast data access.

4. I/O Interfaces

o Connectors for USB, HDMI, GPIO, UART, SPI, I2C, etc.

5. Power Management Unit (PMU)

o Manages power distribution and battery.

6. DSP (Digital Signal Processor)

o Specialized for signal processing tasks (e.g., audio/video).

7. Connectivity Modules

o Wi-Fi, Bluetooth, GPS, etc.

8. Bus Systems

o Interconnects all components (e.g., AMBA bus).

Summary:

An SoC integrates all major hardware blocks on a single chip, making devices more compact,
power-efficient, and cost-effective—commonly used in mobile devices, Raspberry Pi, embedded
systems, etc.
a) LCD Interfacing to Raspberry Pi [5 marks]

Circuit Diagram:

(Since I can provide visual aids, would you like me to show a labeled circuit diagram image of
Raspberry Pi and LCD interfacing?)

For now, here's a description and simplified schematic:

Components Required:

• Raspberry Pi (any model with GPIO headers)

• 16x2 LCD (HD44780 compatible)

• 10k potentiometer (for contrast control)

• Resistors (optional, for safety)

• Jumper wires

• Breadboard

Pin Connections:

LCD Pin Function Raspberry Pi GPIO Pin

VSS GND Pin 6 (GND)

VDD +5V Pin 2 (5V)

VO Contrast Control Via potentiometer

RS Register Select GPIO 26 (Pin 37)

RW Read/Write GND (write mode only)

E Enable GPIO 19 (Pin 35)

D4 Data Bit 4 GPIO 13 (Pin 33)

D5 Data Bit 5 GPIO 6 (Pin 31)

D6 Data Bit 6 GPIO 5 (Pin 29)

D7 Data Bit 7 GPIO 11 (Pin 23)


LCD Pin Function Raspberry Pi GPIO Pin

A (LED+) Backlight + +5V

K (LED-) Backlight - GND

Note: This uses 4-bit communication to reduce GPIO usage.

Working:

• LCD works using control pins (RS, RW, E) and data pins (D4-D7 for 4-bit mode).

• You can use libraries like RPLCD or gpiozero in Python to send data/commands to the
LCD.

• The RS pin distinguishes between commands (RS=0) and data (RS=1).

• The Enable (E) pin triggers data latching on the LCD.

b) i) Difference between Microcontroller and SBC (Single Board Computer) [3 marks]

Feature Microcontroller (e.g., ATmega328) SBC (e.g., Raspberry Pi)

Architecture Simple, low-power embedded chip Full computer on a board

Operating System Usually none (bare-metal or RTOS) Runs OS like Linux or Windows

Applications Real-time control (robots, sensors) Complex tasks (AI, media, IoT)

b) ii) Parameters of ARM11JZF-S [2 marks]

The ARM1176JZF-S processor is part of the ARM11 family and was used in devices like the
Raspberry Pi 1.

Key Parameters:

• Architecture: ARMv6

• Core: ARM1176JZF-S

• Clock Speed: Up to 1 GHz (typically 700 MHz in Pi 1)

• MMU: Yes (Memory Management Unit)

• Cache: 16KB instruction + 16KB data (L1)


• FPU: VFPv2 (Vector Floating Point)

• Jazelle DBX: Supports Java bytecode execution

• Pipeline: 8-stage

• NEON: Not supported

a) Five I/O Functions Used in Python Programming to Interface Hardware

When interfacing hardware (like sensors, actuators, etc.) in Python—especially in


embedded systems like Raspberry Pi, Arduino (via PyFirmata), or microcontrollers
running MicroPython—various I/O functions are used. Here are five important ones:

1. GPIO.setup()

o Library: RPi.GPIO (Raspberry Pi)

o Purpose: Configures a GPIO pin as input or output.

o Example: GPIO.setup(18, GPIO.OUT)

o Use Case: To set pin 18 as an output pin for controlling an LED or relay.

2. GPIO.output()

o Library: RPi.GPIO

o Purpose: Sends a HIGH or LOW signal to an output pin.

o Example: GPIO.output(18, GPIO.HIGH)

o Use Case: To turn on an LED connected to pin 18.

3. GPIO.input()

o Library: RPi.GPIO

o Purpose: Reads the status (HIGH or LOW) of an input pin.

o Example: val = GPIO.input(17)

o Use Case: To read a button press or sensor value.

4. analogRead() (in MicroPython or Arduino-like boards)

o Library: Machine or PyFirmata

o Purpose: Reads analog value from a pin.


o Example (MicroPython): adc.read()

o Use Case: To read values from analog sensors like temperature or light sensors.

5. serial.read() / serial.write()

o Library: pySerial

o Purpose: Reads from or writes data to serial ports (UART communication).

o Example:

o ser = serial.Serial('/dev/ttyUSB0', 9600)

o ser.write(b'Hello')

o data = ser.read(5)

o Use Case: To communicate with serial devices like GSM modules, GPS, or Arduino
boards.

b) Block Diagram and Explanation of an Embedded System

Here’s a standard block diagram of an embedded system:

+----------------------+

| Input Devices |

| (Sensors, Switches) |

+----------+-----------+

+-------------------+

| Embedded Processor| <----> Memory (ROM/RAM)

| (Microcontroller/ |

| Microprocessor) |

+-------------------+

|
v

+----------------------+

| Output Devices |

| (Display, Motor, etc)|

+----------------------+

^ |

| v

Communication Interfaces (UART, SPI, I2C, USB, etc)

Explanation of Each Block:

1. Input Devices:

o Devices like sensors (temperature, proximity), buttons, or switches.

o Provide data or user interaction to the embedded system.

2. Embedded Processor:

o The core of the system (e.g., microcontroller like STM32, Arduino, or


microprocessor like Raspberry Pi).

o Executes the firmware and handles I/O, processing, and communication.

3. Memory:

o ROM: Stores firmware or program code.

o RAM: Temporary storage for data during execution.

4. Output Devices:

o Actuators (motors, relays), displays (LCD, LED), or indicators.

o The system controls these based on logic and input data.

5. Communication Interfaces:

o Used to connect with other devices or networks.

o Includes protocols like UART, SPI, I2C, CAN, or USB


a) Embedded System

An embedded system is a dedicated computer system designed to perform one


or a few specific tasks, often with real-time computing constraints. It is typically
embedded as part of a larger device (like a washing machine, car, or medical
device) and includes hardware and software tightly integrated for specific
functionality.

b) Network Access Devices of SBCs (Single Board Computers)

Network access devices in SBCs (like Raspberry Pi, BeagleBone, etc.) refer to
hardware interfaces and components that enable internet or LAN connectivity,
such as:

• Ethernet ports

• Wi-Fi modules/chips

• Bluetooth modules

• Cellular (4G/5G) modems via USB or GPIO

c) DMA Controller (Direct Memory Access)

A DMA controller allows peripherals (like audio cards or disk drives) to transfer
data to/from memory without CPU intervention. This improves efficiency and
speeds up data transfer by bypassing the CPU for memory operations.

d) Digital Signal Processor (DSP)

A DSP is a specialized microprocessor optimized for high-speed numeric


calculations, particularly for real-time processing of signals like audio, video, and
radar. It’s used in applications like voice recognition, image processing, and
telecommunications.

e) Time Function in Python

Python’s time module provides time-related functions. A common one is:


import time

print(time.time()) # Returns current time in seconds since the epoch

print(time.sleep(1)) # Delays execution for 1 second

Other functions include time.ctime(), time.localtime(), and time.perf_counter()


for benchmarking.

f) Bluetooth Module

A Bluetooth module is a hardware component that enables wireless


communication over short distances using Bluetooth protocol. Popular modules
include:

• HC-05/HC-06: Used in Arduino and embedded systems

• BLE modules: Like Nordic nRF52 for low-energy applications

They are commonly used for wireless control, data transfer, or IoT
communication.

a) What is the Library Function?

Library Function:
A library function is a pre-written, pre-compiled routine or set of routines
provided by a programming language's standard or external libraries. These
functions can be used to perform common tasks like mathematical operations,
input/output handling, data manipulation, hardware control, etc., so that the
programmer doesn't have to write the code from scratch.

Uses of Specific Library Functions:

i) GPIO.cleanup()

• Use: This is a function in the RPi.GPIO library used in Raspberry Pi programming.

• Purpose: It resets the status of all GPIO (General Purpose Input Output) pins used in a
program. It’s essential to call this at the end of a program to avoid pin conflicts in future
programs.
ii) ord(x)

• Use: This is a built-in Python function.

• Purpose: It returns the Unicode (ASCII) integer value of a given character x.

o Example: ord('A') returns 65.

iii) frozenset(s)

• Use: A built-in Python function.

• Purpose: It returns an immutable (unchangeable) version of a set, which can be used as


a dictionary key or stored in other sets.

o Example: frozenset([1, 2, 3]) returns a frozen (read-only) set {1, 2, 3}.

b) Basic Working Principle of a Fingerprint Sensor:

A fingerprint sensor captures the pattern of ridges and valleys on a finger. Here's
how it works:

1. Image Capture: The sensor captures a digital image of the fingerprint using optical,
capacitive, or ultrasonic methods.

2. Feature Extraction: The system extracts unique features from the fingerprint image,
such as ridge endings and bifurcations.

3. Matching: These features are compared against stored templates in the database for
authentication or identification.

Three Features of a Fingerprint Sensor:

1. High Accuracy: It offers reliable identification due to the uniqueness of fingerprints.

2. Security: Fingerprint data is difficult to forge, enhancing security.

3. Fast Authentication: Offers quick user recognition and access.

a) Functional Blocks of SoC (System on Chip)

A System on Chip (SoC) integrates all components of a computer or electronic


system into a single chip. It typically contains:
Functional Blocks of SoC:

1. Processor Cores (CPU/GPU):

o Performs computations and controls tasks.

o Could be ARM, RISC-V, or other types.

2. Memory:

o Includes ROM, RAM, and Cache.

o Stores data and instructions.

3. Input/Output Interfaces:

o Interfaces like UART, USB, SPI, I2C for communication with peripherals.

4. Timers/Counters:

o Used for generating delays, managing time-sensitive operations.

5. Power Management Unit (PMU):

o Regulates power usage to save energy.

6. Interconnects/Buses:

o Facilitates communication between components (e.g., AMBA bus).

7. Digital Signal Processor (DSP):

o Used for audio, video, and signal processing tasks.

8. Peripheral Controllers:

o Controls hardware like camera, display, audio, etc.

9. Security Engine:

o Provides encryption, decryption, and secure boot features.

10. Analog Interfaces (ADC/DAC):

• Converts signals between digital and analog forms.

Diagram of SoC Functional Blocks

Would you like me to fetch a neat diagram for SoC architecture from the web?
b) Bitwise Operators in Python (Any Four)

1. & – Bitwise AND

2. | – Bitwise OR

3. ^ – Bitwise XOR

4. ~ – Bitwise NOT

Python Program to Subtract Two Numbers

# Program to subtract two numbers

# Input two numbers

num1 = float(input("Enter first number: "))

num2 = float(input("Enter second number: "))

# Subtract numbers

result = num1 - num2

# Output the result

print("The result of subtraction is:", result)

Sure! Let’s break it into parts.

a) Difference between Microcontroller and Single Board Computer (SBC)

Single Board
Feature Microcontroller
Computer (SBC)

Definition A compact A complete


integrated circuit computer built
Single Board
Feature Microcontroller
Computer (SBC)

with CPU, RAM, on a single


ROM, and I/O on a circuit board
single chip. with CPU, RAM,
storage, and
I/O.

ATmega328 (used Raspberry Pi,


Examples in Arduino), BeagleBone,
STM32 Jetson Nano

Typically does not Runs full OS


Operating
run an OS (bare- (e.g., Linux,
System
metal or RTOS) Windows IoT)

Power Moderate to
Very low
Consumption high

More complex,
Simpler, meant for
Complexity suitable for
specific tasks
multitasking

Embedded Robotics, media


Usage systems, sensors, centers,
real-time control education, etc.

b) Interfacing LED to GPIO23 of Raspberry Pi

Circuit Diagram Description:

Components Needed:

• 1x Raspberry Pi (any model with GPIO23)

• 1x LED (e.g., red LED)

• 1x Resistor (220Ω recommended)

• Jumper wires
• Breadboard

Circuit Connections:

• Connect GPIO23 (Pin 16) of Raspberry Pi to one end of the resistor.

• Connect the other end of the resistor to the anode (+) of the LED.

• Connect the cathode (−) of the LED to GND (e.g., Pin 6) on Raspberry Pi.

Would you like a visual diagram of this?

Python Program to Blink LED on GPIO23

import RPi.GPIO as GPIO

import time

# Set up GPIO mode

GPIO.setmode(GPIO.BCM) # Use BCM pin numbering

LED_PIN = 23 # GPIO23

# Set up GPIO pin as output

GPIO.setup(LED_PIN, GPIO.OUT)

# Blink LED

try:

while True:

GPIO.output(LED_PIN, GPIO.HIGH) # LED ON

time.sleep(1) # Wait 1 second

GPIO.output(LED_PIN, GPIO.LOW) # LED OFF

time.sleep(1) # Wait 1 second


except KeyboardInterrupt:

print("Program stopped by user")

finally:

GPIO.cleanup() # Reset GPIO settings

You might also like