Raspberry-PI project
Khaled BEN NACEF
Purpose
• The purpose of this project (STEP1) is to drive Raspberry pi -1- board by another
raspberry pi -2- through local host, Ethernet cable
Get stream video from camera plugged on Pi -1-
Display the streamed video on Connected monitor on Raspberry -2-
Raspberry -2- drive the relays connected to Raspberry -1-
2
Raspberry PI characterizations
• Raspberry PI 3B+
Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
1GB RAM
BCM43438 wireless LAN and Bluetooth Low Energy (BLE) on board
100 Base Ethernet
40-pin extended GPIO
4 USB 2 ports
4 Pole stereo output and composite video port
Full size HDMI
CSI camera port for connecting a Raspberry Pi camera
DSI display port for connecting a Raspberry Pi touchscreen display
Micro SD port for loading your operating system and storing data
Upgraded switched Micro USB power source up to 2.5A
3
STM32F469-DISCO characterizations
• STM32F469NIH6 microcontroller with 2 Mbytes of Flash
memory and 324 Kbytes of RAM, in BGA216 package
• 4-inch 800x480 pixel TFT color LCD with MIPI DSISM
interface and capacitive touch screen • USB OTG FS • SAI
audio DAC
• Board connectors: – microSD™ card – USB with Micro-AB –
Stereo headphone output jack – I2C expansion connector –
ARDUINO® Uno V3 expansion connectors – 2.54 mm pitch
expansion connector
• Flexible power-supply options: ST-LINK, USB VBUS or
external sources
• Comprehensive free software libraries and examples
available with the STM32Cube MCU Package
4
16-Channel 12V Relay Module
• This is a 12V 16-Channel Relay interface board, Be able to control various appliances, and other equipment
with large current. It can be controlled directly by Micro-controller (Raspberry Pi, Arduino , 8051, AVR, PIC,
DSP, ARM, ARM, MSP430, TTL logic) .
5
Block diagram
Monitor
16 channels Relay
module
RJ45 cable
STM32F469-DISCO Pi2 Pi1 Pi-Camera
6
Block diagram
RJ45 Cable
HDMI Cable
7
Power
• 16 relays module: output 12V-DC / 1A
• RaspberryPI: USB charger
• STM32F469: USB charger
8
Ethernet connection /Static IP address
• A static IP need to be configured in each Raspberry pi board:
Under « /etc/ » update the configuration in /dhcpcd.conf file as following:
For the server
interface eth0
static ip_address=192.168.0.2/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
For the client
interface eth0
static ip_address=192.168.0.3/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
9
STM32F469-DISCO: Software
• Embedded C used for app development
Touch the button to
• STemWin graphical stack used to create the UI disable the relay
All relays are
enabled
Used GPIO to drive the
channels:
PA1, PA2, PA6, PA7
PB1, PB14, PB15
PC2, PC3, PC4
PG9, PG10, PG11, PG12
PG13, PG14
10
GPIOs in Pi-1
The GPIOs highlighted are used/connected to
STM32F469-DISCO board to drive the 16 channels in
Relay module connected to Pi-2
PA1 GPIO4
PA2 GPIO17
PA6 GPIO27
PA7 GPIO22
PB1 GPIO5
PB14 GPIO6
PB15 GPIO13
PC2 GPIO19
PC3 GPIO26
PC4 GPIO18
PG9 GPIO23
PG10 GPIO24
PG11 GPIO25
PG12 GPIO12
PG13 GPIO16
PG14 GPIO20 11
GPIOs in Pi-2
Pullup is needed for each pin to
Drive the channels (5V instead of The GPIOs highlighted are used/connected to
Provided 3.3V for each pin) STM32F469-DISCO board to drive the 16 channels in
Relay module connected to Pi-2
Channel1 GPIO4
Channel2 GPIO17
Channel3 GPIO27
Channel4 GPIO22
Channel5 GPIO5
Channel6 GPIO6
Channel7 GPIO13
Channel8 GPIO19
Channel9 GPIO26
Channel10 GPIO18
Channel11 GPIO23
Channel12 GPIO24
Channel13 GPIO25
Channel14 GPIO12
Channel15 GPIO16
Channel16 GPIO20 12
Client side
• Camera enabled and buffering launched using the following command line:
Raspivid -t 0 -l -o tcp://0.0.0.0:3333
Launched locally (IP: 0.0.0.0) and with port « 3333 »
Script shell located under « rc.local » to be launched at PI-2 boot (under /etc)
13
Server Side
• Two thread executed:
• First thread to manage the camera streaming using OMXPlayer
URL: omxplayer tcp://192.168.0.3:3333 Client IP address
• Second thread to manage the signal send to the second PI.
gpioZero library used to remote the pins in the client PI.
Python script located under « rc.local » to be launched at PI-1 boot. (under /etc)
14
Thank you
© STMicroelectronics - All rights reserved.
ST logo is a trademark or a registered trademark of STMicroelectronics International NV or its affiliates in the EU and/or other countries.
For additional information about ST trademarks, please refer to www.st.com/trademarks.
All other product or service names are the property of their respective owners.
For further support in creating a
PowerPoint presentation, including
graphic assets, formatting tools and
additional information on the ST brand
you can visit the ST Brand Portal
https://brandportal.st.com
16