07-10-2016, 10:55 AM
Raspherry PI Based Global Industrial Process Monitoring Through Wireless Communication
1458147980-seminarreportshashieditedcc.docx (Size: 699.98 KB / Downloads: 7)
INTRODUCTION
The entire system is designed with the double layer SMD based embedded board with different sensors and a raspberry pi that can compile and communicate the data received from the sensors. The raspberry pi when operated on the Linux operating system can perform multi -tasking. The design of the embed board includes the interfacing of different sensors to two slave boars and connecting those slave to a master board through RF transmission. The master and slave boards use PIC 18F4550 Microcontroller, Encoder and Decoder ICs (HD12E & HD12D), LM35 & LDR Sensors, Water level sensor(IC CD4066) and RF Transceivers.
The RF transceivers present in slave and master boards uses the process of serial communication and as most of the computers have more than one serial port there is no need of any special hardware other than a cable. The effective baud rate is the main advantage of using RS232 and also the transmission is on both directions which mean the inverted logic is also handled with the same. RS232 uses MARK (negative voltage) and SPACE (positive voltage) as two voltage states. So the baud rate is identical to the maximum number of bits transmitted per second including the control bits. The transmission rate of this device is 9600 baud with
the duration of start bit and each subsequent bit is about 0.104ms. The complete character frame of 11 bits is transmitted in 1.146ms. MAX 232 IC mounted on the master board converts the 0’s and 1’s to TTL logic.
RF module uses Amplitude Shift Keying (ASK) modulation and the frequency range varies between 30 KHz and 300 GHz. The RF module is used in conjunction with a set of four channel encoder (HT12E)/decoder (HT12D) ICs. The Raspberry pi is a low cost credit card sized Linux computer which has the ability to interact with the outside world and has been used in a wide array of digital maker projects. An open source operating system that uses Linux kernel called Debian is used on the embedded Raspberry Pi device in an operating system called Raspberry. Linux kernel has been ported to variety of CPUs which are used not only for computers but also for ARC, ARM, AVR32, ETRAX CRIS, FR – V, H8300, IP7000, m68k, PowerPC, SuperH and Xtensa processors.
A printed circuit board (PCB) uses conductive tracks, pads and other features etched from copper sheets to connect the electronic components laminated onto a non -conductive substrate. Surface – mount technology (SMT) is a technique where the components are placed directly onto the surface of printed circuit boards (PCBs). Both technologies can be used in a combination i.e. the components that cannot be mounted can be used with through hole technology.
In industrial automation, there are different manufactures producing their own PLCs. The PLCs in an industry is connected with distributed control system (DCS) by protocols such as RS232/485, USB and Ethernet. The DCS has multi-level hierarchical network structure for communication. Due to the hierarchical network structure, the communication becomes complex and high in cost. Complete network from field level to control level is not formed. The java simulators can be used as front end panel for monitoring and control. The java servers used to control the process in a field. Internet of Things (IOT) is a fast developing technology that connects all devices with internet.
For soft real time systems TCP, UDP and IP protocols are efficient. Embedded web server and Linux based system is cost effective with high performance. The RS232 protocol is sufficient for parameter monitoring and control. The master slave architecture gives good performance in real time control applications. The graphical language is efficient for development of front end and back end panels for process monitoring and control.
CHAPTER 2
SYSTEM DESCRIPTION
This chapter gives a brief view of a proposed system.The Fig 2a, shows the system that is designed with both wireless slaves and wireless master where the communication is a half-duplex communication. The master module acts a bridge device between slaves and the raspberry pi computer. The master can also communicate with any android devices and compactable with all X86, X64 and ARM architectures that runs any operating system with RS232 functionality. The communication between the master and raspberry pi is wired and the raspberry pi can be operated through remote computing either wired or wireless.
The communication between the master and raspberry pi is wired and the raspberry pi can be operated through remote computing either wired or wireless. The on – field firmware up gradation of master and slave is possible without removing or disconnecting any devices from the module with the help of USB boot loader feature in PIC18F4550 microcontroller.
2.1 Master Module
The Fig 2b, shows the components of master module. Data acquired from slave 1 and slaves 2 are transmitted to the master which is in turn transmitted with the raspberry pi via UART serial communication. The master can also communicate with different platforms that execute serial communication.
The entire module functionality is controlled by the microcontroller. One of the major future enhancements of this master module is the in-built USB to UART converter which can directly communicate with the android devices that have USB -OTG functionality without using any other driver software or hardware.
The raspberry pi processor runs in 3.3V. So the master module has in-built MOSFET based 3.3V to 5V voltage level shifter circuit. No bridging hardware is required as the raspberry pi can directly communicate with the master module. A TTL to RS232 level shifter is used to communicate with any other hardware that accepts RS232 protocol.
2.2 Slave–1 Module
Fig 2.2a. Shows the interfacing of physical parameters like Temperature, Light intensity and Water level identifier in Slave-1 module. Data acquired from each parameter is collected in Slave -1 and sent to Master module through RF transmission. The relay and alarm are also connected to the microcontroller for controlling purpose. The encoder and decoder are responsible for converting parallel data into addressed serial data and vice versa. This serial data is transmitted or received over RF wireless modules.
2.3 Slave-2 Module
The Fig. 2.3a, Shows the interfacing of physical parameters like voltage and current in Slave-2 module. Data acquired from each parameter is collected in Slave -2 and sent to Master through RF transmission. The relay and alarm are also connected to the microcontroller for controlling purpose. The in-built analog to digital (ADC) converter is used to measure the voltage and current. The encoder and decoder serve the same purpose as in the Slave-1.
SOFTWARE SPECIFICATION
The following software tools are required for designing, compiling and debugging.
3.1 MikroC Pro for PIC
MikroC PRO is an ANSI C compiler for PIC devices from Microchip. The main features are intuitive IDE, powerful compiler with advanced optimizations, lots of hardware and software library. Some of the tools that is integrated with this compiler are active comment editor, ASCII chart, EEPROM editor, GLCD bitmap editor, HID terminal, LCD custom character, Mikro boot loader, UDP terminal and USART terminal. Software simulator simulates the code flow in PC and supports all debugging modes s MikroICD [24]
3.2Diptrace
Diptrace is quality schematic capture and PCB design software that is used to create simple and complex multi-layer board from the schematic to the state of ready manufacturing files. Direct3D mode is the fastest mode and so recommended for usage for most typical Windows PC. OpenGL mode is bit slower than Diect3D but it is less dependent on hardware and so it is preferred for different operating systems. [10]
3.3Raspbian operating system
Raspbian is a free operating system based on debian optimized for the raspberry pi hardware. Raspbian comes with over 35,000 packages and pre-compiled software bundled in a nice format for easy installation on Raspberry Pi. Raspbian is still under development to improve stability
4.1 Raspberry Pi Model B+
Raspberry pi is based on the Broadcom BCM2835 system on a chip (SoC) that includes an ARM1176JZF-S 700 MHz processor, VideoCore 4 GPU, and was originally designed with 256 megabytes of RAM and later upgraded to 512 MB. The system has either Secure Digital (SD) or MicroSD sockets for boot media and persistent storage. The other features of raspberry pi model B+ are 700 MHz cloak speed, four individual USB host ports, 10/100 Base T Ethernet port and HDMI audio and video output [25], [26].
4.2 PIC 18F4550
PIC18F4550 is ideal for low power ad connectivity applications because of availability of three serial ports: FS-USB (12 Mbit/s), I²C and SPI (up to 10Mbit/s) and an asynchronous serial port (EUSART). The features of PIC18F4550 microcontroller are 32Kbyte program memory, 2Kbyte data memory, 35 I/O lines, 13 channels 10-Bit analog to digital converter, USB V2.0 complaint, two external clock modes, 8* 8 Single-Cycle hardware multiplier, Single-Supply 5V In-Circuit Serial Programming (ICSP), In-Circuit Debug via two pins and wide operating voltage range (2.0V to 5.5V) [23].
HARDWARE DESCRIPTION
5.1 Master module
Master module is fully equipped with in built peripherals and there is no need of any bridging devices for communicating with raspberry pi or other platform. Module operates in 5 volt and 500mA of current and also circuit has reverse voltage protection for safe operation. 20 MHz of clock frequency is fed as oscillator input to microcontroller.
• FT232R is a USB to serial UART interface with optional clock generator which has asynchronous and synchronous bit bang interface modes [21].
• MAX232 level converter is an IC that converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits [28].
• 3.3V to 5V voltage level shifter is used to connect with the master with raspberry pi as it can operate with a minimum of 3.3V.
The hardware is made by double layer PCB that is fabricated in laboratory by using toner transfer method. The design is done using Diptrace EDA CAD tool and SMD components are used to reduce the hardware size and power consumption.
5.2Slave-1 Module
Slave-1 module uses the same microcontroller configuration as that of the master module. The slave-1 address is manually set using the address switch and the address is also known to the master module by its program.
The main functionality of the Slave-1 module is as follows.
5.2.1 Temperature measurement
The current temperature is converted to an appropriate voltage level using a 3 pin integrated circuit temperature sensor unit (IC LM35DZ). The three pins are ground (GND), voltage source (Vs) and output voltage (V out). Analog to Digital converter (ADC) converts the signal into digital value that is fed as input to the microcontroller. LM35 series is precision integrated circuit temperature sensor whose output voltage can be linearly calibrated in degree Celsius i.e. Linear + 10.0 mV/˚C scale factor with 0.5˚C accuracy guarantee and rated for full -55˚C to +150˚C range. It operates in 4 to 30 volts and draws less than 60 μ.
5.2.2 Light Intensity measurement
A light/dark activated switch that is present in the Slave-1 is used to measure the light level which will turn on and off accordingly. A Light Depended Resistor (LDR) is used to measure the light level. The circuit has a transistor switch with the base connected to a voltage divider. The voltage divider has 50K potentiometer plus the protective resistor and LDR. When the light falls on the surface of LDR, the resistance of the LDR is changed. The more the light, the less the resistance, the less the voltage drop across it and vice versa. As the voltage drop increases, the VB of the BC547 transistor and ICE will also increase.
5.2.3 Water Level identifier
IC CD4066 bilateral switch CMOS IC is used to identify the water level through LEDs. When the water is empty in the tank the circuit is open and 180K resistor pulls the switch to open and so the switches and LEDs are off. When the water begins to fill the first wire is connected to the reservoir in the S1 and the positive supply is shortened by the water. This closes the S1 and turns on the LED1. As the water level increases in the tank, LEDs 2, 3 and 4 are switched on in sequence.
5.3Slave-2 Module
Slave-2 module uses the same microcontroller configuration as that of the master module. The slave-2 address is manually set using the address switch and the address is also known to the master module by its program.
5.4 RF Module
RF module is used for making a wireless remote communication via radio frequency signals. A receiverconfigured for the same frequency as the sender can only receive the signals. Here the operating frequency is 434 MHz.
5.4.1 Encoder IC
HT12E IC is used as the encoder IC that receives the parallel data in the form of address and control bits. The control signals from the remote switches with 8 address bits that constitute a set of 12 parallel signals. The encoder encodes these parallel signals to serial bits. In the encoder IC ground is pin 14 and control signals are given from pin 10-13 and serial data is fed to the transmitter through pin 17. RF transmitter transmits the signal that is fed from the IC to the receiver in a wireless mode.
5.4.2 Decoder IC
HT12D is used as the decoder IC. The receiver sends the signals to decoder IC that retrieves the serial data. When there is no signal received, then the IC remains in the standby mode that consumes very less current for a voltage of 5V. On receiving the signal oscillator of HT12D IC gets activated and decodes the serial data and checks the address bits three times. If these bits match with the local address pins(pins 1 – 8) of HT12D, then data bits are put into the data pins (pins 10 – 13) and makes the VT pin high. The LED connected to the VT pin acts an indicator to indicate a valid transmission. For a successful communication, address bits of encoder and decoder ICs must be identical. By configuring the address bits properly, same RF transmitter can be used to control different RF receivers of the same frequency.
Relay and Alarm Driver Circuit
Relay and alarm driver circuit is a simple transistor switching driver using NPN transistor. Since the relay and alarm consume more power than a microcontroller, driver is essential.
5.6 Firmware Update
USB HID boot loader firmware is a free tool that can be downloaded from microelectronics website. Also no additional OS drivers are required for this firmware update. The five basic steps to boot load the program in PIC 18F4550 are as follows.
• The board is connected to PC and once the device is recognized by the OS the grey USB will turn red which indicates that the USB link is established successfully.
• The connect button is clicked within 5 seconds and the chip enters the boot loader mode.
• The HEX file load is chosen to load the program into the chip after browsing the file using browse for HEX button.
• Boot loader is started by clicking on the begin upload button. THE show activity button can be used to view the boot loader operation.
• Reset chip boot loader firmware will automatically reset the MCU, after which the newly loaded program will start in 5 seconds.
CONCLUSION AND FUTURE WORK
The system can be enhanced for wave form representation of data in an excel sheet using raspberry pi. The additional slaves can be added for measures various other parameters. Also controlling action can be set for some predefined cases in the master module which enables the automatic operation at certain cases. A dedicated video processor can be used in raspberry pi to display graphical and three dimensional view of the industry.