![]() ![]() RED WIRE: positive supply voltage (5 V).The angle range is between 0 and 180 degrees. The type of servo motor provided to you in this project allows the motor angle to be controlled using a PWM signal. Using the oscilloscope, take a clear photograph of the PWM waveform during each of the four phases of the sequence.ĮVIDENCE ITEM 2: Add the 4 oscilloscope photos to your report document.Use the oscilloscope to measure the frequency of the PWM waveform.Upload the following code to the Arduino Nano and verify that the LED brightness is varying as shown in the example video provided below.The example below cycles the LED through four different levels of brightness by varying the duty cycle of the PWM signal (0%, 20%, 50% and 100%). When pin D3 outputs PWM (as in the example below), the frequency of the PWM signal is fixed at 490 Hz. As explained in the analogWrite documentation, this function can only be used with certain digital i/o pins. The simplest way to produce PWM signals with the Arduino Nano is using the analogWrite() function from the Arduino library. Servo motor with 3-pin connector for attaching to breadboard. Take a clear photograph of your breadboard circuit.ĮVIDENCE ITEM 1: Add your breadboard photograph to your report document.Build the following circuit on your breadboard.Please note that the servo motor must be returned at the end of the each lab session. Your lab supervisor will provide you with a servo motor. Part 1: Circuit constructionīuild the following circuit on your breadboard. Only two files should be submitted to Brightspace: the Word document and the video file. The fourth evidence item is a video file, which can be uploaded to Brightspace separately.Include your name and student number at the beginning of the Word document. Please collect all of these in a single Word document. The first three evidence items consist of photographs (details below).Each part specifies an evidence item you will need to submit. Download the ATmega328P datasheet PDF and explore the chapter entitled “16-bit Timer/Counter1 with PWM”.In particular, try to use the datasheet to make sense of lines of code you don’t understand in the example programs provided below. However, we’re really only scratching the surface, so you are strongly encouraged to use this opportunity to begin exploring the ATmega328P datasheet to learn about the many other available options. In this project, we program the ATmega328P at the register level to exploit a small part of this functionality. The ATmega328P microcontroller (which the Arduino Nano is based on) provides a vast array of different functionality, including numerous options for producing PWM signals (and related signals). You will use the oscilloscope to verify that the PWM signals are being produced as expected. You will program the Arduino Nano to control the period and duty cycle (pulse width) of the PWM signals it produces. In this project, you will use pulse width modulation (PWM) to control the brightness of an LED and the angle of a servo motor. ![]() Project type: individual (but feel free to help each other) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |