tutorbin

arduino homework help

Boost your journey with 24/7 access to skilled experts, offering unmatched arduino homework help

tutorbin

Trusted by 1.1 M+ Happy Students

Place An Orderand save time
man
phone
  • United States+1
  • United Kingdom+44
  • Afghanistan (‫افغانستان‬‎)+93
  • Albania (Shqipëri)+355
  • Algeria (‫الجزائر‬‎)+213
  • American Samoa+1
  • Andorra+376
  • Angola+244
  • Anguilla+1
  • Antigua and Barbuda+1
  • Argentina+54
  • Armenia (Հայաստան)+374
  • Aruba+297
  • Ascension Island+247
  • Australia+61
  • Austria (Österreich)+43
  • Azerbaijan (Azərbaycan)+994
  • Bahamas+1
  • Bahrain (‫البحرين‬‎)+973
  • Barbados+1
  • Belarus (Беларусь)+375
  • Belgium (België)+32
  • Belize+501
  • Benin (Bénin)+229
  • Bermuda+1
  • Bhutan (འབྲུག)+975
  • Bolivia+591
  • Bosnia and Herzegovina (Босна и Херцеговина)+387
  • Botswana+267
  • Brazil (Brasil)+55
  • British Indian Ocean Territory+246
  • British Virgin Islands+1
  • Brunei+673
  • Bulgaria (България)+359
  • Burkina Faso+226
  • Burundi (Uburundi)+257
  • Cambodia (កម្ពុជា)+855
  • Cameroon (Cameroun)+237
  • Canada+1
  • Cape Verde (Kabu Verdi)+238
  • Caribbean Netherlands+599
  • Cayman Islands+1
  • Central African Republic (République centrafricaine)+236
  • Chad (Tchad)+235
  • Chile+56
  • China (中国)+86
  • Christmas Island+61
  • Cocos (Keeling) Islands+61
  • Colombia+57
  • Comoros (‫جزر القمر‬‎)+269
  • Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)+243
  • Congo (Republic) (Congo-Brazzaville)+242
  • Cook Islands+682
  • Costa Rica+506
  • Côte d’Ivoire+225
  • Croatia (Hrvatska)+385
  • Cuba+53
  • Curaçao+599
  • Cyprus (Κύπρος)+357
  • Czech Republic (Česká republika)+420
  • Denmark (Danmark)+45
  • Djibouti+253
  • Dominica+1
  • Dominican Republic (República Dominicana)+1
  • Ecuador+593
  • Egypt (‫مصر‬‎)+20
  • El Salvador+503
  • Equatorial Guinea (Guinea Ecuatorial)+240
  • Eritrea+291
  • Estonia (Eesti)+372
  • Eswatini+268
  • Ethiopia+251
  • Falkland Islands (Islas Malvinas)+500
  • Faroe Islands (Føroyar)+298
  • Fiji+679
  • Finland (Suomi)+358
  • France+33
  • French Guiana (Guyane française)+594
  • French Polynesia (Polynésie française)+689
  • Gabon+241
  • Gambia+220
  • Georgia (საქართველო)+995
  • Germany (Deutschland)+49
  • Ghana (Gaana)+233
  • Gibraltar+350
  • Greece (Ελλάδα)+30
  • Greenland (Kalaallit Nunaat)+299
  • Grenada+1
  • Guadeloupe+590
  • Guam+1
  • Guatemala+502
  • Guernsey+44
  • Guinea (Guinée)+224
  • Guinea-Bissau (Guiné Bissau)+245
  • Guyana+592
  • Haiti+509
  • Honduras+504
  • Hong Kong (香港)+852
  • Hungary (Magyarország)+36
  • Iceland (Ísland)+354
  • Indonesia+62
  • Iran (‫ایران‬‎)+98
  • Iraq (‫العراق‬‎)+964
  • Ireland+353
  • Isle of Man+44
  • Israel (‫ישראל‬‎)+972
  • Italy (Italia)+39
  • Jamaica+1
  • Japan (日本)+81
  • Jersey+44
  • Jordan (‫الأردن‬‎)+962
  • Kazakhstan (Казахстан)+7
  • Kenya+254
  • Kiribati+686
  • Kosovo+383
  • Kuwait (‫الكويت‬‎)+965
  • Kyrgyzstan (Кыргызстан)+996
  • Laos (ລາວ)+856
  • Latvia (Latvija)+371
  • Lebanon (‫لبنان‬‎)+961
  • Lesotho+266
  • Liberia+231
  • Libya (‫ليبيا‬‎)+218
  • Liechtenstein+423
  • Lithuania (Lietuva)+370
  • Luxembourg+352
  • Macau (澳門)+853
  • North Macedonia (Македонија)+389
  • Madagascar (Madagasikara)+261
  • Malawi+265
  • Malaysia+60
  • Maldives+960
  • Mali+223
  • Malta+356
  • Marshall Islands+692
  • Martinique+596
  • Mauritania (‫موريتانيا‬‎)+222
  • Mauritius (Moris)+230
  • Mayotte+262
  • Mexico (México)+52
  • Micronesia+691
  • Moldova (Republica Moldova)+373
  • Monaco+377
  • Mongolia (Монгол)+976
  • Montenegro (Crna Gora)+382
  • Montserrat+1
  • Morocco (‫المغرب‬‎)+212
  • Mozambique (Moçambique)+258
  • Myanmar (Burma) (မြန်မာ)+95
  • Namibia (Namibië)+264
  • Nauru+674
  • Nepal (नेपाल)+977
  • Netherlands (Nederland)+31
  • New Caledonia (Nouvelle-Calédonie)+687
  • New Zealand+64
  • Nicaragua+505
  • Niger (Nijar)+227
  • Nigeria+234
  • Niue+683
  • Norfolk Island+672
  • North Korea (조선 민주주의 인민 공화국)+850
  • Northern Mariana Islands+1
  • Norway (Norge)+47
  • Oman (‫عُمان‬‎)+968
  • Palau+680
  • Palestine (‫فلسطين‬‎)+970
  • Panama (Panamá)+507
  • Papua New Guinea+675
  • Paraguay+595
  • Peru (Perú)+51
  • Philippines+63
  • Poland (Polska)+48
  • Portugal+351
  • Puerto Rico+1
  • Qatar (‫قطر‬‎)+974
  • Réunion (La Réunion)+262
  • Romania (România)+40
  • Russia (Россия)+7
  • Rwanda+250
  • Saint Barthélemy+590
  • Saint Helena+290
  • Saint Kitts and Nevis+1
  • Saint Lucia+1
  • Saint Martin (Saint-Martin (partie française))+590
  • Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)+508
  • Saint Vincent and the Grenadines+1
  • Samoa+685
  • San Marino+378
  • São Tomé and Príncipe (São Tomé e Príncipe)+239
  • Saudi Arabia (‫المملكة العربية السعودية‬‎)+966
  • Senegal (Sénégal)+221
  • Serbia (Србија)+381
  • Seychelles+248
  • Sierra Leone+232
  • Singapore+65
  • Sint Maarten+1
  • Slovakia (Slovensko)+421
  • Slovenia (Slovenija)+386
  • Solomon Islands+677
  • Somalia (Soomaaliya)+252
  • South Africa+27
  • South Korea (대한민국)+82
  • South Sudan (‫جنوب السودان‬‎)+211
  • Spain (España)+34
  • Sri Lanka (ශ්‍රී ලංකාව)+94
  • Sudan (‫السودان‬‎)+249
  • Suriname+597
  • Svalbard and Jan Mayen+47
  • Sweden (Sverige)+46
  • Switzerland (Schweiz)+41
  • Syria (‫سوريا‬‎)+963
  • Taiwan (台灣)+886
  • Tajikistan+992
  • Tanzania+255
  • Thailand (ไทย)+66
  • Timor-Leste+670
  • Togo+228
  • Tokelau+690
  • Tonga+676
  • Trinidad and Tobago+1
  • Tunisia (‫تونس‬‎)+216
  • Turkey (Türkiye)+90
  • Turkmenistan+993
  • Turks and Caicos Islands+1
  • Tuvalu+688
  • U.S. Virgin Islands+1
  • Uganda+256
  • Ukraine (Україна)+380
  • United Arab Emirates (‫الإمارات العربية المتحدة‬‎)+971
  • United Kingdom+44
  • United States+1
  • Uruguay+598
  • Uzbekistan (Oʻzbekiston)+998
  • Vanuatu+678
  • Vatican City (Città del Vaticano)+39
  • Venezuela+58
  • Vietnam (Việt Nam)+84
  • Wallis and Futuna (Wallis-et-Futuna)+681
  • Western Sahara (‫الصحراء الغربية‬‎)+212
  • Yemen (‫اليمن‬‎)+967
  • Zambia+260
  • Zimbabwe+263
  • Åland Islands+358
*Get instant homework help from top tutors—just a WhatsApp message away. 24/7 support for all your academic needs!

Recently Asked arduino Questions

