Raspberry Pi KKKL 3234 System Design (Rekabentuk Sistem)
Transcription
Raspberry Pi KKKL 3234 System Design (Rekabentuk Sistem)
KKKL 3234 System Design (Rekabentuk Sistem) Raspberry Pi Anuar Mikdad Muad ([email protected]) Department of Electrical, Electronic and Systems Engineering, Faculty of Engineering and Built Environment, Universiti Kebangsaan Malaysia, 43600 UKM Bangi, Selangor, MALAYSIA. Raspberry Pi • • • • • • Small computer (~ size of a credit card). Cheap HD quality video (can even play 3D games) ARM processor. Linux Python, C, C++. Anuar M. Muad, Universiti Kebangsaan Malaysia 2 Hardware Anuar M. Muad, Universiti Kebangsaan Malaysia 3 Model A & Model B Anuar M. Muad, Universiti Kebangsaan Malaysia 4 General Purpose Input Output (GPIO) GPIO ports are low powered. So, an expansion board is needed to provide high powered signals to drive lamps, buzzers, motors, etc. Anuar M. Muad, Universiti Kebangsaan Malaysia 5 Raspberry Pi Model B 512mb RAM Raspberry Pi Model A+ Raspberry Pi Model B+ Raspberry Pi Model B+ Component CPU GPU Memory Specification 700 MHz ARM (ARM11 family, ARM v6 instruction set) Broadcom VideoCore IV @250MHz 512 MB SDRAM (shared with GPU – the limit of memory used by GPU can be set using raspi –config utility. USB 2.0 ports 4 Video output HDMI, composite video (PAL and NTSC) via 3.5 mm TRRS jack shared with audio out Analog Analog via 3.5 mm phone jack; digital via HDMI port output Onboard microSD storage Networking 10/100 Mbit/s Fast Ethernet, no onboard Wi-Fi or Bluetooth Power 600 mA (3 W), 5 V GPIO 40 pins HDMI DVI-D VGA SCART RCA NOOBS Setup • NOOBS (New Out Of the Box Software) • Operating system install manager for the Raspberry Pi. * For beginners Other Operating System • • • • • • RASPBIAN SNAPPY UBUNTU CORE OPENLEC RASPBMC PIDORA RISC OS * For advanced users Raspberry Pi Model B+ 40 pins 26 digital I/O UART, I2C, SPI GPIO in Python Analog Input MCP3008 8-channel 10 bit ADC with SPI SPI data pins: DOUT, CLK, DIN, CS Sensors Round Force-Sensitive Resistor (FSR) • Detect physical pressure, squeezing, & weight. • Cheap. • When pressed, resistive values change. • Not so accurate. Temp oC = 100*(reading in V)-50 TMP36 – Analog temperature sensor Reading analog sensor Reading analog sensor using MCP3008 Interfacing • 1-wire interface • I2C interface • SPI interface I2C Interface SPI Interface • Enabling SPI interace on the Raspberry Pi • Analogue Sensors using MCP3008 Enabling SPI interface on the Raspberry Pi PINs 19, 21, 23, 24, & 26 sudo raspi-config sudo reboot References 1. http://www.raspberrypi.org/ I/O Interface Current sourcing Current sinking LED Interface LED 2V VO 2 V R 10 mA 5 VO 2 V 10 mA 330 Connecting LED in a current source mode Connecting LED in a current sink mode Relay Interface Driving an inductive load Driving a mains bulb using a relay Button input Active low-button input Active high-button input Transistor input Transistor input Microcontroller Power Source Basic Hardware Setup Simple flashing LED MikroC library Turning odd numbered LEDs 7 Segment LED 7 Segment LED Pseudo-code Programme Liquid Crystal Display (LCD) HD44780 LCD Analog input with LCD display Pseudo-code Universal asynchronous receiver transmitter (UART) Sending character “A” in serial communication In ASCII, A = 01000001 9-way and 25-way RS232 connectors Universal asynchronous receiver transmitter (UART) Connecting Microcontroller to PC Universal synchronous asynchronous receiver transmitter (USART) Pseudo-code HyperTerminal Instrumentation Amplifier Interface Power Outputs Interface Motor Interface Speed & position control Electronic Control of DC motor Pulse width modulation (PWM) of a DC motor PWM velocity feedback control PWM voltage and motor current H-bridge drive for DC motor DC motor position and speed control Servomotor Digital Position Control System Motivation The current health care system is faced with several challenges: • • • • Lack of professional health care personnel Insufficient training of medical professionals Early retirement of senior doctors (and subsequent loss of expertise) Aging population Pulse Oximeter using microcontroller *PPG = Photoplethysmogram Electronic Tongue for monitoring drinking waters Multi-electrode PIC16F877A C based multiple DC motors controller SLAVE MASTER INTERRUPT IN SLAVE PWM method H-Bridge Two motors run simultaneously at 700 RPM for 30 sec without load. Two motors run simultaneously without any sudden load for 25 sec but at different speeds, motor 1 runs at 650 RPM and motor 2 runs at 1050 RPM. Two motors run simultaneously without any sudden load for 123 sec at different speeds and sudden loads. Motor 1 runs with speed 850 RPM with sudden load at 76 sec and load removal at 110 sec. Motor2 runs with speed 900 RPM with sudden load at 40 sec and load removal at 100 sec. Body Sensor Network Wireless ECG sensor ECG strap SpO2 (oxygen Processing saturation) unit sensor