1 / 49

Data Acquisition System using MATLAB & PIC Microcontrollers

United Arab Emirates University College of Engineering Training & Graduation Projects Unit. Data Acquisition System using MATLAB & PIC Microcontrollers. Students’ Name: Suad Abdullah 200200301

adolph
Download Presentation

Data Acquisition System using MATLAB & PIC Microcontrollers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. United Arab Emirates University College of Engineering Training & Graduation Projects Unit Data Acquisition System using MATLAB & PIC Microcontrollers Students’ Name: Suad Abdullah 200200301 Ghada M. Ali 200202023 Muzoun AlMulla 200220677 Sara Saleh 200202209 Supervised by: Dr.Ali Assi Graduation Project II

  2. Objectives • Development and design of a Data Acquisition (DAQ) System using MATLAB tool environment. • Voltage, current, temperature and light will be sensed using appropriate sensors. • The PIC microcontroller will be programmed in order to acquire the data from sensors and convert it from analog to digital using A/D converter (built in). • The PIC microcontroller will send the data to a PC using serial port_ RS-232. The data will be processed and plotted using MATLAB tool. 2

  3. Implanted Solar Cell in Jimi Campus

  4. Gant Chart (GPI)

  5. Gant Chart (GPII)

  6. Experiments with the PIC • Experiment 1: Explore the function of the built in Analog to Digital converter of the PIC. • Experiment 2: Data communication between two PCs using the serial ports. • Experiment 3:Modifying the code of the PIC program. • Experiment 4: Writing the MATLAB code for acquiring voltage data from the solar cells.

  7. Experiments with the PIC. • Experiment 5: Writing the MATLAB code for acquiring temperature data from the solar cells using the LM-35 (temperature sensor). • Experiment 6: Designing the GUI interface in MATLAB. • Experiment 7: Final PBP code for acquiring and transmitting voltage, temperature and light data.

  8. PIC Microcontroller • The name PIC stands for : • Peripheral Interface Controller • Programmable Intelligent Computer • The meaning of PIC Microcontroller: • A processor with built in memory and RAM and you can use it to control your projects.  So it saves you building a circuit that has separate external RAM, ROM and peripheral chips.

  9. Block Diagram 9

  10. The PIC16F877 Microcontroller PIC16F877 was chosen because of several reasons: • 1. It is the ideal solution for use as a standard controller in many applications. • 2. It is available in the laboratories of United Arab Emirates University and lab engineers are familiar with such controller.

  11. The PIC16F877 Microcontroller PIC16F877 Microcontroller includes : (1) 8kb of internal flash Program Memory. (2) A large RAM area and an internal EEPROM. (3) An 8-channel 10-bit A/D converter.

  12. Hardware of the PIC16F877

  13. PicBasic Compiler • Makes it even quicker and easier to program PICmicro microcontrollers. • The English-like BASIC language is much easier to read and write than the original Microchip assembly language. • The PicBasic Pro Compiler is “BASIC Stamp II like” and has most of the libraries and functions of both the BASIC Stamp I and II. • programs execute much faster and may be longer than their Stamp equivalents.

  14. Programming the PIC PBP Compiler Using CDL Executed by Source File Flash.pbp Compile Using CDL Connect Melabs U2 Programmer The PIC programmed Flash.ASM and Flash.HEX

  15. The equipments used for Programming the PIC microcontroller. The ZIF Adaptor The melab U2 programmer Connecting melabs U2 programmer to the ZIF Adapter

  16. Experiment 1: Explore the function of the built in Analog to Digital converter of the PIC. What is A/D converter? It is an electronic device that converts an analog voltage (or current) to a digital form. The PIC16F877 has: 10 bit A/D Module 8Channels

  17. Circuit Implementation for the Analog to Digital Conversion.

  18. MATLAB Code for the Analog to Digital Conversion 18

  19. MATLAB Code for the Analog to Digital Conversion Set number of bits of the result (8, 10 or 12) Set the clock source Set the sampling time in microseconds Define Pin 0 of Port B as a BYTE

  20. MATLAB Code for the Analog to Digital Conversion Set Port A to all input PORTA is analog Read channel 0 to B0 Set Port B to all as output

  21. Prototype of the A/D converter Circuit. 11111111= “255” 00000101=“5” • Conversion of a analog value “5” to digital “00000101” Conversion of a analog value “255” to digital “11111111”

  22. Experiment 2: Data communication between two PCs using the serial ports. Block diagram of the serial communication.

  23. Serial Communication via RS-232 • Serial communication is the most common low-level protocol for communicating between two or more devices. Modem Printer Computer Scientific Instrument (Oscilloscope or Function Generator) Computer

  24. Serial port RS-232 • Three pins are used for communications: • One for receiving data • One for transmitting data • One for the signal ground.

  25. Connection of MAX 232 and the serial communication port.

  26. MAX 232 chip When communicating with various micro processors one needs to convert the RS232 levels down to lower levels, typically 3.3 or 5.0 Volts.

  27. Connected pins between serial port and the MAX-232. • Pin 11 from MAX232 was connected to pin 26 in PIC16F877 in order to transmit the data from the PIC microcontroller to the MAX232. • Pin 16 was connected to the +5V power supply and Pin 15 was connected to the ground. • Female 9 pin was connected to pins 14 and 13 respectively so it can provide 2 channels for the RS232 cable .

  28. Schematic diagram for the serial communications experiment

  29. Code of the Serial Communication

  30. Hyper terminal setting and output results.

  31. The implemented circuit and the serial communication result that appeared on the hyper terminal.

  32. Experiment 3:Modifying the code of the PIC program. • The difference between SEROUT and SEROUT2 command is SEROUT2 can set the parameter more than SEROUT command such as data format, transmit format and baudrate. Changed to SEROUT2 function

  33. Results after modifying the PIC program.

  34. Experiment 4: Writing the MATLAB code for acquiring voltage data from the solar cells.

  35. Out put results (Acquired Voltage data)

  36. Experiment 5: Acquiring temperature data from the solar cells using the LM-35 (temperature sensor). The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature.

  37. Features of the LM35 • Guarantee able (at +25°C) • Rated for full -55° to +150°C range • Suitable for remote applications • Low cost • Operates from 4 to 30 volts • Low self-heating•

  38. MATLAB code for acquiring temperatures.

  39. The implemented circuit for acquiring the temperature data . • Lighter was used to make the LM35 work. LM 35

  40. The acquired temperature data(output) as shown and plotted in Matlab.

  41. Light Sensor (Photo Resist). What does light sensor do? • The light sensor is used to detect changes in the amount of light in its surroundings. The output voltage increases as the light level increases.

  42. Light Sensor (Photo Resist). • The animation opposite shows that when the torch is turned on, the resistance of the LDR falls, allowing current to pass through it.

  43. Light Sensor (Photo Resist). Photo resist (light sensor)

  44. Experiment 6: Designing the GUI interface in MATLAB. • GUI interface was implemented in order to plot the measurements of voltage, temperature and light. The GUI interface.

  45. Results of the Data Acquisition System using MATLA & PIC Microcontrollers GUI program

  46. Experiment 7: Final PBP code for acquiring and transmitting voltage, temperature and light data.

  47. The Project Prototype.

  48. Conclusion • Environmental Issues. • Clean source of power (Solar) • Cost Issues. • Relatively cheap. • Technical Issues. • Accurate readings and measurements.

  49. Thanks

More Related