Expert help when you need it
  • Q1:Q5) What is the Arduino code called and what kind of programming language is it?See Answer
  • Q2:Q1) Describe the analog input pins. How many of these analog pins are in Arduino Uno?See Answer
  • Q3:Q6) Is a potentiometer an analog or a digital sensor? Give another example for the analog sensors and one example for digital sensor? See Answer
  • Q4: COURSE Project (10%) 2022-2023 Digital Signal Processing with Applications EE438 Semester: Spring 2023 Table of Contents I. Introduction ...... II. Project Description.......... III. ABET Learning Outcome IV. Project Management & Deliverables. V. Turnitin.......…... VI. APA Style.... VII. Academic Honesty and Integrity Assurance.. VIII. Copyrights........ IX. Project and team-based work.. X. Marking Scheme ......... XI. Student Assessment Rubric.. 345 6 6 6 7 7 7 8 8 I. Introduction Projects for engineering students give an edge over the race of recruitment to work hard to ensure a good career. In spite of employment practices in recent times, students are progressively taking up projects to pad up their skill-set. Engineering projects help students to learn and acquire practical knowledge. Despite of theory concept they acquire, various industries also need to know their capacity to complete projects using their specific initiatives. Thus, we recommend students to realize engineering projects in their four years of engineering and try to present as many white papers as possible. Students who give importance to their course projects are expected to learn how to: ● Work in teams including multidisciplinary teams Build a major design experience based on the knowledge and skills acquired in the course work Build a major design experience incorporates appropriate engineering standards and multiple realistic constraints Apply both analysis and synthesis in the engineering design process, resulting in designs that meet the desired needs In the design process, both creativity and criticism are essential. The followings are the seven steps that students should consider while designing their projects: Recognition of the need and identifying opportunities: Every project begins with recognition that needs improvement. These needs may be obvious or hidden to be revealed by investigation, surveys or research. Definition of the design problem: It is a major task requires gathering information about the problem. Definition of the design criteria and constraints: While the problem is being defined, the design criteria and constraints must be defined a. Design criteria are performance standards to be met by the design b. Design constraints are limitations placed on the designer, the final design or manufacturing process. Examples of possible constraints include accessibility, aesthetics, codes, constructability, cost, ergonomics, extensibility, functionality, interoperability, legal considerations, maintainability, manufacturability, marketability, policy, regulations, schedule, standards, sustainability, or usability. c. Risk analysis The design loop: design is a repetitive process of: a. Synthesis (Brainstorming - Generating new ideas) b. Analysis (Breaking ideas - find expected results) c. Decision-making (Deciding the best alternative) Optimization: Design team must ask themselves if it is the optimum design. Optimum is the best design that can be achieved at reasonable cost. The proposed design is judged against the design criteria Evaluation: Design team should hold a design review to approve drawings and specifications before they are released. If an optimum design cannot be achieved, the design team might revise the problem definition, the design criteria or the constraints in order to achieve the optimal solution or prototype. II. Project Description Digital signal processing has many real-life applications in. Students can choose one of the following suggested projects for their course project. Student must develop the design to the prototype mainly in his own time, however, some of the office hours and lab times will be set aside to enable you to seek clarification, get more details from your instructors, and receive feedback on your work. The developed system should have the following: The project MUST have a working prototype. The projects should employ, if appropriate, artificial intelligence such as deep learning algorithms to identify/authenticate users. Hardware implementation using Raspberry pi, Arduino or any microcontroller, and any other necessary components related to the selected project. Software part of the project will be developed using Python/SciLab/ MATLAB or any other programming language. Do not diverge from the project specification. If you do not conform to the project specification, you will lose a high share of the project grade. C. d. 1- Activity detection using wearables You have been hired by a company that manufactures wearable motion sensors for activity recognition, particularly tailored to assisting the elderly and recognising unusual behaviour. A wearables sensor unit commonly consists of accelerometers, gyroscopes and magnetometers, which, in combination, can measure an individual's motion. Recently the company has been interested in building wearables systems. You have been assigned the job of designing and implementing a robust wearables sensor unit that can provide tri-axial data from an accelerometer and a gyroscope. The developed prototype should address the following points: a. Construct a simple wearables sensor unit with an accelerometer and a gyroscope b. The sensed motion shall be categorised as one of four activities via a microprocessor Four different activities shall be detected and displayed on a simple display unit All circuit design details should be provided in the project report. 2- Stepper motor control You have been hired by a company that manufactures controllable DC motor systems. Recently the company has been interested in designing a range of highly controllable DC stepper motors, for use in laboratory environments. You have been assigned the job of designing and implementing a PID- controlled stepper motor system. The developed prototype should address the following points: a. A DC stepper motor shall be utilised to adjust the angular position of pointer object |||. b. Precise control of the stepper motor shall be achieved using a microprocessor-based PID controller C. d. A pot (potentiometer) shall be used to implement the desired angular setting All circuit design details should be provided in the project report. 3- Object Sorting by Colour You have been hired by a company that manufactures components having various colours. You have been assigned the job of designing and implementing an object sorting system that separates balls based on their colour. The developed prototype should address the following points: a. The coloured balls shall be contained in a cone-shaped bowl that dispenses the balls b. There shall be at least 6 differently coloured balls C. A microprocessor and appropriate sensor shall be utilised to categorise the various balls d. All circuit design details should be provided in the project report. 4- Silhouette Detection System You have been hired by a company that provide computer-vision solutions that use image processing to recognise and categorise image data. You have been assigned the job of designing and implementing a system for identifying different silhouettes, which emulate the shapes often encountered when using low-tech, low-resolution cameras for high-altitude reconnaissance tasks. The developed prototype should address the following points: a. The system shall successfully identify 6 or more greyscale or black-and-white silhouettes b. A database of allowable silhouettes will be supplied by your instructor C. A microprocessor and appropriate sensor shall be utilised to categorise the various shapes d. All circuit design details should be provided in the project report. ABET Learning Outcome The aim of this project is to make the students, who manage to fulfill the project requirements, have: i. The ability to identify, formulate, and solve complex engineering problems by applying linear transforms, and linear algebra. [1] ii. The ability to apply engineering design process steps to produce solutions that meet specified needs with consideration of public health, safety, and welfare, as well as global, cultural, social, environmental, and economic factors. [2] iii. The ability to communicate effectively with the audiences of his/her design. [3] iv. The ability to work in teams, create a collaborative and inclusive environment. [5]See Answer
  • Q5:1. Report structure, submission and marking criteria The following outlines the requirements for the report and excel sheet which must be submitted for 40% of the module mark. 1. The main report document must be submitted in pdf format through canvas. 2. The MS Excel file should also be submitted in .xlsx format through canvas. 3. Each student must provide their own data. 4. The report documents will be passed through Turnitin as part of the submission process and will be subject to plagiarism analysis. This will be dealt in line with the University regulations. 5. Marks are awarded according to the criteria summarized in Table 1 with guidelines for assessment in Table 2.See Answer
  • Q6:Topic: Data Communication between Arduino and Processing Subject: Computer Controlled System Design Need to do these: -Make a schematic diagram using the software TinkerCAD to match the Lab (under the tab Diagrams and Pictures) - Create a flow chart to match the lab - Answer the Discussion questions after doing this need to add these in lab report provided (you don't need to do lab report it's already been done you just need to add)/n Lab 4: Data Communication between Arduino and Processing Objectives 1. Become familiar with the Processing graphical environment, Java language, and reference site. 2. Understand the basics of data communication between Arduino and Processing. 3. Create a simple interactive system using Arduino and Processing. Background Processing is an open source programming language and integrated development environment (IDE) built for the electronic art, new media art, and visual design communities with the purpose of teaching the fundamentals of computer programming in a visual context, and to serve as the foundation for electronic sketchbooks. The user interface of Arduino IDE is very similar to the Processing IDE user interface. Casey Reas and Benjamin Fry, both formerly of the Aesthetics and Computation Group at the MIT Media Lab, were involved in the creation of Arduino IDE as well as Processing IDE. However, please note some major differences: • Arduino IDE allows you to program Arduino boards by using a simplified version of C/C++ language, and use and control physical objects such as sensors and motors. Whereas, Processing IDE allows you to write PC applications using a simplified version of Java language, and lets you create and control virtual objects such as circles and spheres and many other 2D and 3D graphics and shapes. One of the stated aims of Processing is to act as a tool to get non-programmers started with programming, through the instant gratification of visual feedback. The Processing language builds on the Java language, but uses a simplified syntax and graphics-programming model. Download and install Processing 1. Download Processing, if it is not installed already in your computer. Follow this link: https://www.processing.org/download/ 2. After you follow the instructions in the above webpage and select the platform you are working on (i.e., Windows, Mac, etc.), you would have downloaded a zip file. 3. Unzip the file. Make sure you know the folder location where it is unzipped. 4. There is no need for further installation. Processing runs by clicking on the Processing program or application. 5. Open and run following examples to check that everything is working. Processing IDE > File > Examples > Demos > Graphics Learn Processing The community behind Processing has done an excellent job of putting together good documentation and reference. You can find the language reference by following this link: https://www.processing.org/reference/ The structure of a Processing sketch is similar to the Arduino sketch. However, instead of a void loop() function, Processing uses a void draw() function that loops forever, just like the loop() function of Arduino. Procedure Part A (Analysis): 1. In a new Processing sketch, open the example MouseeCircle.pde code available in Lab-#.zip file. The MouseeCircle.pde code is shown on next page (inside the text box) for reference. 2. Run the code in Processing IDE. You should see a circle drawn inside a graphics window, that will follow the mouse pointer. 3. Go to Processing reference website and look for the following functions used in the code. size (255, 255); strokeWeight (10); frame Rate (16); background (100); fill (0, 121, 184); stroke (255); ellipse (X, Y, radius, radius); 4. For each of the functions shown above, copy the function description from the Reference web site and paste it inside a comment block /* */ before each function. The purpose is to thoroughly understand how the function works. ... 5. Final code for Part A of the lab should include a comment for each function used in the code, indicating what each function does. 6. Save the final modified code in a file and include it in your report. 7. Take a screenshot of the graphics window with the circle, to include in the Measurements section of the lab report. Schematic diagram for Procedure Part B (Design): R2 10k +5V www +5V A0 Arduino TX/1 RX/0 ⇒ USB < to PC /* Processing Example: MouseeCircle.pde /* Global variables ***** float radius = 50.0; int X, Y; ***** int nX, nY; int delay = 16; /* Setup the Processing drawing window *** void setup() { size (255, 255); strokeWeight(10); frameRate (16); width / 2; height / 2; X = Y = nx = X ; *** } nY = Y; /* Main draw loop void draw() { radius = radius + sin( frameCount / 4 ); // Track circle to new destination X+= (nX-X)/delay; Y+= (nY-Y)/delay; // Fill canvas grey background (100); // Set fill-color to blue fill (0, 121, 184); // Set stroke-color white stroke (255); // Draw circle ellipse (X, Y, radius, radius); } /* Set circle's next destination ** void mouseMoved () { nx = mouseX; nY = mouseY; } ** / / Procedure Part B (Design) (Interactive Circle): In the following steps you will create a new version of the previous processing sketch MouseeCircle.pde, where the size of the circle, the radius, is controlled by a potentiometer connected to an Arduino board. The readings of the potentiometer in the Arduino will be sent through serial/USB communication to the Processing sketch running on the PC. 8. To refresh your memory about Arduino, potentiometers, and serial communication, refer to the Arduino IDE example AnalogReadSerial. This example program can be used to complete the Arduino side of this lab exercise. Upload the Arduino example AnalogReadSerial to the Arduino board. 9. For the Processing program, you will need to make use of the Processing serial library. (Serial library reference: https://processing.org/reference/libraries/serial/ ) Add following lines shown inside the text box, to beginning of program before /* Global variables */ section: import processing.serial.*; // create serial port object Serial myPort; 10. Next, you will need to add the following lines shown inside the text box, in the beginning of the setup() function to activate the serial port. IMPORTANT NOTE: You will need to specify the correct USB/COM (serial) port index number in square brackets in Serial.list () [0], where Arduino USB cable is connected. The first USB/COM port on your PC is indicated by Serial. list () [0] The second USB/COM port on your PC is indicated by Serial.list() [1] The third USB/COM port on your PC is indicated by Serial.list() [2] so on and so forth. // List all the available serial ports println (Serial.list() ) ; // Change the serial/USB port index number in square // brackets in Serial.list()[0], // depending on whatever port Arduino is connected to. myPort = new Serial (this, Serial.list() [0], 9600); // Don't generate a serialEvent (), // unless you get a newline character: myPort.bufferUntil('\n'); This is how serial communication works in Processing. When it is setup as above and there is data coming through the serial port, the serial library triggers a serial event that is captured by the function shown below. 11. Add the following serialEvent( ) function shown inside the text box, to the end of your code after all the other functions. /* Get potentiometer values from Arduino via USB/COM port void serialEvent (Serial myPort) { // get the ASCII string: String inString = myPort.readStringUntil('\n'); if (inString != null) { // trim off any whitespace: inString = trim (inString); // convert to an int and map to the screen height: float inByte = float(inString); map (inByte, 0, 1023, 0, height); / inByte = radius = inByte; } } 12. Comment each line of the serialEvent () function to show that you understand how it works. 13. Run the modified Processing sketch on the PC. 14. Rotate potentiometer connected to Arduino analog input to change the size of the circle. 15. (Extra Credit) Change two other attributes of the circle by using the radius variable. For example, vary the shape of the circle to an oval, vary the fill color of the circle, etc. 16. Put a copy of final modified Processing code (sketch) for Part B in your report. 17. Take a screenshot of the graphics window, to include in the Measurements section of the lab report. Dig deeper You can further explore the power of Processing on Android and iOS devices. https://play.google.com/store/apps/details?id=com.calsignlabs.apde&hl=en https://apps.apple.com/us/app/processing-icompiler/id648955851 Critical thinking questions for Discussion section in report? Instead of the usual hardware and software discussion of Input, Data Processing, Data Communication and Output sub-systems; using your own words, submit the answers to the following questions in the Discussion section of your lab report: • What is Processing? What is the relationship between Arduino IDE and Processing IDE? How much different or similar is Java compared to C/C++? How can you use Processing for your course project? What is your opinion about APDE?See Answer
  • Q7:Q5: How many parameters are required in Finite StateMachine () function used for finite state machine creation? A5:See Answer
  • Q8: ME435L Homework 10 – Bidirectional Motor Control with H-Bridge (L293D) Learning Objective: Build circuit and program L293D H-Bridge Problem: Build the circuit given below and write a program that achieves following functionality. Button on pin 2 is used for power on/off of the whole system. Button on pin 3 is used to change the direction. Potentiometer is used to control the speed of the DC motor. If motor is enabled (powered on), then motor should run in one direction until your press the button on pin 3 when it should run in opposite direction. If button on pin 2 is pressed it should disable (power off/stop) motor. You should be able to control the motor speed with potentiometer if motor is enabled. Circuit: 11 DIGITAL (PWM-) O UNO ARDUINO TX+1 RX+0 ON POWER ANALOG IN + ghij 9V 0 L293D Hints: Recall we build/program/test each individual circuit separately. Review Lab 4 and Homework 5 for button and potentiometer programming, if needed. Review the datasheet for L293D. Note the chip is enabled by making its pin 1 (pin 4 on Arduino) HIGH. You have to exclusively make pin 2 on L293D (pin 5 on Arduino) and pin 7 on L293D (pin 6 on Arduino) HIGH/LOW to change the direction of current through motor based on motor direction. Declare global variables motorEnabled, motorDirection, motorSpeed and others as needed. Use Bounce2 library (more on it at link given below) to remove button bounce. Reference: https://github.com/thomasfredericks/Bounce2 ΤΟ defghijSee Answer
  • Q9:-val: a value to send as a single byte. -str: a string to send as a series of bytes. -buf: an array to send as a series of bytes. -len: the number of bytes to be sent from the array. Return: write() will return the number of bytes written, though reading that number is optional. Data type: size_t. 3. Serial.read(): Description: Reads incoming serial data. Syntax: Serial.read() Parameters: Serial: serial port object. See the list of available serial ports for each board on the Serial main page. Return: The first byte of incoming serial data available (or -1 if no data is available). Data type: int. Page 16 of 16 4. Serial.available(): Description: Get the number of bytes (characters) available for reading from the serial port. Syntax: Serial.available() Parameters: Serial: serial port object. See the list of available serial ports for each board on the Serial main page. Returns: The number of bytes available to read. Data Processing/Data Storage Subsystems The microcontroller utilized in this lab project is the ATmega2560, which is found on the Arduino Mega 2560 board. This powerful microcontroller works at a clock speed of 16 MHz. It is equipped with 256KB of flash memory for storing the program code, SKB of SRAM for storing variables, and 4KB of EEPROM Data Processing Operation: <describe code statement and/or library function(s) used for processing data, for each library function used in the lab code, include following information: Description, Syntax, Parameters, Retum value> Description: Syntax: Parameters: Returns: Description: Syntax: Parameters: Returns:/nPage 16 of 18 Internal UART Point of interaction: The Arduino Mega 2560 board utilizes its internal UART interface for serial communication. The board has a few UART interfaces, one of which is associated with the USB point of interaction to permit serial data communication with the PC. ■ USB Point of interaction: The external communication with the PC is finished through the USB interface, allowing serial data to be sent to the PC where it's perused by the Processing environment. Thi USB association copies a serial port on the PC, which is a typical strategy for communication among microcontrollers and computers. 1. Serial.begin(): Description: Sets the data rate in bits per second (baud) for serial data transmission. Syntax: Serial.begin(speed) and Serial.begin(speed, config) Parameters: Serial: serial port object. See the list of available serial ports for each board on the Serial main page. speed: in bits per second (baud). Allowed data types: long. config: sets data, parity, and stop bits. Valid values are: SERIAL_5NI SERIAL_6N1 SERIAL 7N1 SERIAL 8N1 (the default) SERIAL_5N2 SERIAL_6N2 SERIAL_7N2 SERIAL 8N2 SERIAL 5E1: even parity SERIAL_6E1 SERIAL 7E1 SERIAL_8E1 SERIAL_5E2 SERIAL_6E2 SERIAL 7E2 SERIAL_8E2 SERIAL 501: odd parity SERIAL_601 SERIAL 701 SERIAL 801See Answer
  • Q10:Read Lab_#.zip > Reference > Servo Motor Tutorial.pdf Q1: What are the five main components incorporated inside a servo motor? A1: Q2: What is the name (or purpose) of each of the three wires that stick out from servo motor ca A2: Q3: What is the purpose of the potentiometer used inside a servo motor? A3: Read Lab_#.zip > Reference > Arduino Reference - Servo Library.pdf Q4: What parameter is required in servo.write() function? A4: What is the range of values for this parameter? Q5: What parameter is required in servo.writeMicroseconds() function? A5: On standard servos, what is the normal range of values for this parameter? What is extended range of values for this parameter used by some manufacturers?See Answer
  • Q11: Tilt Ball Module 1PC USB Cable 1PC Remote Control Micro Servo TOWER PROT NGDO 1PC 9V Battery 1PC CELL WHAT TO DO 1. Diagrams and Pictures 2. Flow Chart 3. Include ALL source codes for this lab 4. Screenshots of the Serial Monitor for each part of the lab(Please label each of the screenshots) For example include Part1: ......... 5. Lab Report Discussion 6. Conclusion We have to perform the lab physically This component is required (This is Micro Servo 9G SG90) ctifier 2PCS PhotoresistoSee Answer
  • Q12:/n/n Hey, I need to program a nextion display. I have the arduino code to do it as well as the specifications and also a sample nextion code. with all of this information is it possible to get the display programmed. Please let me know as this is really important The code is written in the nextion editor and arduino is in c or c++ but you will have to be familiar with the nextion editor in order for you to make the adjustments. That is where I need help. I provided a sample to make the adjustments as well as the codeSee Answer
  • Q13: AUM American University Of The Middle East COURSE Project (30%) 2023-2024 Electric and Magnetic Fields EE 311 Semester: Spring 2024 www.aum.edu.kw • Fax: (965) 222 51 427 Tel: (965) 222 51 400 P.O.BOX:220 Dasman, 15453 Kuwait 1. 2. Table of Contents Introduction........ Project Description....... 3. ABET Learning Outcome.. 4. Student Project Evaluation. 5. Group formation ………………………………. 6. Project Management & Deliverables. 7. Turnitin 8. Artificial Intelligence Al-based content 9. APA Style .... 10. Academic Honesty and Integrity Assurance... 11. Copyrights 12. Project and team-based work. _ 13. Student Assessment Rubric.. 14. Appendix A 3 4 LO 5 5 56 6 7 8 800 9 .9 10 13 1. Introduction Projects for engineering students give an edge over the race of recruitment to work hard to ensure a good career. In spite of employment practices in recent times, students are progressively taking up projects to pad up their skill-set. Engineering projects help students to learn and acquire practical knowledge. Despite the theory concept they acquire, various industries also need to know their capacity to complete projects using their specific initiatives. Thus, we recommend students to realize engineering projects in their four years of engineering and try to present as many white papers as possible. Students who give importance to their course projects are expected to learn how to: • Work in teams including multidisciplinary teams. ● Build a major design experience based on the knowledge and skills acquired in the course work. • Build a major design experience incorporates appropriate engineering standards and multiple realistic constraints. • Apply both analysis and synthesis in the engineering design process, resulting in designs that meet the desired needs. In the design process, both creativity and criticism are essential. The followings are the seven steps that students should consider while designing their projects: • Recognition of the need and identifying opportunities: Every project begins with recognition that needs improvement. These needs may be obvious or hidden to be revealed by investigation, surveys or research. • Definition of the design problem: It is a major task requires gathering information about the problem. • • • Definition of the design criteria and constraints: While the problem is being defined, the design criteria and constraints must be defined. a. Design criteria are performance standards to be met by the design. b. Design constraints are limitations placed on the designer, the final design or manufacturing process. Examples of possible constraints include accessibility, aesthetics, codes, constructability, cost, ergonomics, extensibility, functionality, interoperability, legal considerations, maintainability, manufacturability, marketability, policy, regulations, schedule, standards, sustainability, or usability. C. Risk analysis The design loop: design is a repetitive process of: a. Synthesis (Brainstorming - Generating new ideas) b. Analysis (Breaking ideas – find expected results) c. Decision-making (Deciding the best alternative) Optimization: Design team must ask themselves if it is the optimum design. Optimum is the best design that can be achieved at reasonable cost. The proposed design is judged against the design criteria. Evaluation: Design team should hold a design review to approve drawings and specifications before they are released. If an optimum design cannot be achieved, the design team might revise the problem definition, the design criteria, or the constraints in order to achieve the optimal solution or prototype. 2. Project Description The Hall Effect Switch employs a Hall Effect sensor, a device that can alter its output voltage in response to applying a magnetic field. The Hall Effect Sensor, when combined with a proper circuitry, turns the circuit on and off based on changes in the magnetic field. Hall switches, well-known for their precision and accuracy, and can even be programmed to activate the button at specific magnetic fields, making it another good choice for elevator applications. This project requires students to construct an elevator system with three different levels using a Hall Effect sensor/s, Arduino Uno, keypad, DC Motor, LCD module, LEDs and whatever discrete components needed to achieve the functionality of the project. The separation distance between the levels is specified based on your section number as per Table 1 below. The keypad will be used to enter the number of the required level and based on the current location of the elevator, which will be determined using the Hall Effect sensor/s, the Arduino should control the operation of the DC motor to move the elevator car up/down, each group is required to operate its elevator using a different voltage supply as per Table 2 below. In addition, Arduino will depend on the Hall Effect sensor/s to detect the reached level and decide whether to keep moving or to stop once the required level is reached. The LCD Module will be used to display the start level of the elevator car when stationary, the destination level needed, and the current level when in motion. A Red LED will be used to indicate the movement of the elevator car, and a green LED will be used to indicate that the required level is reached and the elevator car is now stationary. LIMIT SWITCH SHAFT ER TOP FLOOR LEVEL SENSOR CURRENT SENSOR ENCODER 2ND FLOOR MOTOR DRIVER MOTOR LEVEL SENSOR CAR DOOR LOAD SENSOR INFRARED SENSOR LEVEL SENSOR LIMIT SWITCH Figure 1. Elevator system. 1ST FLOOR Table 1. Predefined distance between levels according to section number. Section F1 F2 F3 M1 M2 Distance in cm 10 15 20 12.5 17.5 Table 2. Motor Control Voltage according to the group number. Group Motor Control 1 2 3 4 5 6 7 8 9 10 2.5 3 3.5 4 4.5 сл 5 5.5 6 6.5 Voltage (V) Finally, students are required to discuss how the following standards apply to their prototype: Electromagnetic Compatibility (EMC) IEC 61000-4 Ingress Protection (IP) Ratings IEC 60529 3. ABET Learning Outcome A student who successfully fulfills the course project requirements will have: a) Develop and apply engineering design processes to meet the requirements of engineering standards taking into consideration the impactful constraints of global, economic, environmental, societal, health, safety, and welfare factors. [SO2, SO4] b) Work within a team, apply new knowledge, enhance hands-on experience, draw conclusions, and communicate results through the offered course project. [SO2, SO3, SO5, SO7] *[S02] An ability to apply engineering design to produce solutions that meet specified needs with consideration of public health, safety, and welfare, as well as global, cultural, social, environmental, and economic factors. *[S03] An ability to communicate effectively with a range of audiences. *[S04] An ability to recognize ethical and professional responsibilities in engineering situations and make informed judgments, which must consider the impact of engineering solutions in global, economic, environmental, and societal contexts. *[S05] An ability to function effectively on a team whose members together provide leadership, create a collaborative and inclusive environment, establish goals, plan tasks, and meet objectives. *[S07] An ability to acquire and apply new knowledge as needed, using appropriate learning strategies. 4. Student Project Evaluation Weight Project PD-1: Conceptual Design PD-2: Testing and Results Discussion Report 7.5% 7.5% PD-3: Prototype Demo and Q&A 15% Total 30% Students may be asked to work in groups to complete certain assignments. Depending on the needs of the course, the faculty may arrange the groups and inform students on Moodle in advance.See Answer
  • Q14: The Logbook In a professional context, the time and effort devoted to an experiment can only be justified if results are properly recorded: carefully, accurately, and unambiguously, so that on a later occasion, sometimes much later, a report may be prepared for someone else to read – perhaps a superior, or for publication. You may find the way of "writing up" an experiment hard to understand, and to adjust to, but academia and industry set a high priority on it. Thus, it is very important to maintain a clear and careful observation of experiments in the form of notes, datasets, and screenshots. The place for your observations is your logbook, to record what happens as you do it. It is your own record and for teaching and evaluation purposes as it is being assessed from time to time. The main issue which cannot be overstated is the full and accurate recording of the facts and observations of your experimental work. Therefore, we insist that all recording of observations is made directly into the logbook. Many students have difficulty in avoiding the tendency to treat the logbook as a formal document. Therefore, the following rules and observations should be noted: Carefully constructed sentences, carefully underlined headings etc. might not be a good practice since it may incur in a waste of lab time. Do not use loose sheets of paper for intermediate recording before transfer to the logbook - this obviates the point of the logbook and is not allowed. The Logbook - general At the beginning, number the pages throughout the book and as work proceeds keep an-up-to date contents list at the front. The Heading The record for each attendance in the lab must be headed with a few standard items of information, i.e., your group member name, the title of the experiment, and the date. The Date Dating is a point which is to be particularly stressed, as its significance seems not to be generally appreciated. Experience tells that there are many reasons for dating every observation: it enables you to check the order in which observations were made, to check consistency of your records, to establish priority on major discoveries, such as establishing your claim to a patent or copyright. The key is remembering to do it at the time of experiment. This is one of the habits that we aim to develop, and it is important enough to be considered in assessing credit. The Text Judging what and how much to write is a skill to be developed in these labs. Text should be concise but note down enough while being in the lab to serve as an adequate reminder, otherwise the work and the time spent writing it up are wasted. On some occasions, it will provide the basis for a formal report. When you are recording observations, make it quite clear that this is what you actually did or observed. There must be no room for confusion with what you were intended to do, expected, calculated, or even what one usually does. This is one of the common weaknesses. The typical observation is a set of values of variables €h occur in a given system under given test conditions, for example the current that arises in a circuit when there is a given input voltage and temperature. Therefore, all details relevant to the test conditions must be recorded for each set of readings for which they apply - e.g. signal amplitude, frequency, what instruments connected, etc. - The log is not a formal document. Whilst appearance is secondary to the content, your writing must be legible to others – not just yourself. What matters above all is that you can trust it as a true and intelligible record. This is not only relevant for other readers, but for your own reference. Ideas and facts may seem clear at the time of undertaking the work, but they rapidly become confused and in a few months' time you may not be able to understand your own notes, or there may be vital facts missing. At least read what you have written at the time to see if it makes sense. Write text on the ruled pages only: text written on the graph side is much harder to read and may confuse the reader. Do not use correcting fluids such as Tippex. It is time-wasting, has poorer appearance than neat scoring-through, and shows lack of confidence. It is also recommended that you preserve rejected work as it could later have some value, or even turn out to be correct! The account of every experiment should end with a statement of conclusions and demonstrate understanding which you have been able to draw from it. Diagrams Diagrams such as circuits may be drawn on either ruled or graph pages. Do not copy out complex diagrams into logbooks, but refer to them freely, as if they are at hand. Copying out can give a sense of doing something useful, but this is false; it is a pure waste of lab time. When referring to diagrams in the text always make it quite clear which one. In order to refer to points in a circuit diagram it is useful to adopt a scheme of labelling, rather than long-winded descriptions; thus, each point involved may be marked with a letter. Make use of simplified versions of diagrams if appropriate. Oscilloscope traces Very often you will need to record waveforms from the scope screen; the guidelines below should be followed: • Use a pencil for sketching graphs to allow ease of correction. • Do not sketch more than one cycle of a repetitive signal unless it is essential to the purpose of the exercise. You must state whether the Y amplifier was DC coupled and if so, show the 0-volt level on the sketch. • You must show the axes scales and indicate whether a 10:1 probe was used. • State fully the test conditions./nSee Answer
  • Q15: STUDENT NOTE: I need you to answer this assignment and I need provide each part what is asking there are 5 parts and I need them all, I provided all the files: assignments files (The Assignment, Prescaler Calculation and the data sheet and the schematic), Also, I provide you the slides and the snips code that we have done it in the class. One last comment we are using Adafruit Circuit Playground Classic and VS Code/PlatformIO IDE. other requirement you can see it in the assignment it self These Equipment we are using it in our course: 1. Adafruit Circuit Playground Classic - https://www.adafruit.com/product/3000 2. Adafruit Parts Pal: https://www.adafruit.com/product/2975 3. Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces : https://www.adafruit.com/product/3448 4. VS Code/PlatformIO IDE Here is the link that provided in the assignment, I dont know if you need it but I will provide it: https://www.sparkfun.com/products/12650 You can answer the assignment without buying these parts. can look at the data sheet and schematic and he can solve the assignment. Need to write the code and explain each part (Why did you choose the code and so on so basically explanation for each part. Need to use C./nSee Answer
  • Q16:ELEC 310 HW5 1. We want to implement a proximity sensor using an infrared transmitter and receiver (shown in the figure below). The infrared light is transmitted and then reflected off a nearby object and causes an electrical current to flow in the receiver, leading to a voltage proportional to the intensity of the light. We want to write a C program that uses ADC to measure the voltage on the infrared receiver to estimate the distance of the obstacle. Assume ADC_Init() function is provided. Also, consider that 10-inch distance will generate half a volt at the receiver. a. Write down the main() function which includes: i. Call for ADC_Init() function. ii. Infinite while loop iii. Required instructions to manually read the ADC. iv. Voltage calculation based on the value the ADC reads. v. Distance calculation.. b. How can you use this implementation in public safety? (Hint: Autonomous Driving) c. Add a few lines of code in main.c in order to set the variable brake to one when the distance is less than a threshold. Explain how this threshold/constraint affects public safety. d. Is always braking the best solution if an object is close to a car? What is wrong with that? e. What are the other options instead of breaking if the proximity sensor detects an object around a vehicle? How can you modify your design to accommodate public safety? IR Led IR Receiver Reflected rays from the object Object or BodySee Answer
  • Q17:/n Mech1010 Coursework - MCU Systems Global Health Drone: Autopilot Controller Thermal imaging Health Drone Injured Person Remote region INTRODUCTION Global Health Drone is designed to travel across large landscapes in remote and resource-limited parts of the world - areas where traditional healthcare systems struggle to provide assistance, particularly during emergencies. The drone's job is to search across large landscapes, locating potentially injured person(s) via camera systems and then use a thermal imaging system to scan and provide vital medical feedback to medics who can assess and come to help... So your task is to program a control system for the drone which it uses to reach a target height and maintain this while the system scans.... You • Lab Notes • Practice WOKWi Simulation •Testbed for code •Unlimited attempts RELOAD •Real Hardware • 50 Attempts! Please read this coursework guide carefully for full instructions, including your objectives, technical background and a mark scheme. Over and Out. MECH1010: Computing For Engineers Revision 01 - 18.03.2024 UNIVERSITY OF LEEDS Global Health AIM AND OBJECTIVES The aim is to develop a height control system which moves your drone to a stable height and maintains this for 5 seconds while it performs a thermal scan... APPROACH Drones are expensive... so you will need to develop your code carefully in two stages using: 1. A drone simulation (in WokWi): develop your code until it is functional and error free ... 2. The ReLOAD drone model: now test your code on a real system and tune the controller IMPORTANT: You are limited to 50 test runs on the ReLOAD system! Drone (This represents industry practice - testing on hardware is costly... only attempted when you have a system you are confident will work effectively! OBJECTIVES 1. Produce a Flow Chart of your program from the Specification (see Page 4) 2. Write an Arduino drone controller program (based on your Flow Chart) which: a. Initialises your system hardware b. Implements a closed-loop controller to reach and maintain the target height i. Your controller should run at 25Hz ii. As a minimum you should implement a Proportional controller c. Lights LEDs to indicate (System start, Reached Target Angle (Scanning Start), Scanning complete - d. Sends flight telemetry data via Serial – see Page 4 for the detail e. f. Use good programming practice to produce a well-structured and understandable program Use functions to implement i. Sensor measurement ii. The controller iii. Other functions of your choice... 3. Collect and submit evidence from ReLOAD of your system in action (see Deliverables, Page 6) a. Your flow-chart (1 side of A4) b. Your program C. ReLOAD outputs (.CSV and Video file) MECH1010: Computing For Engineers P2 UNIVERSITY OF LEEDS Global Health SYSTEM DESCRIPTION You will develop your controller using the model drone system shown in Figure 1. The drone is represented by a beam, pivoting at the end, with a motor-driven propeller at each end. The beam is free to rotate about the pivot, simulating the drone moving in the air. Your Arduino controller is connected to: 1) A potentiometer which can be used to measure the angle of the drone (relative to ground). 2) Two H-Bridge motor controllers, each linked to a high-power DC motor and power supply Drone Target Height (50mm over ref) Oref=0° ground-68.5° 0 DC motor 602 H-Bridge Arduino Indicator LEDS Support Rod (0.491m) Figure 1. Configuration of the model helicopter system V pot Potentiometer HARDWARE The hardware in the drone model is described here. You will need to use this to configure your Arduino system correctly, and to calibrate your sensor measurement. Item H-Bridge Controllers + Motors DC motor H-Bridge Arduino Potentiometer 1-11 For calibration, we took the following measurements: ADC out Angle (0-1023) 212 -68.5 410 0 Output LEDS Information A commercial H-Bridge controller is used to control the motor. This takes a 24V supply and uses DIRECTION and ENABLE inputs: H-Bridge Connections ENABLE: Pin 10 DIRECTION: Pin 9 The potentiometer output voltage will change linearly as a function of the angle 0 shown in Figure 1. The output Vpot can be measured using Arduino Pin AO Table 1: Equipment specification for the model helicopter Use these LEDs to signify the status of the control system. LED (Green) = Pin 2 LED (Yellow) = Pin 3 LED (Red) = Pin 4 MECH1010: Computing For Engineers P3 UNIVERSITY OF LEEDS Global Health SPECIFICATION Your balance controller should be written to go through the following process - please read this carefully! You need to convert this into a Flow Chart as part of your submission Drone The process is defined by a series of numbered stages. Each stage requires you to perform some tasks which are detailed. 1. As your control program starts it must initialise the system. Setup your Serial communication so you can send messages. Configure your hardware connections to the sensor and motors. 2. Show that your controller (the programme you write) has started by lighting all LEDs for 0.5 seconds 3. Your controller should now start. It should run continuously at 25Hz - as precisely as possible. a. The controller first reads the potentiometer sensor to determine the angular position of the drone b. The angular position is converted into the current height of the drone C. Now your controller should calculate a motor control signal based on the target height = 50mm. d. Send telemetry information using Serial communications e. Light the output LEDs according to the current control error: i. Error less than ±20mm [Green] = TARGET HEIGHT ii. Error <-20mm [Yellow] f. iii. Error > +20mm [Red] Continue the controller for 5 seconds g. Land (Stop Motor) Shutdown: 4. a. Light all LEDs for 1 second and turn-off the motor b. Optional: Calculate and report the following performance statistics (as many as you can): i. the time taken to first reach TARGET HEIGHT ii. the maximum error encountered after first reaching TARGET HEIGHT iii. the average error encountered after first reaching TARGET HEIGHT AUTO-PILOT BLACKBOX DATAFILE As your program runs it should generate a BlackBox datafile - formatted in the same way as the example below but with your own data. This must be submitted as part of your coursework to demonstrate that your program runs and how well it performs! (Note the... just indicates lots more data!) 0. System Started 1. System Initiated 2. Controller Starting Time, Angle, Height, Error 0.00, 0.3,0.15... 0.02,0.29,0.14... 5.00,0.151,0.01... 4. Shutdown Maximum Error: REPORT HERE UNITS: Please ensure you report your data in the following format Time Current Angle Height Error seconds degrees metres metres 2 decimal places 2 decimal places 2 decimal places 2 decimal places Data that should be printed to Serial as your program runs. Note: the numeric values are only examples - yours should use the actual values you record! MECH1010: Computing For Engineers P4 UNIVERSITY OF LEEDS THE CLOSED LOOP CONTROLLER CONTROLLER TYPE Your program should implement a closed-loop controller. The basic version you should attempt is a Proportional Controller - see lecture notes/slides For additional marks you can implement a more advanced PID controller - see links below This must be made clear in your code comments! REFERENCE: PID CONTROLLERS https://scholarscompass.vcu.edu/cgi/viewcontent.cgi?article=5737&context=etd https://www.omega.co.uk/prodinfo/pid-controllers.html Global Health CONVERTING YOUR CONTROL SIGNAL INTO MOTOR SIGNALS Your controller will generate a control signal that must be used to drive your drone motor. For the motor you can control both speed and direction using the H-Bridge controller (see your lab and lecture notes). SIMULATION Please find the simulation and template code at this address: https://wokwi.com/projects/327380710302155348 Item Blue LED Purple LED Green LED Yellow LED Red LED Purpose H-Bridge Direction H-Bridge Enable Potentiometer Template Code Angle Sensor Your starting point! DEITECH Green Telbaar Red B LED DIGITAL (PMM L TX ∞ UNO ON RX ARDUINO POWER ANALOG IN (944-88827 (111144 Drone MECH1010: Computing For Engineers P5 UNIVERSITY OF LEEDSSee Answer
  • Q18: we want to add to below code, signal send to relay switch with 5 volt to switch the relay from open to close when there is touch on the sensor. So, when there is any finger on sensor the arduino send 5 volt to switch to close. Only we need this part to be add to below code. " #include <Capacitive Sensor.h> CapacitiveSensor Sensor = Capacitive Sensor(4, 6); long val; int pos; #define led 13 void setup() { Serial.begin(19200); pinMode(led, OUTPUT); } void loop() { val = Sensor.capacitive Sensor(100); Serial.println(val); { if (val>= 100 && pos == 0) digitalWrite(led, HIGH); pos = 1; delay(100); } { else if (val <= 0 && pos == 1) digitalWrite(led, LOW); pos = 0; delay(100); } delay(50); } "I/nSee Answer
  • Q19: COMPUTER SCIENCE & ENGINEERING 1884 PRIFYSGOL BANGOR UNIVERSITY ICE-3501 Internet of Things Laboratory Exercise 5: Downlinks and Data Storage Noel Bristow THE THINGS NETWORK AREF DACO/AO ICE-3501 Module: ICE-3501 - Internet of Things Computer Science and Engineering Dr Noel Bristow Department: Module credit: 20 Organiser: Deadline: see Blackboard Laboratory Exercises Assessment: Laboratory Exercise 5 Description In these weekly laboratory sessions you will be provided with a range of exercises designed to help you master some of the concepts and tools required to develop and build loT systems. There are five laboratory sessions that are assessed and each piece of work must be completed and submitted for marking. Note that these exercises make up 75% of your final mark for this course (15% each), so it is important that you submit all of them. Generally you should be able to complete laboratory exercises within the 2 hours that have been timetabled for that laboratory. If you have been unable to complete the work in this period, you should finish it in your own time. The laboratory exercises will consist of the following: 1. Node Creation 101 – An introduction to the Arduino 1310 and Grove sensors. - 2. Local Communications - Experimenting with Serial and I2C communications. - 3. TTN Setup – Setting up an application on TTN and formatting payloads. 4. Integrations & Dashboards - Building dashboards in Node-RED and using MQTT. 5. Downlinks & Data Storage - Setting up downlink messages to control an end device from your dashboard and storing data for later use. Output Requirements You will be required to produce a short report for each laboratory explaining your results and findings. Include any code (copy/paste) as required in the report (do NOT screendump). Other outputs (e.g. TTN screens) can be included as screendumps. Also note that to obtain a mark you must attend a laboratory session and be prepared to demonstrate your program and answer questions about the coding. Non-attendance at labs will result in your work not being marked. Submission Procedure Use Blackboard to submit report (no emails). As you work through the exercises you will be expected to demonstrate a working prototype to the lecturer/lab demonstrator. This will be done at a lecture/workshop at most one week after the submission deadline. Deadlines The deadline for submitting each exercise will be at 9pm on the Sunday two weeks after each exercise is posted. The exact date will be posted on Blackboard. This will allow you to get help and/or feedback at lecture/workshops before submission. Contribution of this assessment This assessment contributes to 15% of the overall module mark. Module Learning Outcomes • Prototype simple loT devices using common development boards. • Construct a server to act as a conduit between an loT device and its user. • Illustrate the processing flow of information from loT devices to an end-user. Computer Science and Engineering, Bangor University THE THINGS NETWORK Lab 5 v2.0 (2023-24) ICE-3501 Plagiarism and Unfair Practice Laboratory Exercises Plagiarised work will be given a mark of zero. Remember when you submit you agree to the standard agreement: This piece of work is a result of my own work except where it is a group assignment for which approved collaboration has been granted. Material from the work of others (from a book, a journal or the Web) used in this assignment has been acknowledged and quotations and paraphrasing suitably indicated. I appreciate that to imply that such work is mine, could lead to a nil mark, failing the module or being excluded from the University. I also testify that no substantial part of this work has been previously submitted for assessment. Late Submission Work submitted within one week of the stated deadline will be marked but the mark will be capped at 40%. A mark of 0% will be awarded for any work submitted 1 week after the deadline. Acceptable reasons for submitting work late include: Serious personal illness with a doctor's certificate (a self-certified medical note should not be accepted); The death of a relative or close friend; Serious family problems such as divorce, separation, and eviction. Examples of unacceptable reasons for failing to submit work on time include: Having exams; Having other work to do; Not having access to a computer; Having computer related problems; Being on holiday; Not being able to find information about a subject. Contact the request centre on MyBangor if you need an extension. Marking Scheme Please remember that marks are provisional until they are confirmed by a board of examiners. The marking scheme will be detailed in the requirements document for each exercise. Mark ranges >70%, excellent. Assemble critically evaluated, relevant areas of knowledge and theory to construct professional-level solutions to tasks and questions presented. Is able to cross-link themes and aspects to draw considered conclusions. Presents outputs a cohesive, accurate, and efficient manner.. >60%, good. Is able to analyse a task or problem to decide which aspects of theory and knowledge to apply. Solutions are of a workable quality, demonstrating understanding of underlying principles. Major themes can be linked appropriately but may not be able to extend this to individual aspects. Outputs are readily understood, with an appropriate structure but may lack sophistication. >40%, threshold performance. Uses key areas of theory or knowledge to meet the Learning Outcomes of the module. Is able to formulate an appropriate solution to accurately solve tasks and questions. Can identify individual aspects, but lacks an awareness of links between them and the wider contexts. Outputs can be understood, but lack structure and/or coherence. <40%, below threshold performance. An attempt has been made yet does not address considerable areas of the criteria. Feedback details Formative (On-going) Description Verbal Feedback - Verbal feedback will be available by request at each lecture/workshop. It is suggested that you keep a written note of this feedback to aid in your personal development. You will also have a short meeting to discuss your design after you have submitted it. Summative Written Feedback - Written feedback will be made available through (Post blackboard after an assignment is submitted. To access your written Assessment) feedback see the comments section of your assignment submission. Timeframe Instant 1-2 weeks Computer Science and Engineering, Bangor University THE THINGS NETWORK Lab 5 v2.0 (2023-24) ICE-3501 - Laboratory Exercise 4 – The Things Network (TTN) Setup Laboratory Exercises Welcome to the fourth laboratory session for ICE-3501 Internet of Things (IoT). In these weekly sessions you will be provided with a range of exercises designed to help you master some of the concepts and tools required to develop and build loT systems. The main objective of this lab is to forward the temperature and light sensor data that appeared in the TTN console (Lab 3) to Node-RED via MQTT, from here you can create an IoT dashboard to view the data. Node-RED is a free, JavaScript-based development tool for visual programming, developed to ease the process of wiring together hardware devices, APIs and online services. The MQTT server that is exposed by The Things Stack can be connected to Node-RED. This integration allows setting up a Node-RED flow that listens to events and uplink messages, and it is also possible to schedule downlink messages. Devices Gateways THE THINGS NETWORK Integration Plugin Thinger.io Platform Data buckets Dashboards Endpoints Overview The marks for the exercise are given in square braces as well as what is required e.g. photo & code: [10%], please put all answers into a single pdf report. Code: copy/paste so it can be tested if required - please do not screendump code as an image. Photos are used to show that you have built the circuit. You will need to demo your programmes to a member of staff. This lab is split into 5 areas for you to explore they are: 1. Prepare device and flow 2. Configure for downlink Dashboard Control 3. 4. Data Storage 5. Visualise live data You can get more information and help at https://www.arduino.cc for general Arduino help, look under the documentation section. You can also find more information about the Grove Starter kit here https://www.seeedstudio.com/Grove-Starter-Kit-for-Arduino-p-1855.html. There is also some good advice here https://wiki.seeedstudio.com/Grove_Starter Kit_v3/. For help with the Things Network there is a wealth of documentation here https://www.thethingsindustries.com/docs. For Node Red info: https://flows.nodered.org/. Computer Science and Engineering, Bangor University THE THINGS NETWORK Lab 5 v2.0 (2023-24) ICE-3501 Laboratory Exercises Lab Exercises Exercise 1 - Prepare device and flow [15%] (a) Change your Arduino Code from the last lab so that you are just transmitting a payload consisting of temperature. Additionally change your Node-RED flow and dashboard to get rid of the light and RSS objects, so you are just left with temperature. NOTE: you can save a flow by right-clicking and selecting Export - on the dialog box you can then select what you want to export (selected nodes, current flow, or all flows) and then when you click Download a flows.json file will be created – this can be imported (CTRL+I) (b) Now add a relay module to the Arduino MKR 1310 (connected to a digital input) and update your code accordingly. In setup() get the Relay to turn ON, wait 1 second, and then turn OFF (this will confirm that the relay is working). Submit your Arduino code, and screenshot of the node-red IDE. [15%] HELI SHON HLSBL-DC3V-S-C CE AW 10A 250V-15A 120VAC Exercise 2 - Downlink [30%] In order to receive a downlink message from TTN to control the relay we need to change the Arduino code to listen for incoming data as follows: (a) Add a new function receive_message(): void receive_message() { // receive message: // x00: // Relay OFF otherwise: Relay ON byte incomingData; bool messageFlag = false; while (modem.available()) { // store the last received byte (in case multiple messages downloaded) incomingData = (byte) modem.read(); messageFlag = true; } if (messageFlag) { Serial.print("Received: "); Serial.print(incomingData); if (incomingData == 0) { Serial.println(" Turning relay OFF"); // **** enter code here to turn Relay OFF } else { Serial.println(" Turning relay ON"); // **** enter code here to turn Relay ON } } | } Computer Science and Engineering, Bangor University THE THINGS NETWORK Lab 5 v2.0 (2023-24)/n COMPUTER SCIENCE & ENGINEERING 1884 PRIFYSGOL BANGOR UNIVERSITY ICE-3501 Internet of Things Mini-Project Noel Bristow THE THINGS NETWORK AREF DACO/AO ICE-3501 Module: Department: Module credit: Organiser: Deadline: ICE-3501 - Internet of Things Computer Science and Engineering 20 Dr Noel Bristow see Blackboard Laboratory Exercises Assessment : Mini Project Description The Mini project is an opportunity for you to demonstrate your abilities and understanding of Internet of Things. The opportunity here is for you to conceive and implement a working prototype for a 'product' that is both relevant and well executed. Your idea must meet the needs of the module but also be exciting and fresh. Note that as part of this activity you will be required to submit two formal pieces of work AND evidence of the development and implementation phase of the project, see section marked Submission. ၈) Devices C Gateways THE THINGS NETWORK Integration Plugin Thinger.io Platform Data buckets Dashboards Endpoints Output Requirements You will be required to produce a short report for each laboratory explaining your results and findings. Include any code (copy/paste) as required in the report (do NOT screendump). Other outputs (e.g. TTN screens) can be included as screendumps. Also note that to obtain a mark you must attend a laboratory session and be prepared to demonstrate your program and answer questions about the coding. Non-attendance at labs will result in your work not being marked. Submission Procedure Use Blackboard to submit your Film, A4 Infographic and Evidence. So below is a list if the items required. 1. A film – submitted via Panopto in Blackboard. 2. - An A4 Infographic (poster) – submitted through Blackboard 3. An evidence Portfolio via Blackboard - this will be a zip folder Deadlines The deadline for submitting your Mini-Project is on Blackboard. Late submissions will be penalised in line with School policy. Contribution of this assessment This assessment contributes to 25% of the overall module mark. The assessment will be marked out of 100 marks - marks for each section shown as e.g. [25 marks]. Module Learning Outcomes Covered • Prototype simple loT devices using common development boards. • Construct a server to act as a conduit between an IoT device and its user. • Illustrate the processing flow of information from IoT devices to an end-user. Computer Science and Engineering, Bangor University THE THINGS NETWORK Mini-Project v2.0 (2023-24) ICE-3501 Plagiarism and Unfair Practice Laboratory Exercises Plagiarised work will be given a mark of zero. Remember when you submit you agree to the standard agreement: This piece of work is a result of my own work except where it is a group assignment for which approved collaboration has been granted. Material from the work of others (from a book, a journal or the Web) used in this assignment has been acknowledged and quotations and paraphrasing suitably indicated. I appreciate that to imply that such work is mine, could lead to a nil mark, failing the module or being excluded from the University. I also testify that no substantial part of this work has been previously submitted for assessment. Late Submission Work submitted within one week of the stated deadline will be marked but the mark will be capped at 40%. A mark of 0% will be awarded for any work submitted 1 week after the deadline. Acceptable reasons for submitting work late include: Serious personal illness with a doctor's certificate (a self-certified medical note should not be accepted); The death of a relative or close friend; Serious family problems such as divorce, separation, and eviction. Examples of unacceptable reasons for failing to submit work on time include: Having exams; Having other work to do; Not having access to a computer; Having computer related problems; Being on holiday; Not being able to find information about a subject. Contact the request centre on MyBangor if you need an extension. Marking Scheme Please remember that marks are provisional until they are confirmed by a board of examiners. The marking scheme will be detailed in the requirements document for each exercise. Mark ranges >70%, excellent. Assemble critically evaluated, relevant areas of knowledge and theory to construct professional-level solutions to tasks and questions presented. Is able to cross-link themes and aspects to draw considered conclusions. Presents outputs in a cohesive, accurate, and efficient manner.. >60%, good. Is able to analyse a task or problem to decide which aspects of theory and knowledge to apply. Solutions are of a workable quality, demonstrating understanding of underlying principles. Major themes can be linked appropriately but may not be able to extend this to individual aspects. Outputs are readily understood, with an appropriate structure but may lack sophistication. >40%, threshold performance. Uses key areas of theory or knowledge to meet the Learning Outcomes of the module. Is able to formulate an appropriate solution to accurately solve tasks and questions. Can identify individual aspects, but lacks an awareness of links between them and the wider contexts. Outputs can be understood, but lack structure and/or coherence. <40%, below threshold performance. An attempt has been made yet does not address considerable areas of the criteria. Feedback details Formative (On-going) Summative (Post Description Verbal Feedback - Verbal feedback will be available by request at each lecture/workshop. It is suggested that you keep a written note of this feedback to aid in your personal development. You will also have a short meeting to discuss your design after you have submitted it. Written Feedback - Written feedback will be made available through blackboard after an assignment is submitted. To access your written Assessment) feedback see the comments section of your assignment submission. Timeframe Instant 1-2 weeks Computer Science and Engineering, Bangor University THE THINGS NETWORK Mini-Project v2.0 (2023-24) ICE-3501 Mini-Project: Tasks & Requirements Laboratory Exercises The modern world has recently started to adopt the concept of the Internet of Things (IoT). This idea has led to many wonderful and exciting innovations, these include central heating control from your phone, smelly tweets, smart lights, fridges that do your online shopping automatically when you run out of food. Other examples are home security, location tracking, activity tracking, pet monitors/feeders, environmental monitoring, smart agriculture, healthcare monitors, smart appliances, wearables. Your job is to produce an IoT system (as a minimum this is an end device, two-way communications via LoRaWAN and a Dashboard using NodeRED). You are to design and build a prototype that can then be used to demonstrate your concept (so for instance an automatic curtain control system could just use a relay in place of the actual curtain control motor). There are number of things that you must consider: 1. You will be using the Arduino MKR1310 (or agreed alternative) as your base for the device. 2. You must keep evidence of the design process as you go - this can be concept drawings and other sketches, screen grabs, videos and photos - software and hardware. 3. You should use sensors other than those already used in the lab - you are welcome to use the light and temp as well, but you must use at least one additional sensor in your project. If you require a sensor that is not included in the kit you can ask at a lab and we might be able to provide it. 4. You will need to set up an application on The Things Network 5. You will need to connect a NodeRED (or agreed alternative to NodeRED) dashboard to the TTN Application to display the data. 6. You will need to configure the dashboard to act as the system controller. 7. You will need to setup actuator(s) to respond to data or user input on the dashboard. 8. Tour system will send data both ways – from end device to dashboard, and from dashboard to end device – two way communication. - 9. You should store the collected data and also log the actuation invocation. You will be required to produce three outputs from you work, as detailed below. Output 1: A short video (1-2 minutes) – this must promote the concept of your loT device and show the final product by demonstrating how it works. You should think of it as being a video to put on a crowd-sourcing site for investment money. You need to think of the video as a promotional film, look at kickstarter.com etc for examples of what other people have done. Below are things you must include in the film [30 marks]. • Show the working device • Explain the origins of the idea • Show the wider concept • Explaining the algorithm is important, explaining the process rather than the code ● Put a title screen on - this could be a piece of paper or a fully multimedia production • Put the credits to the work done and any references at the end. You are welcome to use any resource available to you; this could be your laptop, smartphone etc. Computer Science and Engineering, Bangor University THE THINGS NETWORK Mini-Project v2.0 (2023-24) ICE-3501 Laboratory Exercises Output 2: A single (or double) page A4 Infographic with technical details of the implementation. It must give important details of the device: how the device is connected, include components and their component codes (if they have one). Think of it as a diagram and highlight any important features. Almost like a mini poster, it could be a handout that you use to promote the idea at an exhibition [20 marks]. Output 3 - Evidence Portfolio: Collect evidence as you go of the work that you have undertaken, this could be in the form of scraps of paper with notes on, photos/videos of the activity, a journal if you prefer, you must also include your source code for the Arduino and any datasheets that you use. Collect all these things together and zip them into an archive that you can submit on Blackboard [50 marks]. Computer Science and Engineering, Bangor University THE THINGS NETWORK Mini-Project v2.0 (2023-24)See Answer
  • Q20: WORKSHOP ONE EMBEDDED SYSTEM DESING ENG 5 ESD Workshop One Introduction to Arduino Arduino Projects Tools and Parts Needed Download the Software Connect Your Arduino Uno.... Exercise 1: Blink an LED Required Parts. Connect The Parts...... Upload The Blink Sketch... Change The Code Exercise 2: LED w/ Switch... Required Parts. Connect The Parts........ Upload The Switch Sketch Troubleshooting. Resources. 2 2 .2 3. 5 6 Error! Bookmark not defined. .7 7 9 11 Error! Bookmark not defined. 11 12 14 14 WORKSHOP ONE EMBEDDED SYSTEM DESING ENG 5 ESD Introduction to Arduino Uno IOREF RESET 3V3 5V GND GND VIN AO AL A2 ANALOG IN RESET ICSP2 AREF GND 13 12 ~11 O UNO DIGITAL (PUM=~) Arduino ION ICSP TXO 1 RXO 0 10 A&COE FGHIJ In the introduction part of this workshop, we're going to show you the steps how to create few simple Arduino projects. These basic projects will help you understand how to set up the Arduino software and then connect the components to perform a specific action. If you have some experiences of Arduino programming, you can jump to exercise one. Tools and Parts Needed In order to complete the projects in this workshop, you'll need to make sure you have the following items. Arduino or Elegoo Uno Board Breadboard - half size Jumper Wires USB Cable LED (5mm) Push button switch WORKSHOP ONE EMBEDDED SYSTEM DESING ENG 5 ESD 10k Ohm Resistor 220 Ohm Resistor Download the Software At this point, we're ready to download the free software known as the IDE. The Arduino IDE is the interface where you will write the sketches that tell the board what to do. (notes: all the PCs in T 719 has the Arduino IDE installed, If you want to try it back you home, you can follow the instruction below, otherwise, you can jump to next section.) You can find the latest version of this software on the Arduino IDE download page. ARDUINO The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board. It runs on Windows, Mac OS X, and Linux. The environment is written in java and based on Processing and other open- source software. This software can be used with any Arduino board. Refer to the Getting Started page for Installation instructions. Windows Installer Windows ZIP file for non admin install Windows app Get Mac OS X 10.7 Lion or newer Linux 32 bits Linux 64 bits Linux ARM Release Notes Source Code Checksums (sha512) To install the software, you will need to click on the link that corresponds with your computer's operating system. Arduino IDE Once the software has been installed on your computer, go ahead and open it up. This is the Arduino IDE and is the place where all the programming will happen. Take some time to look around and get comfortable with it. WORKSHOP ONE EMBEDDED SYSTEM DESING ENG 5 ESD Makerspaces_com | Arduino 1.8.1 1 File Edit Sketch Tools Help 2 Makerspaces_com 3 4 6 5 7 void setup() { } // put your setup code here, to run once: | 9 void loop() { } // put your main code here, to run repeatedly: Done Saving. 10 11 11 8 Arduino/Genuino Uno on COM4 1. Menu Bar: Gives you access to the tools needed for creating and saving Arduino sketches. 2. Verify Button: Compiles your code and checks for errors in spelling or syntax. 3. Upload Button: Sends the code to the board that's connected such as Arduino Uno in this case. Lights on the board will blink rapidly when uploading. 4. New Sketch: Opens up a new window containing a blank sketch. 12 WORKSHOP ONE EMBEDDED SYSTEM DESING ENG 5 ESD 5. Sketch Name: When the sketch is saved, the name of the sketch is displayed here. 6. Open Existing Sketch: Allows you to open a saved sketch or one from the stored examples. 7. Save Sketch: This saves the sketch you currently have open. 8. Serial Monitor: When the board is connected, this will display the serial information of your Arduino 9. Code Area: This area is where you compose the code of the sketch that tells the board what to do. 10. Message Area: This area tells you the status on saving, code compiling, errors and more. 11. Text Console: Shows the details of an error messages, size of the program that was compiled and additional info. 12. Board and Serial Port: Tells you what board is being used and what serial port it's connected to. Connect Your Arduino Uno At this point you are ready to connect your Arduino to your computer. Plug one end of the USB cable to the Arduino Uno and then the other end of the USB to your computer's USB port. Once the board is connected, you will need to go to Tools then Board then finally select Arduino Uno. Makerspaces_com | Arduino 1.8.1 File Edit Sketch Tools Help Х Auto Format Ctrl+T Archive Sketch Makerspaces_ Fix Encoding & Reload Serial Monitor Ctrl+Shift+M // This is th Serial Plotter Ctrl+Shift+L void setup() } // put your void loop() { } // put your WiFi101 Firmware Updater Board: "Arduino/Genuino Uno" Port Get Board Info Programmer: "AVRISP mkII" Burn Bootloader Boards Manager... Arduino AVR Boards Arduino Yún Arduino/Genuino Uno Arduino Duemilanove or Diecimila Arduino Nano Arduino/Genuino Mega or Mega 2560 Arduino Mega ADK Arduino Leonardo. Arduino Leonardo ETH Arduino/Genuino Micro O/n WORKSHOP 02 BUILD YOUR OWN MINI ARDUINOIGATION ENG_5_ESD T719 The main aim of this workshop is to build your own minimum number of components Arduino. The figure 1 shows the schematic drawing of the Arduino UNO R3: UIN +50 GND CMP C1 Leen +303 U5A LMV358IDGKR _SCK U5B LMU358 DGKR x1 POWERSUPPLY DC2100 PURIN PC1 47u +50 U2 GND GND TVT +5U OUT 5+3U3 ON/OFF +50 GND NC/FB 4 LP2985-33DBUR RESET +303 GND GND Arduino(TM) UNO Rev3 ICSP1 MISO2 SCK2 RESET2 3x2 M B GND RESET-N UIN GND 8x1F-H8.5 NCP1117ST50T3G +50 UIN IN OUT BU = PC2C2 474188 GND GND GND +50 GREEN RN40 12/ RN4C 1K GND GND +50 fcsp C4 100n 10x1F-H8.5 ADS/S110 SCL AD4/SDA SDA 3x2 M GND AREF GND SCK MISO RESET2 USB-B TH X2 XUSB B USBUCC MF-MSMF858-2 500mA 228 RN3 RN30RD (PCINT6)PB620 PB6 (PCINT7/OC0A/OC1C)PB7 RESET(PC1/DW) 19 PB5 18 PB4 (T1/PCINT4)P4 17 MISO2 (PDO/MISC/PCINT3)PB3 XTAL2(PCO) (PDIMOSVPCINT2)PB2 21 PBZ ZU4 RESE 19 RESET 16 MOS12 15 SCK2 GND XTAL1 (SCLK/PCINT1)PB1 (SS/PCINTO)PBO 14 +50 AVCC (INT4/CP1/CLK0JPC7 EXTAL2 = KTAL1 CSTCE16M8V53-RØ 16MHZ (SCK)PB5 (MISO)PB4 (MOSI)PB3 XTAL2 (SS)PB2 SS 109 XTAL1 (OCT)PB1 (ICP)PBO SF-H8.5 VCC GND GROUND GND GND TP UUCA 27 UCAP USHIELD USBUCC UVCC RD- 30 108n C2= RO UGND 33 PAD (AINGINT1)PD1 (OCOBAINTOPDO ATMEGA16U2-MU<R> LIGND (OC1A/PCINT8)PC6 (PCINT9/OC1BPCS (PCINT10)PC4 (AIN2/PCINT11)PC2 (CTS/HWB/AIN6/TONT7)PD7 (RTS/AINS/INT6PD6 DICKIAINAIPCINT12PD5 (INTS/AIN3)PD4 (TXD1ANT3)PD3 (RXD1/AIN1ANT2)PD2 AREF 21 ADS/SCL AREF (ADC5)PC5 AVCC ADCLIP CA AD4/SDA AGND (ADC3)PC3 +50 AD2 ^ (ADC2)PC2 VCC (ADC1)PC1 AD1 C6 (ADCO)PCO) ADO 12 100 11 TXLED 102 BX1F-H8.5 10 RXLED +50 (AIN1)PD7 106 MBRXD (AINO)PD6 16 RN2C 105 (T1)PD5 GND 104 (TO)PD4 103 (INT1)PD3 YELLOW (INTO)PD2 102 101 (TXD)PD1 RN28 (RXDIP DO IO ATMEGA328P-PU 1K RX YELLOW MARXD 1K RN1B M8TXD 1 RN4A RN3B 22R 2213 You can Figure 1 Arduino Uno R3 Schematic find it at https://www.arduino.cc/en/uploads/Main/Arduino Uno Rev3- schematic.pdf if you want a good quality drawing of this controller. If you look closely at the Arduino Uno board above, you'll notice that aside from the ATmega328 there really are not very many components. Most of the "extra" parts have to do with either the USB to serial interface or with the internal 5-volt and 3.3-volt regulators. The ATmega328 is a single-chip microcontroller with the following features: 8-bit RISC (Reduced Instruction Set Computer) processor core. Runs at clock speeds from 1MHz to 20MHz. 32Kb Flash Memory. 2Kb SRAM (Static Random Access Memory). 1Kb EEPROM (Electrically Erasable Read Only Memory). 23 GPIO (General Purpose Input-Output) lines. 32 general purpose registers. 12C, SPI, and Serial interfaces. 10-bit Analog to Digital converters - 6 in DIP package, 8 in surface-mount package. WORKSHOP 02 BUILD YOUR OWN MINI ARDUINOIGATION Internal and External Interrupts. ENG_5_ESD T719 With the ATMega 328 and few components, you can build a very simple Arduino which can fulfil all the function of Arduino UNO. In this workshop, we will build such a simple version Arduino and repeat all the experiment we have done in the workshop one. Component Required: ■ A 16MHz crystal. A ATmega328p A 10K resistor. ■ Two 22pf capacitors ■ " A 10uf capacitor A USB to TTL RS232 Converter A LED 220 Ohm resistor 2x push button switch Jumper wires A breadboard A USB A to mini B cable Exercise 1, Build the simple Arduino Build your circuit based on the following figure 2 on a breadboard +5V 22pF 10ΚΩ 10 uF ELECTRONICS HUB 28 +5V 2 3 27 +5V 5 6 7 8 9 10 11 12 ATmega328P +5V 26 25 24 23 22 21 20 19 18 17 13 16 33092 22pF 14 15 16MHz Figure 2 Minimum Component Arduino Circuit USB to TTL Converter DTR RXD TXD VCC CTS GND WORKSHOP 02 BUILD YOUR OWN MINI ARDUINOIGATION ENG_5_ESD T719 When you finish building the circuit, connect it to your PC with the USB A to mini port cable. By default, the LED will flash. If not, press the push button. Otherwise, talk to the lab instructor to help you out. Exercise 2 Repeat exercise 1 of workshop one. Exercise 3 Repeat exercise 2 of workshop one. Please refer to figure one when you map the Arduino Uno pin number with the ATmega 328 pin number./n WORKSHOP TWO SUPPLEMENT DOCUMENT If your ATmega part number is 328 instead of 328p, you need to go through the following step to upload your code to the MCU. 1. Installing Mini-core The 'MiniCore' package from MCUDude is a hardware package which adds support for a range of ATmega devices in the arduino IDE, namely: • ATmega8 ATmega48 • ATmega88 • ATmega168 . ATmega328 • ATmega328PB Step 1 - Open up the Arduino IDE and navigate to the preferences (or press ctrl+,). At the bottom of the page is an empty field next to 'Additional Boards Manager URLs'. You want to copy the following URL in here: https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.jso Preferences Settings Network Sketchbook location: C:\Users Maayan \Documents\Arduino Editor language: System Default Editor font size: 12 Interface scale: Automatic 100 % (requires restart of Arduino) Show verbose output during: compilation upload Compiler warnings: None Display line numbers Browse (requires restart of Arduino) Enable Code Folding Verify code after upload Use external editor Aggressively cache compiled core Check for updates on startup Update sketch files to new extension on save (.pde -> .ino) Save when verifying or uploading Additional Boards Manager URLS: https://mcudude.github.io/MiniCore/package MCUdude_MiniCore_index.json More preferences can be edited directly in the file C:\Users Maayan \AppData\Local\Arduino 15 preferences.txt (edit only when Arduino is not running) HO OK Cancel WORKSHOP TWO SUPPLEMENT DOCUMENT Step 2 - Navigate to the boards manager, which is under Tools>Board>Boards Manager. Here, you'll find a list of boards your Arduino is capable of talking to. ArduinolSP | Arduino 1.8.5 File Edit Sketch Tools Help Auto Format Ctrl+T Archive Sketch ArduinolSP Fix Encoding & Reload // ArduinoISP // Copyright Serial Monitor Ctrl+Shift+M Serial Plotter Ctrl+Shift+L // If you req // http://www // WiFi101 Firmware Updater // This sketc // Board: "Arduino/Genuino Uno" Boards Manager... Port: "COM10 (Arduino/Genuino Uno)" // Pin 10 is // Get Board Info // By default // with the t Programmer: "AVR ISP" // on the ICS Burn Bootloader // 1/ // MISO SCK // .5V (!) Avoid this pin on Due, Zer . . MOSI GND // // On some Arduinos (Uno,...), pins MOSI, MISO and SCK are t // digital pin 11, 12 and 13, respectively. That is why many // you to hook up the target to these pins. If you find this // practical, have a define USE_OLD_STYLE_WIRING. This will // using an Uno. (On an Uno this is not needed). // // Alternatively you can use any other digital pin by config // software ('BitBanged') SPI and having appropriate defines // PIN_MISO and PIN_SCK. 11 Done compiling. Invalid library found in C:\Users\Maayan\Documents\Arduino\li Invalid library found in C:\Users\Maayan\Documents\Arduino\li Invalid library found in C:\Users\Maayan\Documents\Arduino\li < 1 Arduino AVR Boards Arduino Yún Arduino/Genuino Uno Arduino Duemilanove or Diecimila Arduino Nano Arduino/Genuino Mega or Mega 2560 Arduino Mega ADK Arduino Leonardo Arduino Leonardo ETH Arduino/Genuino Micro Arduino Esplora Arduino Mini Arduino Ethernet Arduino Fio Arduino BT LilyPad Arduino USB LilyPad Arduino Arduino Pro or Pro Mini Arduino NG or older Arduino Robot Control Arduino Robot Motor cuments\Ardu cuments\Ardu cuments\Arduv no Uno on COM Step 3 - Type 'minicore' into the search bar and the relevant entry will appear. You'll be able to choose from a list of previous versions, but unless you have a specific goal in mind it's best to opt for the latest. Click 'install' and wait for it to complete. Then close the boards manager window. Boards Manager Type All MiniCore by MCUdude minicore Boards included in this package: ATmega328/P/PA/A/PB, ATmega168/P/PA/A/PB, ATmega88/P/PA/A/PB, ATmega48/P/PA/A/PB, ATmega8. Online help More info 2.0.1 Install Close WORKSHOP TWO SUPPLEMENT DOCUMENT 2. Select your device under the Tools>Board> ATmega328 (instead of Arduino Uno). Make sure the Variant is "328/328A" and the correct port number. Blink | Arduino 1.8.5 File Edit Sketch Tools Help Auto Format Ctrl+T Archive Sketch Blink Fix Encoding & Reload Serial Monitor Ctrl+Shift+M Blink Serial Plotter Ctrl+Shift+L Turns an LE WiFi 101 Firmware Updater cond, repeatedly. Most Arduin it is attac the correct If you want model, chec https://www modified 8 by Scott Fi modified 2 by Arturo G modified 8 by Colby Ne BOD: "BOD 2.7V" Board: "ATmega328" On the UNO, MEGA and ZERO EEPROM: "EEPROM retained" > 6. LED_BUILTIN is set to ed. Variant: "328/ 328A" > nected to on your Arduino Bootloader: "Yes (UARTO)" > > Clock: "External 16 MHz" > Compiler LTO: "LTO disabled" Port > > Get Board Info Programmer: "ArduinolSP" Burn Bootloader This exampl You should be able to upload the code the way as the first workshop./n WORKSHOP 03 CONCURRENCY INVESTIGATION ENG_5_ESD T719 In this workshop, we explore the basic concepts of how to make a microcontroller unit (MCU) perform multiple software activities apparently simultaneously, providing the illusion of concurrent execution. we will consider a system with an MCU, two switches, and an RGB (red, green, blue) LED . . When switch 1 is not pressed, the system displays a repeating sequence of colors (red, then green, then blue). When switch 1 is pressed, the system makes the LED flash white (all LEDs on) and off (all LEDs off) until the switch is released. As long as switch 2 is pressed, faster timing is used for the flashing and RGB sequences. The time delay between the user pressing the switch and seeing the LED flash white is the system's response time for switch 1. A shorter response time is better. How we share the processor's time among the tasks is one of the main factors determining the system's responsiveness. Component Required: (1) x Arduino or Elegoo Uno R3 (1) x Breadboard (4) x M-M wires (Male to Male jumper wires) (1) x RGB LED (3) x 220 ohm resistors (2)x10k ohm resistors (2)x push button switches Component Introduction RGB: At first glance, RGB (Red, Green and Blue) LEDs look just like regular LEDs. However, inside the usual LED package, there are actually three LEDs, one red, one green and yes, one blue. By controlling the brightness of each of the individual LEDs you can mix pretty much any color you want. The RGB LED has four leads. There is one lead going to the positive connection of each of the single LEDs within the package and a single lead that is connected to all three negative sides of the LEDs. Here on the photographs you can see 4 electrode LED. Every separate pin for Green or Blue or Red color is called Anode. You will always connect “+” to it. Cathode goes to “-“(ground). If you connect it other way round the LED will not light. The common negative connection of the LED package is the second pin from the flat side. It is also the longest of the four leads and will be connected to the ground. WORKSHOP 03 CONCURRENCY INVESTIGATION ENG_5_ESD T719 Each LED inside the package requires its own 2200 resistor to prevent too much current flowing through it. The three positive leads of the LEDs (one red, one green and one blue) are connected to UNO output pins using these resistors. RESET BLUE SGREEN CATHODE 3V3 5V NIA DO/RX D1/TX RESET2 AREF IOREF Arduino D2 ww D3 PWM ᎠᏎ D5 PWM D6 PWM D7 AO A1 A2 A3 A4/SDA Uno (Rev3) ICSP D8 D9 PWM A5/SCL D10 PWM/SS 2200 ww D11 PWM/MOSI D12/MISO D13/SCK N/C ICSP2 MISO ICSP2 SCK ICSP2 MOSI Connection Schematic Δ WORKSHOP 03 CONCURRENCY INVESTIGATION ENG_5_ESD T719 Exercise 1 H ELEGOO UNO UNO R3|| TX--1 RX-O Wiring diagram 000 Adding two push button switches to the connection schematic. If you don't know how to do it, read the exercise 2 of workshop one. Build your circuit based on the schematic. You may want to program the Arduino and test if you can light up the RGB LED. It can begin with the modification of the workshop code. Take a photo of your circuit and attach it to your logbook Exercise 2 Download the zip file lab03.zip from the VLE and expand the codes into a folder you created on the desktop. Open the Concurrency_1 folder and sketch files. There are some lines of the code in the setup function need you type in yourself. You can refer to last week's code to get the hint if you don't know how to do it. Or ask the lab instructor. Verify your code and upload to the Arduino if the verifying is successful. Observe the color change of the LED. Press down the button switch one, hold and then release. Write down your observation WORKSHOP 03 CONCURRENCY INVESTIGATION ENG_5_ESD T719 Press button switch two, hold and release, and write down your observations Press both button switches and write down your observations. Exercise 3 Run Concurrency_2, 3, and 4 and repeat the operations of exercise 3 and write down your observations. You might need to change the pin numbers in the circuit for the last three sketches. www 2200 www ww DGND E.CO ELEGOO UNO R3 3: +SV H SW1 Pull Down +5V H SW2 Pull Down You can use this figure to workout connection before you start to build your circuit./n Workshop 04 Digital, analogue input digital and PWM output exercises In workshop 3, we will do three exercises to learn how the Arduino can get the analogue input signals and output the analogue signals. By the end of the workshop, please explain the command we use in this workshop. It will be very helpful for you to the following workshops and even your mini project. Parts Needed (1) Arduino Uno (1) USB A-to-B Cable (1) Breadboard (1) LED 5mm (1) LDR (1) 220 2 Resistor (2) 10k Resistor (1) Active buzzer Jumper Wires Exercise 1 Light Dependent Resistor control the frequency of LED blink In the first exercise, the sketch is based on the LED blinking code from the previous workshop, but instead of using a fixed delay, the rate is determined by a light-sensitive sensor called a light dependent resistor or LDR. Wire the LDR as shown in Figure Lab4- 1 8 DIGITAL 76543250 爻爻 R 22052 Arduino ANALOG 072345 00 00 00 10k vvv www LDR Figure Lab4-1. Arduino with light dependent resistor The following sketch reads the light level of an LDR connected to analog pin 0. The light level striking the LDR will change the blink rate of the the LED connected to pin you choose. const int ledPin = ; // LED connected to digital pin your choose. const int sensorPin = 0; // connect sensor to analog input 0 void setup() pinMode(ledPin, OUTPUT); // enable output on the led pin { } void loop() { } int rate = = analogRead(sensorPin); digitalWrite(ledPin, HIGH); delay(rate); digitalWrite(ledPin, LOW); delay(rate); // read the analog input // set the LED on // wait duration dependent on light level // set the LED off You could add print command in your Arduino code to monitor the value the program reads from the AO port. Add a serial monitor through the Tools menu as shows in the following figure. At same time add two extra line of codes in your program ex1 | Arduino 1.8.19 (Windows Store 1.8.57.0) 3 File Edit Sketch Tools Help 圖 Auto Format Ctrl+T Archive Sketch ex1 Fix Encoding & Reload Manage Libraries... Ctrl+Shift+I Serial Monitor Ctrl+Shift+M const int led Serial Plotter Ctrl+Shift+L const int sen choose. t0 void setup() const int ledPin = 9; // LED connected to digital pin your const int sensorPin = 0; // connect sensor to analog inp void setup() { } Serial.begin(9600); // open the serial port at 9600 bps: pinMode (ledPin, OUTPUT); // enable output on the led pin void loop() { int rate = analogRead(sensorPin); Serial.println(rate); // read the analog in WiFi 101 / WiFiNINA Firmware Updater void setup() Board: "Arduino Uno" Serial.begi pinMode(led Port: "COM7 (Arduino Uno)" > > digitalWrite(ledPin, HIGH); delay(rate); } Get Board Info void loop() // set the LED on // wait duration dependent on light 1 digitalWrite(ledPin, LOW); // set the LED off Programmer: "AVRISP mkll" int rate = put delay(rate); Burn Bootloader } Serial.printantaneey. Figure Lab4-2. Open the Serial Monitor, and add two extra line of codes. Discussion The value of the 10K resistor is not critical. Anything from 1K to 10K can be used. The light level on the LDR will change the voltage level on analog pin 0. The analogRead command provides a value that ranges from around 200 when the LDR is dark to 800 or so when it is very bright. This value determines the duration of the LED on and off times, so the blink time increases with light intensity. Exercise 2 LDR control the frequency of speaker The last exercise is using digital output to switch on and off the light to display the analogue imputes change. In many applications, we need an analogue output to send the control signal to the system. The Arduino using PWM technique for controlling the analogue output. Pulse Width Modulation (PWM) is a technique for controlling power. We can use it here to control the brightness of each of the LEDs. The diagram below shows the signal from one of the PWM pins on the UNO. 5V OV 5V αν 30 5V 1/500 second 1/20 (5%) 10/20 (50%) OV 18/20 (90%) Roughly every 1/500 of a second, the PWM output will produce a pulse. The length of this pulse is controlled by the 'analogWrite' function. So analogWrite(0)' will not produce any pulse at all and 'analogWrite(255)' will produce a pulse that lasts all the way until the next pulse is due, so that the output is actually on all the time. If we specify a value in the analogWrite that is somewhere in between 0 and 255, then we will produce a pulse. If the output pulse is only high for 5% of the time, then whatever we are driving will only receive 5% of fullpower The sketch of exercise 2 is based on the LED blinking code from the exercise 1,but instead of using a delay for LED blinking to sense the change of LDR, here we use an active buzzer sound to demonstrate the LDR resistance change. The wire of the circuit is shown in Figure Lab4-3 DIGITAL Arduino 1654325 ANALOG 072345 10k www www Figure Lab4-3. Connections for a speaker with the LDR circuit const int buzzer = 9; // LED connected to digital pin your choose. const int sensorPin = 0; // connect sensor to analog input 0 void setup() void setup() { } Serial.begin(9600); // open the serial port at 9600 bps: pinMode(buzzer, OUTPUT); // enable output on the led pin void loop() { int rate = analogRead(sensorPin); // read the analog input rate } = rate /4; Serial.println(rate); analogWrite(buzzer, rate); Exercise 3 FADE AN LED WITH PWM By using a PWM pin on the Arduino, you will be able to increase and decrease the intensity of brightness of an LED. Project Diagram Speaker or Piezo Transducer Light Dependent Resistor ZUREY RESET 3v3 5/9 GND GND VIN 40 ANALOG IN RESET ICSP2 AREP DIGITAL (PUM O UNO Arduino ICSP RO 40 ABCD FGHI Project Code 1. Connect the Arduino board to your computer using the USB cable. 2. Open project code 3. Select the board and serial port as outlined in earlier section. 4. Click upload button to send sketch to the Arduino./n WORKSHOP 05 DISTANCE AND TEMPERATURE SENSOR ENG_5_ESD T719 Week 05 Working on Ultrasonic Sensor Module and Temperature Sensor Overview Ultrasonic sensor is great for all kind of projects that need distance measurements, avoiding obstacles as examples. The HC-SR04 is inexpensive and easy to use since we will be using a Library specifically designed for these sensor. DHT11 Temperature and Humidity Sensor. It's accurate enough for most projects that need to keep track of humidity and temperature readings. Again we will be using a Library specifically designed for these sensors that will make our code short and easy to write. This week we will investigate HC-SR04 ultrasonic sensor and DHT11 Temperature and humidity sensor. Exercise 1: Ultrasonic Sensor Module Component Required: (1) x Elegoo Uno R3 (1) x Ultrasonic sensor module (4) x F-M wires (Female to Male DuPontwires) Component Introduction O T HC-SRO4 Ultrasonic sensor Ultrasonic sensor module HC-SR04 provides 2cm-400cm non-contact measurement function, the ranging accuracy can reach to 3mm. The modules includes ultrasonic transmitters, receiver and control circuit. The basic principle of work: (1) Using IO trigger for at least 10us high level signal, (2) The Module automatically sends eight 40 kHz and detect whether there is a pulse signal back. (3) IF the signal back, through high level, time of high output IO duration is the time from sending ultrasonic tore turning. Test distance= (high level time x velocity of sound (340m/s)/2 R WORKSHOP 05 DISTANCE AND TEMPERATURE SENSOR ENG_5_ESD T719 The Timing diagram is shown below. You only need to supply a short 10us pulse to the trigger input to start the ranging, and then the module will send out an 8 cycle burst of ultrasound at 40 kHz and raise its echo. The Echo is a distance object that is pulse width and the range in proportion .You can calculate the range through the time interval between sending trigger signal and receiving echo signal. Formula: us / 58 = centimeters or us / 148 =inch; or: the range = high level time velocity (340M/S) / 2; we suggest to use over 60ms measurement cycle, in order to prevent trigger signal to the echosignal. * 10uS TTL Timing Diagram Trigger Input to Module 8 Cycle Sonic Burst Sonic Burst from Module Echo Pulse Output to User Timeing Circuit Connection Schematic RESET RESET2 AREF 3V3 5V NIA DO/RX D1/TX Input TTL lever signal with a range in proportion D2 ioref D3 PWM ᎠᏎ VCC AO D5 PWM A1 D6 PWM Arduino A2 A3 Uno (Rev3) D7 Trig D8 A4/SDA D9 PWM Echo A5/SCL D10 PWM/SS D11 PWM/MOSI D12/MISO D13/SCK GND HC-SR04 WORKSHOP 05 DISTANCE AND TEMPERATURE SENSOR ENG_5_ESD T719 Code Using a Library designed for these sensors will make our code short and simple. We include the library at the beginning of our code, and then by using simple commands we can control the behavior of the sensor. After wiring, please download the code from VLE and open the program in the code folder and click UPLOAD to upload the program. Open the Serial monitor and record your observation. Test with your hand or other object to see if the sensor can detect the distance correctly or not. Comment on your observation. Exercise 2 DHT11 Temperature and Humidity Sensor Component Required: (1) x Elegoo Uno R3 (1) x DHT11 Temperature and Humiditymodule (3) x F-M wires (Female to Male DuPontwires) Component Introduction Temp and humidity sensor: DHT11 pins 1 VCC 2 DATA 3 NC 4 GND 1 2 3 DHT11 digital temperature and humidity sensor is a composite Sensor which contains a calibrated digital signal output of the temperature and humidity. The dedicated digital modules collection technology and the temperature and humidity sensing technology are applied to ensure that the product has high reliability and WORKSHOP 05 DISTANCE AND TEMPERATURE SENSOR ENG_5_ESD T719 excellent long-term stability. The sensor includes a resistive sense of wet components and a NTC temperature measurement devices, and connects with a high-performance 8-bit microcontroller. Applications: HVAC, dehumidifier, testing and inspection equipment, consumer goods, automotive, automatic control, data loggers, weather stations, home appliances, humidity regulator, medical and other humidity measurement and control. Product parameters Relative humidity: Resolution: 16Bit Repeatability: ±1% RH Accuracy: At 25°C ±5% RH Interchangeability: fully interchangeable Response time: 1/e (63%) of 25°C 6s 1m/s air 6s Hysteresis: <± 0.3% RH Long-term stability: <± 0.5% RH / yr in Temperature: Resolution: 16Bit Repeatability: ±0.2°C Range: At 25°C ±2°C Response time: 1/e (63%) 10S Electrical Characteristics Power supply: DC3.5~5.5V Supply Current: measurement 0.3mA standby 60μА Sampling period: more than 2 seconds Pin Description: 1. the VDD power supply 3.5~5.5V DC 2. DATA serial data, a single bus 3. NC, empty pin 4. GND ground, the negative power N/C RESET RESET2 AREF ioref 3V3 WORKSHOP 05 DISTANCE AND TEMPERATURE SENSOR 5V Connection Schematic VIN DO/RX D1/TX D2 D3 PWM D4 D5 PWM DATA VCC AO A1 D6 PWM A2 A3 Arduino Uno (Rev3) D7 D8 A4/SDA D9 PWM A5/SCL D10 PWM/SS GND D11 PWM/MOSI D12/MISO D13/SCK As you can see we only need 3 connections to the sensor, since one of the pin is not used. The connections are: Voltage, Ground and Signal which can be connected to any Pin on our UNO. GND Code After wiring, please open the program in the code folder ex2 and click UPLOAD to upload the program. If the Upload is successful, the program then open the monitor, we can see the data as below: (It shows the temperature of the environment, we can see it is the degree of lab T719). You may need to install the ENG_5_ESD T719 DHT11/n Workshop 06 DC Motors Controller Overview In this workshop, you will learn how to control a small DC motor using an UNO R3 and a transistor. Component Required: (1) x Elegoo Uno R3 (1) x 830 tie-pointsbreadboard (1) x L293D IC (1) x Fan blade and 3-6v motor (5) x M-M wires (Male to Male jumperwires) (1) x Power Supply Module (1) x 9V1A adapter (1) 9V battery with snap on connector (1) x Potential Meter Component Introduction Breadboard Power Supply The small DC motor is likely to use more power than an UNO R3 board digital output can handle directly. If we tried to connect the motor straight to an UNO R3 board pin, there is a good chance that it could damage the UNO R3 board. So we use a power supply module provides power supply 545043 ZELEGO NE OS GND 00 FOOD 3.30 50 εε 110 ng M DC-1n Product Specifications: . Locking On/Off Switch • LED Power Indicator Input voltage: 6.5-9v (DC) via 5.5mm x 2.1mm plug • Output voltage: 3.3V/5v • Maximum output current: 700 mA • Independent control rail output. Ov, 3.3v, 5v to breadboard Output header pins for convenient external use Size: 2.1 in x 1.4 in USB device connector onboard to power external device Setting up outputvoltage: DC-1n 50 OFF 3.3 3.30 ng GND ID 545043 ZELEGO 5V OFF 3.3 5V 3.3V The left and right voltage output can be configured independently. To select the output voltage, move jumper to the corresponding pins. Note: power indicator LED and the breadboard power rails will not power on if both jumpers are in the "OFF" position. 50 25 GND Th h 545013 38 BELEGO 20 00 00 00 3.30 50 GND DC-10 515013 BELEGO Important note: Make sure that you align the module correctly on the breadboard. The negative pin(-) on module lines up with the blue line(-) on breadboard and that the positive pin(+) lines up with the red line(+). Failure to do so could result in you accidently reversing the power to your project L293D This is a very useful chip. can actually control two motors independently. We are just using half the chip in this lesson, most of the pins on the right hand side of the chip are for controlling a second motor. 0862 Product Specifications: • Featuring Unitrode L293 and L293D Products Now From Texas Instruments • Wide Supply-Voltage Range: 4.5 V to 36 V • Separate Input-Logic Supply • Internal ESD Protection • Thermal Shutdown • • High-Noise-Immunity Inputs Functionally Similar to SGS L293 and SGS L293D • Output Current 1 A Per Channel (600 mA for L293D) • Peak Output Current 2 A Per Channel (1.2 A for L293D) • Output Clamp Diodes for Inductive T ransient Suppression (L293D) Enable 1 In 1 16 +V 15 In 4 3 14 Out 1 (Controlled by Enable 1) Out 4 (Controlled by Enable 2). 13 OV L293D OV 5 12 OV OV 6 11 Out 2 (Controlled by Enable 1) Out 3 (Controlled by Enable 2). 7 10 In 2 +Vmotor In 3 Enable 2 9 Description/ordering information The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications. All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled, and their outputs are active and in phase with their inputs. When the enable input is low, those drivers are disabled, and their outputs are off and in the high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications. Block diagram Q1 Vcc H 14 Q2 Z M -Q4 Q1 Q3 Q2 Vcc VCC1 M 本 Q4 Q3 Fig. 4.1 H-bridge and the direction of motor Vcc2 There are 3 wires connected to the Arduino, 2 wires connected to the motor, and 1 wire connected to a battery. Note: Pin 16 must be supplied with current, the L293D can work normally. L293D M1 PWM-1 16 Battery +ve M1 direction 0/1 2 15 M2 direction 0/1 M1 +ve 3 14 M2 +ve GND 4 13 GND GND 5 12 GND M1 -ve 6 11 M2 -ve M1 direction 1/0-7 10 M2 direction 1/0 Battery +ve 8 9 M2 PWM Motor 1 Motor 2 To use this pinout: The left hand side deals with the first motor, the right hand side deals with a second motor. Yes, you can run it with only one motor connected. Arduino Connections M1 PWM - connect this to a PWM pin on the Arduino. They're labelled on the Uno, pin 5 is an example. Output any integer between 0 and 255, where 0 will be off, 128 is half speed and 255 is max speed. M1 direction 0/1 and M1 direction 1/0 - Connect these two to two digital Arduino pins. Output one pin as HIGH and the other pin as LOW, and the motor will spin in one direction. Reverse the outputs to LOW and HIGH, and the motor will spin in the other direction./n Workshop 06 LCD1602 Screen & Servo Motor Control Exercise 1 Use LCD 1602 screen. An LCD is a liquid crystal display that is able to display text on its screen. In this project, you should see the words "Hello, Testing" displayed on the screen. The potentiometer is used to adjust the contrast of the display. Parts Needed (1) Arduino Uno (1) USB A-to-B Cable (1) Breadboard - Half Size (1) LCD Screen (1) Potentiometer (16) Jumper Wires Project Diagram 5 VDC GND LCD1602 Display 1 GND Bright RW RS EN Anode 2 5 VDC Cathode 3 Bright 4 RS Data 5 RW 6 EN 7 DO 8 D1 9 D2 10 D3 11 D4 12 D5 13 D6 14 D7 15 Anode 16 Cathode https://dronebotworkshop.com 1. GND – This is the Ground pin. On some modules it is labeled VSS. 2. 5 VDC - This is the 5 volt power connection. On some modules it is labeled VDD. 3. Brightness – This is the input for the brightness control voltage, which varies between 0 and 5 volts to control the display brightness. On some modules this pin is labeled V0. 4. RS - This is the Register Select pin. It controls whether the input data is meant to be displayed on the LCD or used as control characters. 5. RW - Puts the LCD in either Read or Write mode. In most cases you'll be using Read mode so this pin can be tied permanently to ground. 6. EN - The Enable pin. When High it reads the data applied to the data pins. When low it executes the commands or displays the data. 7. DO- Data input 0. 8. D1 - Data input 1. 9. D2 Data input 2. 10. D3 - Data input 3. 11. D4 – Data input 4. 12. D5 - Data input 5. 13. D6 – Data input 6. 14. D7 - Data input 7. 15. A - The Anode (positive voltage) connection to the backlight LED. 16. K – The Cathode (ground or negative voltage) connection to the backlight LCD. Wire Mode Because the LCD module uses a parallel data input it requires 8 connections to the host microcontroller for the data alone. Add that to the other control pins and it consumes a lot of connections. On an Arduino Uno half of the I/O pins would be taken up by the display, which can be problematic if you want to use the I/O pins for other input or output devices. One way of reducing the number of connections required is to use 4-wire mode, and most projects that make use of this display do exactly that. In 4-wire mode the data is sent a half a byte at a time, thus requiring only 4 data connections. The upper half of the data input (D4 to D7) is used while the other pins are not connected to anything. ZUREY RESET 313 SV GND AND 3 VIN ANALOG IN RESET ARCY DIGITAL O UNO Arduino ICSP */ LCD § This sketch will show you how to connect an LCD to your Arduino and display any data you wish. // Load the LiquidCrystal library, which will give us // commands to interface to the LCD: #include <LiquidCrystal.h> // Initialize the library with the pins we're using. // (Note that you can use different pins if needed.) // See http://arduino.cc/en/Reference/Liquid Crystal // for more information: Liquid Crystal lcd (12, 11, 5, 4, 3, 2); void setup() { lcd.begin(16, 2); // Initialize the 16x2 LCD lcd.clear(); //Clear any old data displayed on the LCD lcd.print "Hello, Testing"); // Display a message on the LCD! } void loop() { } lcd.setCursor(0, 1); // Set the (invisible) cursor to column 0, // row 1. lcd.print (millis() 10); //Print the number of 10 ms //since the Arduino last reset. How to change the code to count "seconds"? Exercise 2: Servo motor control In this project, you will be able to sweep a servo back and forth through its full range of motion. Parts Needed (1) Arduino Uno (1) USB A-to-B Cable (1) Breadboard - Half Size (1) Continuous rotation servo motor (6) Jumper Wires Project Continuous Rotation Servo Motor Timing In a continuous rotation servo motor the same PWM signals will cause the motor to perform differently. Servo Motors Continuous Rotation Servo 1.5 ms 1.0 ms 2.0 ms [20 ms Diagram not to scale Stop CCW CW https://dronebotworkshop.com ■ A pulse width of 1.5ms will cause the servo shaft stop spinning. ■ ■ A pulse width of 1ms will cause the servo shaft to spin at full speed counter-clockwise. A pulse width of 2ms will cause the servo shaft to spin at full speed clockwise. Varying the pulse width between 1ms and 1.5ms will make the motor spin counter clockwise with the shorter pulse widths causing the motor to spin faster. Varying the pulse width between 1.5ms and 2ms will cause the motor to rotate clockwise with the longer pulses resulting in a faster speed. Commercial continuous rotation servo motors will have an adjustment potentiometer that can be used to zero the speed when the motor is feed a 1.5ms pulse width. COREY RESET 343 VIN wwwww RESET ICSPR O UNO Arduino ICSP SERVO Servo-simple #include <Servo.h> Servo servoMain; void setup() { } servoMain.attach (9); void loop() { servoMain.write(180); // full speed anti-clockwise rotation delay(1000); servoMain.write(0); // full speed clockwise rotation delay(1000); servoMain.write(95); //stop delay(1000); servoMain.write(80); // low speed clockwise rotation delay(1000); servoMain.write(105); // low speed anti-clockwise rotation delay(1000); } Control servo by a potentiometer/nWORKSHOP MANUAL I have also uploaded a file that introduces an Arduino simulator you can use for your workshop exercises. You need to maintain a logbook for your workshop. It could be a physical one or an electronic one. Make sure that your comments on each line of the codes in the first four weeks at least.See Answer

TutorBin Testimonials

I found TutorBin Arduino homework help when I was struggling with complex concepts. Experts provided step-wise explanations and examples to help me understand concepts clearly.

Rick Jordon

5

TutorBin experts resolve your doubts without making you wait for long. Their experts are responsive & available 24/7 whenever you need Arduino subject guidance.

Andrea Jacobs

5

I trust TutorBin for assisting me in completing Arduino assignments with quality and 100% accuracy. Experts are polite, listen to my problems, and have extensive experience in their domain.

Lilian King

5

I got my Arduino homework done on time. My assignment is proofread and edited by professionals. Got zero plagiarism as experts developed my assignment from scratch. Feel relieved and super excited.

Joey Dip

5

TutorBin helping students around the globe

TutorBin believes that distance should never be a barrier to learning. Over 500000+ orders and 100000+ happy customers explain TutorBin has become the name that keeps learning fun in the UK, USA, Canada, Australia, Singapore, and UAE.