Elegoo EL-KIT-001 Manual

Elegoo EL-KIT-001 Manual

The most complete starter kit

Advertisement

THE MOST COMPLETE STARTER KIT
TUTORIAL FOR UNO
V1.0.19.01.23

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the EL-KIT-001 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Elegoo EL-KIT-001

  • Page 1 THE MOST COMPLETE STARTER KIT TUTORIAL FOR UNO V1.0.19.01.23...
  • Page 2 Preface Our Company Established in 2011, Elegoo Inc. is a thriving technology company dedicated to open- source hardware research & development, production and marketing. Located in Shenzhen, the Silicon Valley of China, we have grown to over 150+ employees with a 10,763+ square ft.
  • Page 3 EUservice@elegoo.com. We look forward to hearing from you and any of your critical comment or suggestion would be much valuable to us. And any of problems and questions you have with our products will be promptly...
  • Page 4 4 / 223...
  • Page 5 5 / 223...
  • Page 6 6 / 223...
  • Page 7 7 / 223...
  • Page 8 8 / 223...
  • Page 9 9 / 223...
  • Page 10: Table Of Contents

    Content Lesson 0 Installing IDE ......................12 Lesson 1 Add Libraries and Open Serial Monitor ..............23 Lesson 2 Blink ........................... 32 Lesson 3 LED ..........................43 Lesson 4 RGB LED ........................50 Lesson 5 Digital Inputs ......................59 Lesson 6 Active buzzer ......................64 Lesson 7 Passive Buzzer ......................
  • Page 11 Lesson 28 Four Digital Seven Segment Display ..............186 Lesson 29 DC Motors ......................191 Lesson 30 Relay ........................201 Lesson 31 Stepper Motor ...................... 206 Lesson 32 Controlling Stepper Motor With Remote ............214 Lesson 33 Controlling Stepper Motor With Rotary Encoder ..........218 11 / 223...
  • Page 12: Lesson 0 Installing Ide

    Lesson 0 Installing IDE Introduction The Arduino Integrated Development Environment (IDE) is the software side of the Arduino platform. In this lesson, you will learn how to setup your computer to use Arduino and how to set about the lessons that follow. The Arduino software that you will use to program your Arduino is available for Windows, Mac and Linux.
  • Page 13 STEP2:Download the development software that is compatible with the operating system of your computer. Take Windows as an example here. Click Windows Installer. Click JUST DOWNLOAD. 13 / 223...
  • Page 14 Also version 1.8.0 is available in the material we provided, and the versions of our materials are the latest versions when this course was made. Installing Arduino (Windows) Install Arduino with the exe. Installation package. Click I Agree to see the following interface 14 / 223...
  • Page 15 Click Next You can press Browse… to choose an installation path or directly type in the directory you want. 15 / 223...
  • Page 16 Click Install to initiate installation Finally, the following interface appears, click Install to finish the installation. Next, the following icon appears on the desktop 16 / 223...
  • Page 17 Double-click to enter the desired development environment You may directly choose the installation package for installation and skip the contents below and jump to the next section. But if you want to learn some methods other than the installation package, please continue to read the section. Unzip the zip file downloaded, Double-click to open the program and enter the desired development environment 17 / 223...
  • Page 18 18 / 223...
  • Page 19 However, this installation method needs separate installation of driver. The Arduino folder contains both the Arduino program itself and the drivers that allow the Arduino to be connected to your computer by a USB cable. Before we launch the Arduino software, you are going to install the USB drivers. Plug one end of your USB cable into the Arduino and the other into a USB socket on your computer.
  • Page 20 Right-click on the device and select the top menu option (Update Driver Software...). You will then be prompted to either ‘Search Automatically for updated driver software’ or ‘Browse my computer for driver software’. Select the option to browse and navigate to the X\arduino1.8.0\drivers. 20 / 223...
  • Page 21 Click 'Next' and you may get a security warning, if so, allow the software to be installed. Once the software has been installed, you will get a confirmation message. Windows users may skip the installation directions for Mac and Linux systems and jump to Lesson 1.
  • Page 22 Installing Arduino (Linux) You will have to use the make install command. If you are using the Ubuntu system, it is recommended to install Arduino IDE from the software center of Ubuntu. TIPS: If you have problems in installing the drivers, please refer to the UNO R3, MEGA, NANO DRIVER FAQ.
  • Page 23: Lesson 1 Add Libraries And Open Serial Monitor

    Lesson 1 Add Libraries and Open Serial Monitor Installing Additional Arduino Libraries Once you are comfortable with the Arduino software and using the built-in functions, you may want to extend the ability of your Arduino with additional libraries. What are Libraries? Libraries are a collection of code that makes it easy for you to connect to a sensor, display, module, etc.
  • Page 24 Then the library manager will open and you will find a list of libraries that are already installed or ready for installation. In this example we will install the Bridge library. Scroll the list to find it, then select the version of the library you want to install. Sometimes only one version of the library is available.
  • Page 25 Finally click on install and wait for the IDE to install the new library. Downloading may take time depending on your connection speed. Once it has finished, an Installed tag should appear next to the Bridge library. You can close the library manager.
  • Page 26 You will be prompted to select the library you would like to add. Navigate to the .zip file's location and open it. 26 / 22...
  • Page 27 Return to the Sketch > Import Library menu. You should now see the library at the bottom of the drop-down menu. It is ready to be used in your sketch. The zip file will have been expanded in the libraries folder in your Arduino sketches directory. NB: the Library will be available to use in sketches, but examples for the library will not be exposed in the File >...
  • Page 28 "ArduinoParty", uncompress ArduinoParty.zip. It should contain a folder calledArduinoParty, with files like ArduinoParty.cpp and ArduinoParty.h inside. (If the .cpp and .h files aren't in a folder, you'll need to create one. In this case, you'd make a folder called "ArduinoParty" and move into it all the files that were in the ZIP file, like ArduinoParty.cpp and ArduinoParty.h.) Drag the ArduinoParty folder into this folder (your libraries folder).
  • Page 29 Arduinos and other microcontrollers, they decided to include a serial terminal with the software. Within the Arduino environment, this is called the Serial Monitor. Making a Connection Serial monitor comes with any and all version of the Arduino IDE. To open it, simply click the Serial Monitor icon.
  • Page 30 Once open, you should see something like this: 30 / 223...
  • Page 31 Settings The Serial Monitor has limited settings, but enough to handle most of your serial communication needs. The first setting you can alter is the baud rate. Click on the baud rate drop-down menu to select the correct baud rate. (9600 baud) Last, you can set the terminal to Autoscroll or not by checking the box in the bottom left corner.
  • Page 32: Lesson 2 Blink

    In this lesson, you will learn how to program your UNO R3 controller board to blink the Arduino’s built-in LED, and how to download programs by basic steps. Component Required: (1) x Elegoo Uno R3 Principle The UNO R3 board has rows of connectors along both sides that are used to connect to several electronic devices and plug-in 'shields' that extends its capability.
  • Page 33 You may find that your UNO R3 board's 'L' LED already blinks when you connect it to a USB plug. This is because the boards are generally shipped with the 'Blink' sketch pre-installed. In this lesson, we will reprogram the UNO R3 board with our own Blink sketch and then change the rate at which it blinks.
  • Page 34 When the sketch window opens, enlarge it so that you can see the entire sketch in the window. The example sketches included with the Arduino IDE are 'read-only'. That is, you can upload them to an UNO R3 board, but if you change them, you cannot save them as the same file.
  • Page 36 You have saved your copy of 'Blink' in your sketchbook. This means that if you ever want to find it again, you can just open it using the File > Sketchbook menu option. 36 / 223...
  • Page 37 Attach your Arduino board to your computer with the USB cable and check that the 'Board Type' and 'Serial Port' are set correctly. 37 / 223...
  • Page 38 38 / 223...
  • Page 39 Note: The Board Type and Serial Port here are not necessarily the same as shown in picture. If you are using 2560, then you will have to choose Mega 2560 as the Board Type, other choices can be made in the same manner. And the Serial Port displayed for everyone is different, despite COM 26 chosen here, it could be COM3 or COM4 on your computer.
  • Page 40 Finally, the staus will change to 'Done'. The other message tells us that the sketch is using 928 bytes of the 32,256 bytes available.After the 'Compiling Sketch..' stage you could get the following error message: It can mean that your board is not connected at all, or the drivers have not been installed (if necessary) or that the wrong serial port is selected.
  • Page 41 The Sketch start with: Blink Turns an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. http://www.arduino.cc/en/Tutorial/Blink // the setup function runs once when you press reset or power the board Those are comments, Anything between the /* and */ is ignored by the Arduino completely, and that is block comment.
  • Page 42 You are now going to make your LED blink faster. As you might have guessed, the key to this lies in changing the parameter in () for the 'delay' command. This delay period is in milliseconds, so if you want the LED to blink twice as fast, change the value from 1000 to 500.
  • Page 43: Lesson 3 Led

    In this lesson, you will learn how to change the brightness of an LED by using different values of resistor. Component Required: (1) x Elegoo Uno R3 (1) x 5mm red LED (1) x 220 ohm resistor (1) x 1k ohm resistor...
  • Page 44 Breadboards come in various sizes and configurations. The simplest kind is just a grid of holes in a plastic block. Inside are strips of metal that provide electrical connection between holes in the shorter rows. Pushing the legs of two different components into the same row joins them together electrically.
  • Page 45 If you do not use a resistor with an LED, then it may well be destroyed almost immediately, as too much current will flow through, heating it and destroying the 'junction' where the light is produced. There are two ways to tell which is the positive lead of the LED and which the negative.
  • Page 46 Unlike LEDs, resistors do not have a positive and negative lead. They can be connected either way around. If you find this approach method too complicated, you can read the color ring flag on our resistors directly to determine its resistance value. Or you may use a digital multimeter instead.
  • Page 47 Connection Schematic 47 / 223...
  • Page 48 Wiring diagram 48 / 223...
  • Page 49 The UNO is a convenient source of 5 volts, which we will use to provide power to the LED and the resistor. You do not need to do anything with your UNO, except to plug it into a USB cable. With the 220 Ω...
  • Page 50: Lesson 4 Rgb Led

    Blue and finally back to the Red color. By doing this we will cycle through most of the color that can be achieved. Component Required: (1) x Elegoo Uno R3 (1) x 830 Tie Points Breadboard (4) x M-M wires (Male to Male jumper wires)
  • Page 51 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.
  • Page 52 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.
  • Page 53 COLOR: The reason that you can mix any color you like by varying the quantities of red, green and blue light is that your eye has three types of light receptor in it (red, green and blue). Your eye and brain process the amounts of red, green and blue and convert it into a color of the spectrum.
  • Page 54 Theory (PWM) Pulse Width Modulation (PWM) is a technique for controlling power. We also 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. Roughly every 1/500 of a second, the PWM output will produce a pulse.
  • Page 55 Connection Schematic 55 / 223...
  • Page 56 Wiring diagram 56 / 223...
  • Page 57 Code After wiring, please open the Sketch in folder path: Tutorial > English > code > Lesson 4 RGB LED > RGB_LED, and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors. The sketch starts by specifying which pins are going to be used for each of the colors: // Define Pins #define BLUE 3...
  • Page 58 Before we take a look at the 'loop' function, let’s look at the last function in the sketch. The define variables redValue = 255; // choose a value between 1 and 255 to change the color. greenValue = 0; blueValue = 0; This function takes three arguments, one for the brightness of the red, green and blue LEDs.
  • Page 59: Lesson 5 Digital Inputs

    Pressing the button will turn the LED on; pressing the other button will turn the LED off. Component Required: (1) x Elegoo Uno R3 (1) x 830 Tie-points Breadboard (1) x 5mm red LED (1) x 220 ohm resistor...
  • Page 60 Connection Schematic 60 / 223...
  • Page 61 Wiring diagram 61 / 223...
  • Page 62 Although the bodies of the switches are square, the pins protrude from opposite sides of the switch. This means that the pins will only be far enough apart when they are placed correctly on the breadboard. Remember that the LED has to have the shorter negative lead to the left. Code After wiring,please open program in the code folder- Lesson 5 Digital Inputs, and press UPLOAD to upload the program.
  • Page 63 digitalWrite(ledPin, LOW); In the 'loop' function there are two 'if' statements. One for each button. Each does an 'digitalRead' on the appropriate input. Remember that if the button is pressed, the corresponding input will be LOW, if button A is low, then a 'digitalWrite' on the ledPin turns it on. Similarly, if button B is pressed, a LOW is written to the ledPin.
  • Page 64: Lesson 6 Active Buzzer

    Lesson 6 Active buzzer Overview In this lesson, you will learn how to generate a sound with an active buzzer. Component Required: (1) x Elegoo Uno R3 (1) x Active buzzer (2) x F-M wires (Female to Male DuPont wires) Component Introduction BUZZER: Electronic buzzers are DC-powered and equipped with an integrated circuit.
  • Page 65 Connection Schematic 65 / 223...
  • Page 66 Wiring diagram 66 / 223...
  • Page 67 Code After wiring, please open the program in the code folder- Lesson 6 Making Sounds and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors. Example picture 67 / 223...
  • Page 68: Lesson 7 Passive Buzzer

    0.5 seconds: from Alto Do (523Hz), Re (587Hz), Mi (659Hz), Fa (698Hz), So (784Hz), La (880Hz), Si (988Hz) to Treble Do (1047Hz). Component Required: (1) x Elegoo Uno R3 (1) x Passive buzzer (2) x F-M wires (Female to Male DuPont wires)
  • Page 69 Connection Schematic 69 / 223...
  • Page 70 Wiring diagram 70 / 223...
  • Page 71 Wiring the buzzer connected to the UNO R3 board, the red (positive) to the pin8, black wire (negative) to the GND. Code After wiring, please open the program in the code folder- Lesson 7 Passive Buzzer and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors.
  • Page 72: Lesson 8 Tilt Ball Switch

    In this lesson, you will learn how to use a tilt ball switch in order to detect small angle of inclination. Component Required: (1) x Elegoo Uno R3 (1) x Tilt Ball switch (2) x F-M wires (Female to Male DuPont wires)
  • Page 73 Connection Schematic 73 / 223...
  • Page 74 Wiring diagram 74 / 223...
  • Page 75 Code After wiring, please open the program in the code folder- Lesson 8 Ball Switch and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors. Example picture 75 / 223...
  • Page 76: Lesson 9 Servo

    5v port, and the orange one is the signal wire and should be connected to the Dig #9 port. Component Required: (1) x Elegoo Uno R3 (1) x Servo (SG90) (3) x M-M wires (Male to Male jumper wires)
  • Page 77 Connection Schematic 77 / 223...
  • Page 78 Wiring diagram 78 / 223...
  • Page 79 Code After wiring, please open the program in the code folder- Lesson 9 Servo and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors. Before you can run this, make sure that you have installed the < Servo> library or re-install it, if necessary.
  • Page 80: Lesson 10 Ultrasonic Sensor Module

    The HC-SR04 is inexpensive and easy to use since we will be using a Library specifically designed for these sensor. Component Required: (1) x Elegoo Uno R3 (1) x Ultrasonic sensor module (4) x F-M wires (Female to Male DuPont wires)
  • Page 81 Connection Schematic 81 / 223...
  • Page 82 Wiring diagram 82 / 223...
  • Page 83 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 open the program in the code folder- Lesson 10 Ultrasonic Sensor Module and click UPLOAD to upload the program.
  • Page 84 Open the monitor then you can see the data as blow: Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are introduced in details in Lesson 1. 84 / 223...
  • Page 85: Lesson 11 Membrane Switch Module

    In this way, they are more efficient than linear keypads, being that they have less wiring. Component Required: (1) x Elegoo Uno R3 (1) x Membrane switch module (8) x M-M wires (Male to Male jumper wires)
  • Page 86 Connection Schematic 86 / 223...
  • Page 87 Wiring diagram 87 / 223...
  • Page 88 When connecting the pins to the UNO R3 board, we connect them to the digital output pins, D9-D2. We connect the first pin of the keypad to D9, the second pin to D8, the third pin to D7, the fourth pin to D6, the fifth pin to D5, the sixth pin to D4, the seventh pin to D3, and the eighth pin to D2.
  • Page 89 Example picture 89 / 223...
  • Page 90 With this code, once we press a key on the keypad, it should show up on the serial monitor of the Arduino software once the code is compiled and uploaded to the UNO R3 board. Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are introduced in details in Lesson 1.
  • Page 91: Lesson 12 Dht11 Temperature And Humidity Sensor

    Again we will be using a Library specifically designed for these sensors that will make our code short and easy to write. Component Required: (1) x Elegoo Uno R3 (1) x DHT11 Temperature and Humidity module (3) x F-M wires (Female to Male DuPont wires)
  • Page 92 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.
  • Page 93 Connection Schematic 93 / 223...
  • Page 94 Wiring diagram 94 / 223...
  • Page 95 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. Code After wiring, please open the program in the code folder- Lesson 12 DHT11 Temperature and Humidity Sensor and click UPLOAD to upload the program.
  • Page 96 Upload 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 22 degree) Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are introduced in details in Lesson 1.
  • Page 97: Lesson 13 Analog Joystick Module

    Analog joysticks are a great way to add some control in your projects. In this tutorial we will learn how to use the analog joystick module. Component Required: (1) x Elegoo Uno R3 (1) x Joystick module (5) x F-M wires (Female to Male DuPont wires)
  • Page 98 Connection Schematic 98 / 223...
  • Page 99 Wiring diagram 99 / 223...
  • Page 100 We need 5 connections to the joystick. The connections are: Key, Y, X, Voltage and Ground. “Y and X” are Analog and “Key” is Digital. If you don’t need the switch then you can use only 4 pins. Code After wiring, please open the program in the code folder- Lesson 13 Analog Joystick Module and click UPLOAD to upload the program.
  • Page 101 Open the monitor then you can see the data as blow: Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are introduced in details in Lesson 1. 101 / 223...
  • Page 102: Lesson 14 Ir Receiver Module

    Component Required: (1) x Elegoo Uno R3 (1) x IR receiver module (1) x IR remote (3) x F-M wires (Female to Male DuPont wires)
  • Page 103 IR detectors are digital out - either they detect 38KHz IR signal and output low (0V) or they do not detect any and output high (5V). Photocells act like resistors, the resistance changes depending on how much light they are exposed to. What You Can Measure As you can see from these datasheet graphs, the peak frequency detection is at 38 KHz and the peak LED color is 940 nm.
  • Page 104 Connection Schematic 104 / 223...
  • Page 105 Wiring diagram 105 / 223...
  • Page 106 There are 3 connections to the IR Receiver. The connections are: Signal, Voltage and Ground. The “-” is the Ground, “S” is signal, and middle pin is Voltage 5V. Code After wiring, please open the program in the code folder- Lesson 14 IR Receiver Module and click UPLOAD to upload the program.
  • Page 107 Open the monitor then you can see the data as blow: Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are introduced in details in Lesson 1. 107 / 223...
  • Page 108: Lesson 15 Max7219 Led Dot Matrix Module

    Since these modules use the MAX7219 LED driver chip, we will be able to turn on and off the 64 LEDs of each module, using only 3 pins on our UNO. Component Required: (1) x Elegoo Uno R3 (1) x Max7219 module (5) x F-M wires (Female to Male DuPont wires)
  • Page 109 Connection Schematic 109 / 223...
  • Page 110 Wiring diagram 110 / 223...
  • Page 111 VCC and Ground are connected to the Arduino. Pin 12 is connected to DIN, Pin 11 is connected to CS and Pin 10 is connected to CLK. Code Our Sketch will make use of the “Maxmatrix” Library to communicate with the MAX7219 modules.
  • Page 112: Lesson 16 Gy-521 Module

    IMU (Inertia Measurement Unit) sensors, compatible with Arduino. IMU sensors like the GY-521 are used in self balancing robots, UAVs, smart phones, etc. Component Required: (1) x Elegoo Uno R3 (1) x GY-521 module (4) x F-M wires Component Introduction...
  • Page 113 IMU sensors are one of the most inevitable type of sensors used today in all kinds of electronic gadgets. They are seen in smart phones, wearables, game controllers, etc. IMU sensors help us in getting the attitude of an object, attached to the sensor in three dimensional space.
  • Page 114 An accelerometer works on the principle of piezo electric effect. Here, imagine a cuboidal box, having a small ball inside it, like in the picture above. The walls of this box are made with piezo electric crystals. Whenever you tilt the box, the ball is forced to move in the direction of the inclination, due to gravity.
  • Page 115 How does a gyroscope work? Gyroscopes work on the principle of Coriolis acceleration. Imagine that there is a fork like structure, which is in constant back and forth motion. It is held in place using piezo electric crystals. Whenever, you try to tilt this arrangement, the crystals experience a force in the direction of inclination.
  • Page 116 Connection Schematic 116 / 223...
  • Page 117 Wiring diagram 117 / 223...
  • Page 118 Next, we need to set up the I2C lines. For this connect the pin labelled as SDA on the GY-521 to the Arduino’s analog pin 4 (SDA). And the pin labelled as SCL on the GY-521 to the Arduino’s analog pin 5 (SCL). And that’s it, you have finished wiring up the Arduino GY-521.
  • Page 119 Example picture GY-521 QMI-8568 119 / 223...
  • Page 120 Open the monitor then you can see the data as blow: Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are introduced in details in Lesson 1. 120 / 223...
  • Page 121: Lesson 17 Hc-Sr501 Pir Sensor

    The UNO is the heart of this project. It 'listens' to the PIR sensor and when motion is detected, instructs the LED to light on or shut off. Component Required: (1) x Elegoo Uno R3 (1) x HC-SR501 PIR motion sensor (3) x F-M wires (Female to Male DuPont wires)
  • Page 122 Pin or Control Function Time Delay Adjust Sets how long the output remains high after detecting motion..Anywhere from 5 seconds to 5 minutes. Sets the detection range..from 3 meters to 7 meters Sensitivity Adjust Trigger Selection Set for single or repeatable triggers. Jumper Ground input Ground pin...
  • Page 123 HC SR501 PIR Functional Description The SR501 will detect infrared changes and if interpreted as motion, will set its output low. What is or is not interpreted as motion is largely dependent on user settings and adjustments. Device Initialization The device requires nearly a minute to initialize. During this period, it can and often will output false detection signals.
  • Page 124 HC SR501 View Area PIR Range (Sensitivity) Adjustment As mentioned, the adjustable range is from approximately 3 to 7 meters. The illustration below shows this adjustment. HC SR501 Sensitivity Adjust Time Delay Adjustment The time delay adjustment determines how long the output of the PIR sensor module will remain high after detection motion.
  • Page 125 HC SR501 Time Delay Adjustment 3 Seconds Off After Time Delay Completes – IMPORTANT The output of this device will go LOW (or Off) for approximately 3 seconds AFTER the time delay completes. In other words, ALL motion detection is blocked during this three second period.
  • Page 126 Trigger Mode Selection Jumper The trigger mode selection jumper allows you to select between single and repeatable triggers. The affect of this jumper setting is to determine when the time delay begins.  SINGLE TRIGGER – The time delay begins immediately when motion is first detected. ...
  • Page 127 Example One In this first example, the time delay is set to three seconds and the trigger mode is set to single. As you can see in the illustration below, the motion is not always detected. In fact, there is a period of about six seconds where motion can not be detected.
  • Page 128 Connection Schematic 128 / 223...
  • Page 129 Wiring diagram 129 / 223...
  • Page 130 Connecting PIR sensors to a microcontroller is really simple. The PIR acts as a digital output so all you need to do is listen for the pin to flip high (detected) or low (not detected). It’s likely that you'll want retriggering, so be sure to put the jumper in the H position! Power the PIR with 5V and connect ground to ground.
  • Page 131: Lesson 18 Water Level Detection Sensor Module

    ADC function of UNO R3. Component Required: (1) x Elegoo Uno R3 (3) x F-M wires (Female to Male DuPont wires) (1) x Water lever detection sensor module...
  • Page 132 It has low power consumption, and high sensitivity. Features: 1、Working voltage: 5V 2、Working Current: <20ma 3、 Interface: Analog 4、Width of detection: 40mm×16mm 5、Working Temperature: 10℃~30℃ 6、Output voltage signal: 0~4.2V Connection Schematic 132 / 223...
  • Page 133 Wiring diagram 133 / 223...
  • Page 134 Wiring tips: Power supply (+) is connected to 5V of UNO R3 board, ground electrode (-) is connected to GND. Signal output (S) is connected to the ports (A0-A5) which have function of inputting analog signal in UNO R3 board, random one is OK, but it should define the same demo code as the routine.
  • Page 135 Open the monitor then you can see the data as below: Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are introduced in details in Lesson 1. 135 / 223...
  • Page 136: Lesson 19 Real Time Clock Module

    DS1307 provides seconds, minutes, hours, day, date, month, and year information. Timekeeping operation continues while the part operates from the backup supply. Component Required: (1) x Elegoo Uno R3 (1) x DS1307 RTC module (4) x F-M wires (Female to Male DuPont wires) Component Introduction...
  • Page 137 Connection Schematic 137 / 223...
  • Page 138 Wiring diagram 138 / 223...
  • Page 139 Set up according to the following image. Ignore the 32K and SQW pins; you will not need them. Plug the SCL pin into your UNO R3 board SCL port, and the SDA pin into the SDA port. The VCC pin plugs into the 5V port, and the GND plugs into the GND port.
  • Page 140 Open the monitor then you can see the module can read the time as below: Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are introduced in details detail in Lesson 1. 140 / 223...
  • Page 141: Lesson 20 Sound Sensor Module

    Given to its preciseness, it takes at least 10 circles for you to get some response. Component Required: (1) x Elegoo Uno R3 (1) x Sound sensor module (4) x F-M wires (Female to Male DuPont wires)
  • Page 142 These microphones are widely used in electronic circuits to detect minor sounds or air vibrations which in turn are converted to electrical signals for further use. The two legs as shown in the image above are used to make electrical connection with the circuit.
  • Page 143 Connection Schematic 143 / 223...
  • Page 144 Wiring diagram 144 / 223...
  • Page 145 The code After wiring, please open the program in the code folder(Lesson 20 SOUND SENSOR MODULE)and click UPLOAD to upload the program. See Lesson 3 for details about program uploading if there are any errors. High-sensitive Voice Sensor has two output: AO: analog output, real-time output voltage signal of microphone DO: digital output when the intensity of the sound to reach a certain threshold, the output high and low level signal, the threshold-sensitivity can be achieved by...
  • Page 146 Serial Plotter Example: Open Serial Plotter: When you speak into the microphone or inflate, you can observe that our waveforms have changed The following is the procedure required to use this experiment and notes to explain: void setup() Serial.begin(9600); // The IDE settings for Serial Monitor/Plotter (preferred) must match this speed pinMode(sensorDigitalPin,INPUT);...
  • Page 147: Lesson 21 Rc522 Rfid Module

    R3. This module uses the Serial Peripheral Interface (SPI) bus to communicate with controllers such as Arduino, Raspberry Pi, beagle board, etc. Component Required: (1) x Elegoo Uno R3 (1) x RC522 RFID module (7) x F-M wires (Female to Male DuPont wires)
  • Page 148 Connection Schematic 148 / 223...
  • Page 149 Wiring diagram 149 / 223...
  • Page 150 Code After wiring, please open the program in the code folder- Lesson 21 RC522 RFID Module and press UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors. Before you can run this, make sure that you have installed the < rfid > library or re- install it, if necessary.
  • Page 151 Open the monitor then you can see the data as blow: Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are set out in detail in Lesson 1. 151 / 223...
  • Page 152: Lesson 22 Lcd Display

    In this lesson, we will run the Arduino example program for the LCD library, but in the next lesson, we will get our display to show the temperature, using sensors. Component Required: (1) x Elegoo Uno R3 (1) x LCD1602 module (1) x Potentiometer (10k)
  • Page 153 Connection Schematic 153 / 223...
  • Page 154 Wiring diagram 154 / 223...
  • Page 155 The LCD display needs six Arduino pins, all set to be digital outputs. It also needs 5V and GND connections. There are a number of connections to be made. Lining up the display with the top of the breadboard helps to identify its pins without too much counting, especially if the breadboard has its rows numbered with row 1 as the top row of the board.
  • Page 156 The first sets the cursor position (where the next text will appear) to column 0 & row 1. Both column and row numbers start at 0 rather than 1. The second line displays the number of milliseconds since the Arduino was reset. Example picture 156 / 223...
  • Page 157: Lesson 23 Thermometer

    Lesson 23 Thermometer Overview In this lesson, you will use an LCD display to show the temperature. Component Required: (1) x Elegoo Uno R3 (1) x LCD1602 Module (1) x 10k ohm resistor (1) x Thermistor (1) x Potentiometer (1) x 830 tie-points Breadboard...
  • Page 158 Connection Schematic 158 / 223...
  • Page 159 Wiring diagram 159 / 223...
  • Page 160 The breadboard layout is based on the layout from Lesson 22, so it will simplify things if you still have this on the breadboard. There are a few jumper wires near the pot that have been moved slightly on this layout.
  • Page 161 lcd.setCursor(0, 0); lcd.print("Temp C "); lcd.setCursor(6, 0); lcd.print(tempF); The rather strange comment serves to remind you of the 16 columns of the display. You can then print a string of that length with spaces where the actual reading will To fill in the blanks, set the cursor position for where the reading should appear and then print it.
  • Page 162: Lesson 24 Eight Led With 74Hc595

    500,000 times a second instead of 8,000,000 a second) but it's still really fast, way faster than humans can detect, so it's worth it! Component Required: (1) x Elegoo Uno R3 (1) x 830 tie-points breadboard (8) x leds...
  • Page 163 163 / 223...
  • Page 164 The clock pin needs to receive eight pulses. At each pulse, if the data pin is high, then a 1 gets pushed into the shift register; otherwise, a 0. When all eight pulses have been received, enabling the 'Latch' pin copies those eight values to the latch register.
  • Page 165 Wiring diagram 165 / 223...
  • Page 166 As we have eight LEDs and eight resistors to connect, there are actually quite a few connections to be made. It is probably easiest to put the 74HC595 chip in first, as pretty much everything else connects to it. Put it so that the little U-shaped notch is towards the top of the breadboard.
  • Page 167 which of our eight LEDs are on or off. byte leds = 0; The 'setup' function just sets the three pins we are using to be digital outputs. void setup() pinMode(latchPin, OUTPUT); pinMode(dataPin, OUTPUT); pinMode(clockPin, OUTPUT); The 'loop' function initially turns all the LEDs off, by giving the variable 'leds' the value 0.
  • Page 168 Bit' (LSB). The last parameter is the actual data to be shifted into the shift register, which in this case is 'leds'. void updateShiftRegister() digitalWrite(latchPin, LOW); shiftOut(dataPin, clockPin, LSBFIRST, leds); digitalWrite(latchPin, HIGH); If you wanted to turn one of the LEDs off rather than on, you would call a similar Arduino function (bitClear) with the 'leds' variable.
  • Page 169: Lesson 25 The Serial Monitor

    Lesson 25 The Serial Monitor Overview In this lesson, you will build on Lesson 24, adding the facility to control the LEDs from your computer using the Arduino Serial Monitor. The serial monitor is the 'tether' between the computer and your UNO. It lets you send and receive text messages, handy for debugging and also controlling the UNO from a keyboard! For example, you will be able to send commands from your computer to turn on LEDs.
  • Page 170 The following window will open. Click the Serial Monitor button to turn on the serial monitor. The basics about the serial monitor are introduced in details in Lesson 1. This window is called the Serial Monitor and it is part of the Arduino IDE software. Its job is to allow you to both send messages from your computer to an UNO board (over USB) and also to receive messages from the UNO.
  • Page 171 Type x again and press ‘Send’ to turn off all LEDs. Code After wiring, please open program in the code folder- Lesson 25 The Serial Monitor and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors.
  • Page 172 while (! Serial); // Wait until Serial is ready - Leonardo Serial.println("Enter LED Number 0 to 7 or 'x' to clear"); Firstly, we have the command 'Serial.begin(9600)'. This starts serial communication, so that the UNO can send out commands through the USB connection. The value 9600 is called the 'baud rate' of the connection.
  • Page 173 Serial.println("Cleared"); Everything that happens inside the loop is contained within an 'if' statement. So unless the call to the built-in Arduino function 'Serial.available()' is 'true' then nothing else will happen. Serial.available() will return 'true' if data has been send to the UNO and is there ready to be processed.
  • Page 174 The next two lines write back a confirmation message to the Serial Monitor. Serial.print("Turned on LED "); Serial.println(led); The first line uses Serial.print rather than Serial.println. The different between the two is that Serial.print does not start a new line after printing whatever is in its parameter.
  • Page 175: Lesson 26 Photocell

    You will build on lesson 24 and use the level of light to control the number of LEDs to be lit. The photocell is at the bottom of the breadboard, where the pot was above. Component Required: (1) x Elegoo Uno R3 (1) x 830 tie-points breadboard (8) x leds (8) x 220 ohm resistors...
  • Page 176 The resistor and photocell together behave like a pot. When the light is very bright, then the resistance of the photocell is very low compared with the fixed value resistor, and so it is as if the pot were turned to maximum. When the photocell is in dull light, the resistance becomes greater than the fixed 1 kΩ...
  • Page 177 Connection Schematic 177 / 223...
  • Page 178 Wiring diagram 178 / 223...
  • Page 179 Code After wiring, please open the program in the code folder- Lesson 26 Photocell and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors. The first thing to note is that we have changed the name of the analog pin to be 'lightPin' rather than 'potPin' since we no longer have a pot connected.
  • Page 180: Lesson 27 74Hc595 And Segment Display

    After learning Lesson 24、25 and Lesson 26, we will use the 74HC595 shift register to control the segment display. The segment display will show number from 9-0. Component Required: (1) x Elegoo Uno R3 (1) x 830 tie-points breadboard (1) x 74HC595 IC...
  • Page 181 0-9 ten digits correspond with each segment are as follows (the following table applies common cathode seven segment display device, if you are using a common anode, the table should be replaced every 1 0 0 should all replaced by 1): Display digital 181 / 223...
  • Page 182 Connection Schematic 182 / 223...
  • Page 183 Wiring diagram 183 / 223...
  • Page 184 The following table shows the seven-segment display 74HC595 pin correspondence table: Seven shows remarkable 74HC595 pin control pin (stroke) 7 (A) 6 (B) 4 (C) 2 (D) 1 (E) 9 (F) 10 (G) 5 (DP) Step one: Connect 74HC595 First, the wiring is connected to power and ground: VCC (pin 16) and MR (pin 10) connected to 5V GND (pin 8) and OE (pin 13) to ground Connection DS, ST_CP and SH_CP pin:...
  • Page 185 Code After wiring, please open the program in the code folder- Lesson 27 74HC595 And Segment Display and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors. Example picture 185 / 223...
  • Page 186: Lesson 28 Four Digital Seven Segment Display

    Persistence of Vision enables you to see all numbers displayed because each the scanning speed is so fast that you hardly notice the intervals. Component Required: (1) x Elegoo Uno R3 (1) x 830 tie-points breadboard (1) x 74HC595 IC (1) x 4 Digit 7-Segment Display...
  • Page 187 Component Introduction Four Digital Seven segment display 187 / 223...
  • Page 188 Connection Schematic 188 / 223...
  • Page 189 Wiring diagram 189 / 223...
  • Page 190 Code After wiring, please open the program in the code folder- Lesson 28 Four Digital Seven Segment Display and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors. Example picture 190 / 223...
  • Page 191: Lesson 29 Dc Motors

    Overview In this lesson, 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-points breadboard (1) x L293D IC (1) x Fan blade and 3-6v motor...
  • Page 192 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. 0v, 3.3v, 5v to breadboard ...
  • Page 193 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.
  • Page 194 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 •...
  • Page 195 I got fed up with indecipherable pinout diagrams within datasheets, so have designed my own that I think gives more pertinent information. There are 3 wires connected to the Arduino, 2 wires connected to the motor, and 1 wire connected to a battery.
  • Page 196 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. 196 / 223...
  • Page 197 Connection Schematic 197 / 223...
  • Page 198 Wiring diagram 198 / 223...
  • Page 199 The code below does not use a separate power supply (ie a battery), it uses instead the 5v power from the Arduino. Note that this would be risky without the L293D controlling it. You should _never_ connect a motor directly to the Arduino, because when you switch a motor off you get an electrical feedback.
  • Page 200 Example picture 200 / 223...
  • Page 201: Lesson 30 Relay

    Lesson 30 Relay Overview In this lesson, you will learn how to use a relay. Component Required: (1) x Elegoo Uno R3 (1) x 830 tie-points breadboard (1) x Fan blade and 3-6v dc motor (1) x L293D IC (1) x 5v Relay...
  • Page 202 Component Introduction Relay: A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a switch, but other operating principles are also used as in solid-state relays. Relays are used where it is necessary to control a circuit by a low- power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal.
  • Page 203 Connection Schematic 203 / 223...
  • Page 204 Wiring diagram 204 / 223...
  • Page 205 Code After wiring, please open the program in the code folder- Lesson 30 Relay and click UPLOAD to upload the program. See Lesson 2 for details about program uploading if there are any errors. After program loading, turn on all the power switches. The relay will pick up with a ringing sound.
  • Page 206: Lesson 31 Stepper Motor

    The stepper we are using comes with its own driver board making it easy to connect to our UNO. Component Required: (1) x Elegoo Uno R3 (1) x 830 tie-points breadboard (1) x ULN2003 stepper motor driver module (1) x Stepper motor...
  • Page 207 A stepper motor is an electromechanical device which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these applied input pulses.
  • Page 208 Interfacing circuits The bipolar stepper motor usually has four wires coming out of it. Unlike unipolar steppers, bipolar steppers have no common center connection. They have two independent sets of coils instead. You can distinguish them from unipolar steppers by measuring the resistance between the wires. You should find two pairs of wires with equal resistance.
  • Page 209 ULN2003 Driver Board Product Description Size: 42mmx30mm Use ULN2003 driver chip, 500mA A. B. C. D LED indicating the four phase stepper motor working condition. White jack is the four phase stepper motor standard jack. Power pins are separated We kept the rest pins of the ULN2003 chip for your further prototyping. The simplest way of interfacing a unipolar stepper to Arduino is to use a breakout for ULN2003A transistor array chip.
  • Page 210 The sequence would go like this: Here are schematics showing how to interface a unipolar stepper motor to four controller pins using a ULN2003A, and showing how to interface using four com 210 / 223...
  • Page 211 Connection Schematic 211 / 223...
  • Page 212 Wiring diagram 212 / 223...
  • Page 213 We are using 4 pins to control the Stepper. Pin 8-11 are controlling the Stepper motor. We connect the Ground from to UNO to the Stepper motor. Code After wiring, please open the program in the code folder- Lesson 31 Stepper Motor and click UPLOAD to upload the program.
  • Page 214: Lesson 32 Controlling Stepper Motor With Remote

    9V 1Amp power supply. The IR sensor is connected to the UNO directly since it uses almost no power. Component Required: (1) x Elegoo Uno R3 (1) x 830 tie-points breadboard (1) x IR receiver module...
  • Page 215 Connection Schematic 215 / 223...
  • Page 216 Wiring diagram 216 / 223...
  • Page 217 We are using 4 pins to control the Stepper and 1 pin for the IR sensor. Pins 8-11 are controlling the Stepper motor and pin 12 is receiving the IR information. We connect the 5V and Ground from the UNO to the sensor. As a precaution, use a breadboard power supply to power the stepper motor since it can use more power and we don’t want to damage the power supply of the UNO.
  • Page 218: Lesson 33 Controlling Stepper Motor With Rotary Encoder

    Component Required: (1) x Elegoo Uno R3 (1) x 830 tie-points breadboard (1) x Rotary Encoder Module (1) x ULN2003 stepper motor driver module...
  • Page 219 Component Introduction Rotary encoder A rotary encoder, also called a shaft encoder, is an electro-mechanical device that converts the angular position or motion of a shaft or axle to an analog or digital code. There are two main types: absolute and incremental (relative). The output of absolute encoders indicates the current position of the shaft, making them angle transducers.
  • Page 220 Connection Schematic 220 / 223...
  • Page 221 Wiring diagram 221 / 223...
  • Page 222 We are using 4 pins to control the Stepper and 3 pins for the rotary encoder module. Pins 8-11 are controlling the Stepper motor and pins 2-4 are receiving information from the rotary encoder. We connect the 5V and Ground from to UNO to the rotary encoder and as a precaution, use a breadboard power supply to power the stepper motor since it can use more power that the UNO can provide.
  • Page 223 Example picture 223 / 223...

This manual is also suitable for:

Uno r3

Table of Contents

Save PDF