CET 4711 Lab 1 Digital Output Control PDF

Title CET 4711 Lab 1 Digital Output Control
Course Computer Controlled Systems Design I
Institution New York City College of Technology
Pages 14
File Size 519 KB
File Type PDF
Total Downloads 33
Total Views 153

Summary

This is a lab report for CET 4711-Computer Controlled System Design with Professors Farrukh Zia from Fall 2021...


Description

Computer Engineering Technology Department CET 4711 – Computer Controlled System Design Year & Semester: 2021 Summer Instructor Name: Professor F. Zia

Lab Report Lab# and Title: 1 Digital Output Control Date: 09/17/21 Student Name: Lab Partner Name:

Table of Contents: 1. 2. 3. 4. 5. 6. 7. 8. 9.

Objective Component List Diagrams Procedure Tests and Measurements Troubleshooting Source Code Discussion Conclusion

Page 2 of 14

Lab# and Title: 1. Objective: The objective of this lab is to familiarize ourselves with the basics of Arduino and our microcontroller. It also gives us the opportunity to use and understand certain basic commands such as the Serial command, digitalwrite and pinmode.

2. Component / Equipment List: 1 Arduino Microcontroller 1 Breadboard ~ Wires 3 Leds 3 330-Ohm resistors

Page 3 of 14

3. Diagrams: 

Hardware: (Schematic diagram / Block diagram)

Page 4 of 14



Software: (UML activity diagram (flow chart) / Data-flow diagram / State diagram)

Page 5 of 14

start / power-on / reset

#include libraries #define pin names declare classes & objects declare global variables

setup ( ) configure hardware and I/O pins configure data comm (Serial / UART) code that runs only once

loop ( ) read sensor input (data input) save sensor value(s) (data storage) process sensor value (data processing) control output device (data output) print / plot values on PC (data comm)

Page 6 of 14

4. Procedure:      

First thing, was to wire the circuit as presented by the schematic diagram. Then run the sample code called “blink.” Once the original code runs with the circuit, then place the additional LEDs. Modify the original code to include the added LEDs. Once everything runs smoothly, the lab is completed. The code can then be further modified for amusement or just practice.

5. Tests and Measurements: (Add captions to all screen shots, pictures and diagrams)



Electrical/Functional tests (Use a multimeter or simulation software to show how the subsystem component(s) can be tested for correct operation)



Serial Monitor data values

Page 7 of 14



Serial Plotter / Oscilloscope screen shots and measurements

Page 8 of 14

6. Troubleshooting: N/A No problems were encountered in this lab 

Symptoms of the problem:



Hardware and/or software test performed to determine the cause of the problem:



Solution to fix the problem:

Page 9 of 14

7. Source code:   

(Final version of the modified and tested program code) (code must be written by using the code_template.ino file) (code must follow the font, syntax highlight and indentation guidelines in Lab Report Instructions)

/* * Paul Ogoo * CET 4711 Professor Zia Blink Turns an LED on for one second, then off for one second, repeatedly. */ //Pin 11, 12 and 13 has an LED connected on most Arduino //Given names: int led1 = 11; int led2 = 12; int led3 = 13; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); } // the loop function runs over and over again forever void loop() { Serial.begin(9600); // opens serial port, sets data rate to 9600 bps Serial.println("All aboard the Light show."); digitalWrite(led1, HIGH); // turn the LED on (HIGH is the voltage level) digitalWrite(led2, HIGH); digitalWrite(led3, HIGH); delay(1000);

// wait for a second

digitalWrite(led1, LOW); // turn the LED off by making the voltage LOW digitalWrite(led2, LOW); digitalWrite(led3, LOW); delay(1000);

// wait for a second

Page 10 of 14

digitalWrite(led1, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); digitalWrite(led2, HIGH); delay(1000); digitalWrite(led3, HIGH); delay(1000); digitalWrite(led1, LOW); // turn the LED off by making the voltage LOW digitalWrite(led2, LOW); digitalWrite(led3, LOW); delay(500); digitalWrite(led1, HIGH); delay(500); digitalWrite(led1, LOW); delay(500); digitalWrite(led2, HIGH); delay(500); digitalWrite(led2, LOW); delay(500); digitalWrite(led3, HIGH); delay(500); digitalWrite(led3, LOW); delay(500); Serial.println("LIGHTS OUT!!!"); delay(1000); }

Page 11 of 14

8. Discussion: Reference Block Diagram

Following sub-systems of a computer controlled system are involved in this lab exercise. Input sub-system: Physical sensor(s) used:

No physical sensors were used in this lab. Interface circuit:

Three digital output pins: 11, 12, 13. 3 Resistors: R1, R2, R3.

Data Input operation:

pinMode(led1, OUTPUT) pinMode(led2, OUTPUT) pinMode(led3, OUTPUT) digitalWrite(led1, HIGH)

Page 12 of 14

digitalWrite(led1, LOW) digitalWrite(led2, HIGH) digitalWrite(led2, LOW) digitalWrite(led3, HIGH) digitalWrite(led3, LOW)

Data Processing sub-system: Micro-controller: ATmega328P on Arduino board, 16 MHz clock, RISC architecture Arduino Mega 2560 R3 Data Processing operation:

Data Storage operation: Size of FLASH memory used for storing program code (kB): Size of RAM used for storing variables (kB):

Max 253 Global: 0.228 Local: 8

Output sub-system: Output device(s) used:

3 LEDs

Interface circuit:

Digital output pins: 11, 12, 13. Resistors: R1, R2, R3.

Data Output operation:

digitalWrite(led1, HIGH) digitalWrite(led1, LOW) digitalWrite(led2, HIGH)

Page 13 of 14

digitalWrite(led2, LOW) digitalWrite(led3, HIGH) digitalWrite(led3, LOW)

Data Communication sub-system: Communication interface used:

USB Cable

Data Communication operation:

Serial.println(“All aboard the lights show”) Serial.println(“LIGHTS OUT!!!”)

Page 14 of 14

9. Conclusion: 

Following computer controlled system design concepts were learned in this lab exercise. The most important concept presented in this lab is the solution flow of programming, wherein we have to be aware of the flow of our implemented solution as what process leads to what.



Following real life application, example or project that represents a computer controlled system has the same type of input and output sub-systems as implemented in this lab exercise. Some similarities between the real life system example and this lab exercise are described below. This kind of lab can be seen implemented on a large scale at concerts where lights are going on and off. You can also see this on deli lights....


Similar Free PDFs