CET 4711 Serial Data Communication and Control
The main objective of the experiment is to implement and analyze bi-directional (full duplex) asynchronous serial data transmission protocol for data communication and control between a micro-controller and personal computer. Also, to learn to use both text based (Serial Monitor) and GUI based (Firmata) methods to: receive and display Arduino sensor values on a PC and control Arduino output devices from a PC 1. Download Lab_#.zip file from Blackboard > Assignments and unzip into a folder on your PC. 2. Study the following reference material: • [1] Arduino Language Reference - Serial Library Functions • [2] Serial Port Complete 2E, Ch. 2 - Formats and Protocols, Sending Serial Data • [3] Practical AVR Microcontrollers - Serial Communication 3. Connect LDR/Light Sensor to Arduino analog input A0. Connect RGB LED to Arduino PWM pins 9,10,11. Part A - Text based measurement and control using Serial Monitor: 4. Upload and run Arduino program (test_data_) given in lab handout on following page (program source code is available in Blackboard > Assignments > Lab_#.zip) 5. Study the given program, understand and observe its correct operation. Sensor values will be displayed in Serial Monitor window. Sending PC keys ‘0’ and ‘1’ keystrokes will control the RGB LED (Pin 9, Red Color). 6. Modify the given program to control other LED colors (Green, Blue) by pressing keys ‘2’, ‘3’ and ‘4’, ‘5’ respectively, on the PC keyboard. Hint: Use additional case statements. Part B - GUI based measurement and control using Firmata: 7. Open Arduino_IDE > File > Examples > Firmata > StandardFirmata example program and upload to Arduino. Note: Take a screen shot of Firmata Test GUI for each of the following steps and include in your report. 8. On the PC, close Serial Monitor window, then double click and run firmata_ application (it is included in Lab_#.zip file). Select the correct Arduino USB/serial COM port in Firmata Test GUI. 9. Observe how the analog LDR/Light sensor value is displayed in Firmata Test GUI. 10. Set pins 9,10,11 mode to OUTPUT. Turn RGB LED colors ON and OFF (digital control) by clicking the buttons. 11. Set pins 9,10,11 mode to PWM. Control RGB LED color brightness (analog control) by moving the slider control.
Written for
- Institution
-
New York City College Of Technology
- Course
-
CET 4711
Document information
- Uploaded on
- October 12, 2022
- Number of pages
- 17
- Written in
- 2022/2023
- Type
- Class notes
- Professor(s)
- Farukh zia
- Contains
- All classes
Subjects
- serial data
- communication
- cet 4711 lab 3
- cet 4711
-
serial data communication and control
-
ldrlight sensor
-
the main objective of the experiment is to implement and analyze bi directional full duplex a