Ad
Thursday, May 4, 2023
SYBCS: Second SEM: Electronics Practical Slips
A1: Interface and Program Raspberry Pi to Control LED/LED's
1. Draw the circuit diagram.
2. Write an algorithm.
3. Write a program.
Answer:
# import raspberry pi GPIO module
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(4,GPIO.OUT)
while True:
GPIO.output(4,GPIO.HIGH)
time.sleep(3)
GPIO.output(4,GPIO.LOW)
time.sleep(3)
4. Execute the program.
5. Write working principle of LED.
Answer: An LED is made of semi conductor which has a junction called P-N junction. The P-N junction is formed by doping two different types of semiconductor materials, N type (with excess electrons) and P type (with deficient electrons). When voltage is applied to the PN junction, a current flows through it, electrons and holes move towards the junction. The electrons and holes recombine at junction due to which energy is released in form of photons (light).
6. What is RAM size used in Raspberry Pi-3?
Answer: The RAM size used in Raspberry Pi-3 is 1GB.
A2. Interface and Program Raspberry Pi to get feedback from a switch.
1. Draw circuit/block diagram of switch & LED attached to GPIO Pins of Raspberry Pi.
2. Write an algorithm.
3. Write a program.
Answer:
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(17,GPIO.IN,pull_up_down=GPIO.PUD_UP)
GPIO.setup(4,GPIO.OUT)
while True:
button_state=GPIO.input(17)
if button_state==False:
GPIO.output(4,False)
print('Button Pressed...')
while GPIO.input(17)==False:
time.sleep(0.2)
else:
GPIO.output(4,True)
4. Execute the program.
5. What are GPIO pins?
Answer: GPIO is General Purpose Input/Output, which are physical pins used to interface with external electronic circuits and devices. The Raspberry Pi has 40 pins that provide access to it's GPIO interface. Through inputs, they can be used to receive digital data and as outputs they can be used to send signals to other devices.
6. What are different types of switches?
Answer: There are following different types of switches:
1. Toggle switch: It is actuated by a lever or button.
2. Push Button Switch: It is activated when it's pressed an turns off when button is released.
3. Slide switch: It is actuated by moving the lever from one position to another.
4. Rotary switch: It is actuated by rotating a knob or lever.
A3: Interface and Program Raspberry Pi to get temperature from a sensor.
1. Draw the circuit diagram.
2. Write an algorithm.
3. Write a program.
Answer:
sudo pip3 install Adafruit-ADS1x15import time
import Adafruit_AdS1x15
adc=Adafruit_ADS1x15.ADS1115()
GAIN=1
while True:
values=[0]*1
for i in range(1):
values[i]=adc.read_adc(i,gain=GAIN)
temp=values[i]*0.125
temp=temp/10
print('Analog o/p = {0:>6}'.format(*values))
print('Temp. in C ={0:>6}'.format(temp))
time.sleep(2)
4. Execute the program.
5. List different types of temperature sensors.
Answer: Different types of temperature sensors:
1. Thermistor: It measures temperature by measuring changes in resistor.
2. Thermocouple: It measures temperature by generating voltage between two different metals that are joined together.
3. Semiconductor Sensors: These measure temperature using semiconductor material such as silicon or germanium.
6. Give specifications, and parameters of temperature sensors used in this experiment.
Answer: Here we use DHT11 Temperature and Humidity Sensor. The specifications and parameters are :
1. Temperature range: 0 to 50 Degree celcius.
2. Temperature Accuracy: +- 2 Degree celcius.
3. Humidity Range: 20% to 90%
4. Humidity Accuracy: +- 5%
5. Ouput Signal : Digital Signal
A5: Interface and program raspberry pi for motion detection using PIR.
1. Drasw block diagram.
2. Write algorithm.
3. Write a program.
Answer:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(17,GPIO.IN)
GPIO.setup(4,GPIO.OUT)
while True:
button_state=GPIO,input(17)
if button_state==True:
GPIO.output(4,False)
print('Motion Detected...')
while GPIO.input(17)==True:
time.sleep(0.2)
else:
GPIO.output(4,True)
4. Execute the program.
5. On which operating system, does the Raspberry Pi works?
Answer: Raspberry Pi can work on several operating systems like Linux based Raspberry Pi OS, Ubuntu, Windows 10 IoT core, Fedora, etc.
6. Write any five applications of PIR sensor.
Answer: Applications of PIR sensor are:
1. Security Systems : They can be used to turn on recording of security camera when motion is detected.
2. Lighting Control : It can be used to control lighting of homes.
3. Automatic Doors: It can be used to activate automatic doors in office buildings or malls.
4. Home Automation: It can be used to trigger events such as playing music when someone enters the room.
5. Automatic Tap: It can be used to detect presence of person's hand and activate water flow.
B4: Study of Zig-bee
1. Draw block diagram.
2. Write an algorithm.
3. Write program.
Answer: void setup() {
4. Show execution and result.
5. Explain how communication takes place between two zig-bee modules(Transmitter and Receiver).
Answer: Each zigbee module has a unique network address that identifies it on the network. When transmitter module wants to send data to receiver module, it specifies the receiver's network address in the data packet. First the transmitter checks if the channel is clear to send the data, and as the receiver module receives the data packets , it sends an acknowledgement packet back to transmitter module to confirm that data was received successfully. If acknowledgement is not received then transmitter re-transmits the data.
6. Define Protocol? Which IEEE protocol is used in zig-bee communication?
Answer: A protocol is a set of rules and procedures that govern the communication between two or more devices.
In zigbee communication IEEE 802.15.4 standard is the protocol used for zigbee communication.
B5: Study of RFID system
1. Draw block diagram.
2. Write algorithm.
3. Write a program.
Answer:
4. Execute the program.
5. What does RFID stand for?
Answer: RFID stands for Radio Frequency Identification.
6. How many digital Input/Output pins are available on Arduino?
Answer: Arduino Nano has 14 Digital I/O pins.
B7: To study Arduino based LED switching using Bluetooth and Mobile.
1. Draw block diagram.
2. Write algorithm.
3. Write program.
Answer:
4. Execute the program.
5. What is range of Bluetooth (HC-05) Device?
Answer: The Bluetooth HC-05 module has a range of up to 10 meters in open space with no obstacles. But it can vary according to environmental conditions and other factors.
6. How Arduino is different from Raspberry Pi?
Answer: Raspberry Pi is more powerful than arduino which has ability to run full operating systems. On the other hand, arduino is designed for low level control. But the Arduino boards are generally cheaper than raspberry pi boards making them a good choice for simple projects.
B8. Temperature and Humidity sensing using Arduino.
1. Draw block diagram.
2. Write an algorithm.
3. Write a program.
Answer:
4. Execute the program.
5. How many Analog pins are available on Arduino Board ?
Answer: It has 8 analog input pins which are labelled a0 to a7.
6. Explain working principle of DHT 11 sensor.
Answer: It is a low cost digital temperature and humidity sensor. It has a thermistor and capacitive humidity sensor. It detects temperature using the thermistor which detects changes in temperature according to changes in resistance. It also has a capacitive humidity sensor which has a small capacitor whose capacitance changes according to changes in moisture of air. It then communicates its temperature and humidity readings via digital signal.
About Abhishek Dhamdhere
Qna Library Is a Free Online Library of questions and answers where we want to provide all the solutions to problems that students are facing in their studies. Right now we are serving students from maharashtra state board by providing notes or exercise solutions for various academic subjects
No comments:
Post a Comment