4.8 Open Platform (like Raspberry Pi)
4.8 Open Platform (like Raspberry Pi)
1
Main Blocks of Raspberry Pi
2
● Processor: Raspberry Pi uses Broadcom BCM2835 system on chip which is
an ARM processor and Video core Graphics Processing Unit (GPU). It is the
heart of the Raspberry Pi which controls the operations of all the connected
devices and handles all the required computations.
● HDMI: High Definition Multimedia Interface is used for transmitting video or
digital audio data to a computer monitor or to digital TV. This HDMI port
helps Raspberry Pi to connect its signals to any digital device such as a
monitor digital TV or display through an HDMI cable.
● GPIO ports: General Purpose Input Output ports are available on Raspberry
Pi which allows the user to interface various I/P devices.
● Audio output: An audio connector is available for connecting audio output
devices such as headphones and speakers.
3
● USB ports: This is a common port available for various peripherals such as a
mouse, keyboard, or any other I/P device. With the help of a USB port, the system
can be expanded by connecting more peripherals.
● SD card: The SD card slot is available on Raspberry Pi. An SD card with an
operating system installed is required for booting the device.
● Ethernet: The ethernet connector allows access to the wired network, it is
available only on the model B of Raspberry Pi.
● Power supply: A micro USB power connector is available onto which a 5V power
supply can be connected.
● Camera module: Camera Serial Interface (CSI) connects the Broadcom
processor to the Pi camera.
● Display: Display Serial Interface (DSI) is used for connecting LCD to Raspberry Pi
using 15 15-pin ribbon cables. DSI provides a high-resolution display interface
that is specifically used for sending video data. 4
PROGRAM TEMPERATURE SENSOR (LM35)
from machine import Pin
import time
conversion_factor = 3.3/(65536)
adc2= machine.ADC(27)
while True:
val2 = adc2.read_u16()
print("===============================")
print("temperature: ",temp)
time.sleep(0.8)
5
PROGRAM: Potentiometer
from machine import Pin
import utime
POT_Value = machine.ADC(28)
conversion_factor = 3.3/(65535)
while True:
#print(POT_Value.read_u16() )
print(POT_Value.read_u16() * conversion_factor)
utime.sleep(1)
6
Program: Relay
from machine import Pin
import time
l= Pin(2, Pin.OUT)
while True:
Relay.value(0)
7
l.on()
l1.off()
time.sleep(0.1)
Relay.value(1)
l1.on()
l.off()
time.sleep(0.1)