About Arduino Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online.
About Processing What is processing? Processing is a programming language, development environment, and online community. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology. Initially created to serve as a software sketchbook and to teach computer programming fundamentals within a visual context, Processing evolved into a development tool for professionals.
Download Arduino official website:www.arduino.cc Download steps: 1. Enter Arduino official website and find “DOWNLOADS” and click it 2. According to your need, you can download any kind of system of arduino - 3 -...
Page 7
3. Enter download page and click “JUST DOWNLOAD” Arduino installation steps: 1. When the download finishes, proceed with the installation and please allow the driver installation process when you get a warning from the operating system. - 4 -...
Page 8
2. Choose the components to install 3. Choose the installation directory (we suggest to keep the default one) - 5 -...
Page 9
4. The process will extract and install all the required files to execute properly the Arduino Software (IDE) Arduino IDE installation video tutorial address: https://youtu.be/BsTDVB8B240 - 6 -...
Page 10
Processing Processing official website:https://processing.org 1. Enter Processing official website and find “Download Processing” - 7 -...
Page 11
2. Click “ Download Processing” and then you can download the version you want according to your computer system 3. Enter the page and download what you need - 8 -...
Page 12
4. After downloading, you can open the compressed files directly or you can decompress the files to where you want to keep it, and then open processing.exe and use it directly. - 9 -...
Page 13
5. After coding, click the execution button below, and then you can see the result. 6. In this way, we finished the downloading and use of processing. - 10 -...
Chapter 1 LED Project 1.1 Blinking LED Experimental objective: In this experiment, we will learn how to light and extinguish the LED lamp. Required materials: - 1* Arduino UNO - 1* USB Cable - 1* 220Ω Resistor - 1* LED...
Page 15
There are two methods for connecting LED to Arduino’s GPIO: ① As shown in the schematic diagram above, the anode of LED is connected to Arduino’s GPIO via a resistor, and the cathode of LED is connected to the ground(GND).
Page 16
D8 pin to low level to make the LED off. Continue to perform the above process, and then you can get a blinking LED. Required functions: ● setup() The setup () function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc.
Page 17
1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 14 -...
Page 18
2. Examine the circuit connection carefully in step 1, and connect the arduino UNO to the computer. - 15 -...
Page 19
3. Start arduino IDE and choose the development board type. - 16 -...
Page 20
5. Choose the port number Notice: In the tutorial, the port number of UNO which recognized by PC is COM6, here we can replace COM6 with COM1, COM2, COM3…… - 17 -...
Page 21
6. Compile the experimental code in IDE and download it to arduino UNO R3 Experimental code: Experimental result: Now, we can see the LED lamp is flashing consecutively with one second on and one second off. - 18 -...
Page 22
Experimental conclusion: After this course, we know how to make the LED lamp flashing; next we will do more interesting experiments about the lamp. Video Link: https://youtu.be/QpCAIuH7D_E - 19 -...
Project 1.2 LED Flowing Light Experimental objective: In this experiment, we will learn how to make an LED flowing light. This experiment is almost the same as the first one, and we need to control 8 LED lamps, and make it look like flowing water.
Page 24
When the condition becomes false, the loop ends. Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram.
Page 25
Compile the experimental code and download it to arduino UNO R3 2. Experimental code /*********************************************************** File name: flowingLed.ino Description: LED turn lighting control Website: www.adeept.com E-mail: support@adeept.com Author: Robot Date: 2018/02/28 ***********************************************************/ void setup() unsigned char ledPin;...
Page 26
//ledPin will be set to 1,2,3,4,5,6, 7 and 8. for(ledPin=1;ledPin<=8;ledPin++)//Every 200ms on in order LED1 ~ 8 digitalWrite(ledPin,HIGH); //led on delay(200); //Delay 200 ms for(ledPin=1;ledPin<=8;ledPin++)//Every 200ms off in order LED1 ~ 8 digitalWrite(ledPin,LOW); //led off delay(200);...
Chapter 2 Button Project 2.1 Controlling an LED with a button Experimental objective: In this experiment, we will learn how to control an LED with a button. Required materials: - 1* Arduino UNO - 1* USB Cable - 1* LED - 1* Button - 1* 10KΩ...
Page 28
The button we used is a normally open type button. The two contacts of a button are in the off state under the normal conditions, only when the button is pressed they are closed. The schematic diagram we used is as follows: The button jitter must be happened in the process of using.
Page 29
When the level we detected is low level, 5~10 MS delay is needed, and then detect whether the level of button interface is low or high. If the signal is low, we can confirm that the button is pressed once.
Page 30
Mode: defines when the interrupt should be triggered. Four constants are predefined as valid values: -LOW to trigger the interrupt whenever the pin is low, -CHANGE to trigger the interrupt whenever the pin changes value -RISING to trigger when the pin goes from low to high, -FALLING for when the pin goes from high to low.
Page 31
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 28 -...
Page 32
Examine the high and low electrical level and judge the state of the button. /*********************************************************** File name: Controlling an LED with a button.ino Description: When you press the button, you can see the state of the LED will be toggled. (ON->OFF,OFF->ON). Website: www.adeept.com E-mail: support@adeept.com Author: Robot Date: 2018/02/28 ***********************************************************/ ledpin=11;...
Page 33
11 port mode, the OUTPUT for the output pinMode(btnpin,INPUT); //Set digital 2 port mode, the INPUT for the input void loop() if(digitalRead(btnpin)==LOW) //Detection button interface to delay(10); //Delay 10ms for the elimination of key leading-edge jitter if(digitalRead(btnpin)==LOW) //Confirm button is pressed while(digitalRead(btnpin)==LOW);//Wait for key interfaces to high...
Page 34
Interrupt the button and judge the state of it /*********************************************************** File name: btnAndLed02.ino Description: Using interrupt mode, every time you press the button, LED status is switched(ON->OFF,OFF->ON). Website: www.adeept.com E-mail: support@adeept.com Author: Robot Date: 2018/02/28 ***********************************************************/ ledpin=11; //definition digital 11 pins as pin to control the LED btnpin=2;...
Page 35
Experimental result: Now we can see that when the UNO is energized, if we press the button, the LED lamp will be bright, and if we press the button again, the lamp will extinguish. Experimental conclusion: After this course, we know how to use Arduino UNO to detect the state of an external button and then switch to LED.
Chapter 3 Tilt Switch Project 3.1 Tilt Switch Experimental objective: In this experiment, we will learn how to use tilt switch and change the state of LED by changing the state of angle of the tilt switch. Required materials:...
Page 37
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 34 -...
Page 38
Compile the experimental code and download it to arduino UNO R3 2. Experimental code /*********************************************************** File name: tiltSwitch.ino Description: Tilt switches to control the LED light on or off Website: www.adeept.com E-mail: support@adeept.com Author: Robot Date: 2018/02/28 ***********************************************************/ ledpin=11; //definition digital 11 pins as pin to control the tiltSwitchpin=7;...
Page 39
//Detect tilt switch is disconnected, the tilt switch when small lights go out { digitalWrite(ledpin,LOW);} //Output low, LED OFF else //Detection of tilt switch is conduction, tilt the little lights up when the switch conduction { digitalWrite(ledpin,HIGH);}...
Chapter 4 Buzzer Project 4.1 Active Buzzer Experimental objective: In this experiment, we will learn how to use the active buzzer. Required materials: - 1* Arduino UNO - 1* USB cable - 1* Active buzzer - 1* 220Ω Resistor...
Page 41
When you place the pins of buzzers upward, you can see that two buzzers are different, and buzzer that green circuit board exposed is the passive buzzer. In this study, the buzzer we used is active buzzer. Active buzzer will sound as long as the power supply.
Page 42
Arduino GPIO as low level, the transistor S8050 will cut off, then the buzzer will stop. Figure 2: Set the Arduino GPIO as low level, the transistor S8550 will conduct, and the buzzer will sound;...
Page 43
Compile the experimental code and download it to arduino UNO R3 2. Experimental code /*********************************************************** File name:ActiveBuzzer.ino Description: Arduino uno Continuous beeps control buzzer. Website: www.adeept.com E-mail: support@adeept.com Author: Robot Date: 2018/02/28 ***********************************************************/ buzzerPin=8; //definition digital 8 pins as pin to control the buzzer...
Page 44
//Set the delay time,2000ms Experimental result: Now we can hear the active buzzer produce sound every two seconds. Experimental conclusion: In this course, we have learned the use of buzzer and the principle of triode. I hope you can use what you have learned in this course to do more interesting experiments.
Chapter 5 PWM Project 5.1 Breathing LED Experimental objective: In this experiment, we will learn how to program Arduino to generate PWM signal and use PWM square wave to control LED’s gradual lighten and darken. Required materials: - 1* Arduino UNO - 1* USB Cable - 1* 220Ω...
Page 46
Required functions: ●analogWrite() Writing an analog value (PWM wave) to a pin can be used to light an LED at varying brightness or drive a motor at various speeds. After a call to analogWrite (), the pin will generate a steady square wave of the specified duty cycle until the next call to analogWrite () (or a call to digitalRead () or digitalWrite() on the same pin).
Page 47
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 44 -...
Page 48
2.Compile the experimental code and download it to arduino UNO R3 Experimental code: /*********************************************************** File name: breathingLed.ino Description: PWM control the LED gradually from dark to brighter, then from brighter to dark Website: www.adeept.com E-mail: support@adeept.com Author:Robot Date: 2018/02/28 ***********************************************************/ ledpin=11;...
Page 49
(int a=0; a<=255;a++) //Loop, PWM control of LED brightness increase analogWrite(ledpin,a); //PWM output value a (0~255) delay(15); //The duration of the current brightness level. 15ms (int a=255; a>=0;a--) //Loop, PWM control of LED brightness Reduced analogWrite(ledpin,a); //PWM output value a (255~0) delay(15);...
Page 50
Experimental conclusion: After this course, we know how to make a breathing lamp, up to now we have learned many experiments about lamp, and you can try more interesting experiments after class. - 47 -...
Project 5.2 Passive Buzzer Experimental objective: In this experiment, we will learn how to use passive buzzer to play a song. Required materials: - 1* Arduino UNO - 1* USB Cable - 1* 220Ω Resistor - 1* NPN Transistor (S8050)
Page 52
Use of the tone () function will interfere with PWM output on pins 3 and 11 (on boards other than the Mega). NOTE: if you want to play different pitches on multiple pins, you need to call noTone () on one pin before calling tone () on the next pin.
Page 53
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 50 -...
Page 54
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 5.2 folder - 51 -...
Page 55
Experimental result: Now, we can clearly hear that the buzzer is playing music. Experimental conclusion: After this course, we know how to use passive buzzer and make a pleasant song, more than that, we can make buzzer play a song that we like.
Page 56
Project 5.3 Controlling a RGB LED with PWM Experimental objective: experiment In this , we will learn how to use PWM to control RGB lamp, and make it blink with different colors. Required materials: - 1* Arduino UNO - 1* USB Cable - 3* 220Ω...
Page 57
In this way, we can control the color of RGB LED by 3-channel PWM signal. Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram...
Page 58
File name: rgbLed.ino Description:Control the RGB LED emitting red, green, blue, yellow, white and purple light, then the RGB LED will be off, each state continues 1s, after repeating the above procedure. Website: www.adeept.com E-mail: support@adeept.com Author: Robot Date: 2018/02/28 *************************************************************/ redPin = 10;...
Page 59
OUTPUT); // sets the redPin to be an output pinMode(greenPin, OUTPUT); // sets the greenPin to be an output pinMode(bluePin, OUTPUT); // sets the bluePin to be an output void loop() // run over and over again // Basic colors: color(255, 0, 0);...
Page 60
Experimental result: Now, we can see the RGB lamp is changing color constantly. Experimental conclusion: After this course, we basically understand how to use PWM to control the change of color of RGB lamp. - 57 -...
Chapter 6 7-segment display Project 6.1 7-segment display Experimental objective: In this experiment, we will learn how to control the display of 7-segment. Required materials: - 1* Arduino UNO - 1* USB Cable - 1* 220Ω Resistor - 1* 7-Segment display...
Page 62
When using a common anode LED, the common anode should be connected to the power supply (VCC); when using a common cathode LED, the common cathode should be connected to the ground (GND). Each segment of a segment display is composed of LED, so a resistor is needed for protecting the LED.
Page 63
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 60 -...
Page 64
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 6.1 code folder. - 61 -...
Page 65
Experimental result: Now we can see clearly that the 7-segment displays 0-9 in cycle. Experimental conclusion: After this course, we know how to use 7-segment, and you can expand more with what we have learned in this course. - 62 -...
Chapter 7 Analog Project 7.1 Photoresistor Experimental objective: In this experiment, we will learn how to use photoresistor and display its data on serial port. Operating principle: - 1* Arduino UNO - 1* USB cable - 1* Photoresistor - 1* 10KΩ Resistor...
Page 67
With the increase of the light intensity, the resistance of photoresistor will be decreased. The voltage of GPIO port in the above figure will become high. Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram.
Page 68
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 7.1 code folder - 65 -...
Page 69
Experimental result: Now, we can see the data of photoresistor (0~1023)on the serial port of the computer. - 66 -...
Page 70
Experimental conclusion: After this course, we know the basic use of photoresistor, and next we will learn more usage about photoresistor. - 67 -...
Project 7.2 Photoresistor controls Experimental objective: : experiment In this , we will learn how to use photoresistor to control the brightness of LED. The brightness of LED will change along with the value of the photoresistor, the greater the intensity of the light, the brighter the LED lamp is, and the weaker the intensity of the light, the darker the LED lamp is.
Page 72
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 69 -...
Page 73
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 7.2 code folder. Experimental result: Now we can see that when we cover up the photoresistor with hand, the color of LED lamp will change, too.
Page 74
Experimental conclusion: After this course, we know how to use photoresistor to control the brightness of the LED lamp. - 71 -...
Project 7.3 Thermistor Experimental objective: experiment start In this , we to learn how to use thermistor. Required materials: - 1* Arduino UNO - 1* USB Cable - 1* 10KΩ Resistor - 1* Thermistor sensor - 1* Breadboard - Several Jumper Wires Operating principle:...
Page 76
The nominal resistance of thermistor at room temperature T2; : 2.718281828459; : It is one of the important parameters of thermistor; : The Kelvin temperature that you want to measure. : At the condition of room temperature 25 ℃ (298.15K), the standard ...
Page 77
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 74 -...
Page 78
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 7.3 code folder Experimental result: Now we can see that the value of thermistor has been displayed on the serial port.
Project 7.4 Temperature alarm Experimental objective: In this experiment, we start to do the series experiment of the temperature sensor and buzzer Required materials: - 1* Arduino UNO - 1* USB Cable - 1* temperature sensor - 1* buzzer - 1* Breadboard - 1* 10kΩResistor...
Page 82
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 7.4 code folder Experimental result: Now, we put our hands on the thermistor, when it reads the temperature that is more than 30℃,the buzzer will alarm, if not, it doesn’t alarm.
Page 83
Experimental conclusion: After this course, we know how to make a temperature alarm; you can think imaginatively to do the relevant and more interesting experiments. - 80 -...
Project 7.5 Electronic organ Experimental objective: In this experiment, we will learn how to make a simple electronic organ. When we press the button, the buzzer can generate sound with different HZ, thus we can make a simple numbered musical notation.
Page 85
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 7.5 code folder Experimental result: Now, when we press the button in sequence, we can hear that the buzzer produces seven kinds of tones.
Page 86
Experimental conclusion: After this course, we have learned how to make the button match the buzzer and make a simple electronic organ, and we can use it to play simple songs. - 83 -...
Chapter 8 LCD1602 Project 8.1 LCD1602 Experimental objective: In this experiment, we will start to learn how to use LCD 1602. Required materials: - 1* Arduino UNO - 1* USB cable - 1* LCD1602 - 1* 10KΩ Potentiometer - 1* Breadboard - Several Jumper wires Operating principle:...
Page 88
The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit mode requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins. For displaying text on the screen, you can do most everything in 4-bit mode, for example shows how to control a 2x16 LCD in 4-bit mode.
Page 89
() and scrollDisplayRight () See also scrollDisplayRight () ●print() Print text to the LCD. Syntax lcd.print (data) lcd.print(data, BASE) Parameters lcd: a variable of type LiquidCrystal Data: the data to print (char, byte, int, long, or string) BASE (optional): the base in which to print numbers: BIN for binary (base 2), DEC for decimal (base 10), OCT for octal (base 8), HEX for hexadecimal (base 16).
Page 90
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 87 -...
Page 91
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 8.1 code folder - 88 -...
Page 92
Experimental result: Now we can see what we have input on LCD screen: Adeept hello geeks! www.adeept.com。 Experimental conclusion: After this course, we know how to use LCD and adjust the backlight, later, we can transfer different information to LCD and display it.
Project 8.2 IIC Interface module Experimental objective: In this experiment, we will start to do series experiment of LCD1602 and IIC interface module. Required materials: - 1* Arduino UNO - 1* USB cable - 1* LCD1602 - 1* IIC interface module...
Page 94
Compile the experimental code and download it to arduino UNO R3 2. Experimental code Refer to Project 8.2 code folder. - 91 -...
Page 95
Experimental result: Now we can see the LCD displays : Welcome to www.Adeept.com”. - 92 -...
Page 96
Experimental conclusion: After this course, we know how to connect IIC interface module with LCD screen and displays: welcome to www.adeept.com. - 93 -...
Project 8.3 LCD1602 Display Brightness Experimental objective: In this experiment, we start to learn how to display the data that Photoresistor has read on the LCD display screen with IIC interface module. Required materials: - 1* Arduino UNO - 1* USB Cable - 1* Photoresistor - 1* 10kΩ...
Page 98
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 95 -...
Page 99
Compile the experimental code and download it to arduino UNO R3 2. Experimental code Refer to Project 8.3 code folder. - 96 -...
Page 100
Experimental result: Now, we can see the data of the Photoresistor displayed on LCD screen. Experimental conclusion: After this course, we know how to display the data of photoresistor on the LCD screen with IIC interface module. - 97 -...
Chapter 9 Frequency meter and DC motor Project 9.1 Frequency meter Experimental objective: experiment In this , we will use Arduino UNO to make a simple frequency meter Required materials: - 1* Arduino UNO - 1* USB Cable - 1* NE555 Timer - 1* 10KΩ...
Page 102
(DIP). Thereinto: Pin 6 is the THRESHOLD for the input of upper comparator; Pin 2 is TRIGGER for the input of lower comparator; Pin 3 is the OUTPUT having two states of 0 and 1 decided by the input electrical level;...
Page 103
HIGH, starts timing, then waits for the pin to go LOW and stops timing. Return the length of the pulse in microseconds. Gives up and returns 0 if no pulse starts within a specified time out.
Page 104
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 9.1 code folder Experimental result: Now, we can see the frequency data on the serial port, and if we rotate the potentiometer, the frequency data will change, too.
Project 9.2 DC motor Experimental objective: In this experiment, we will learn how to use Arduino to control the state of DC motor and display the state on LED, the states of DC motor include forward, backward, acceleration, deceleration and stop.
Page 108
OA, OB: These are used to connect the DC motor. VCC: Power supply (+5V) GND: The cathode of the power supply (Ground). IA, IB: The input terminal of drive signal. DC motor A DC motor is any of a class of electrical machines that converts direct current electrical power into mechanical power.
Page 109
DC motors were the first type widely used, since they could be powered from existing direct-current lighting power distribution systems. A DC motor's speed can be controlled over a wide range, using either a variable supply voltage or by changing the strength of current in its field windings. Small DC motors are used in tools, toys, and appliances.
Page 110
//do something when var equals 2 break; default: // if nothing else matches, do the default // default is optional Syntax switch (var) { case label: // statements break; case label: // statements break; default: // statements Parameters var: the variable whose value to compare to the various cases label: a value to...
Page 111
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram connection diagram 2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 9.2 code folder.
Page 112
Experimental result: button Press 1 to stop or run the DC motor. button Press 2 to forward or reverse the DC motor. button Press 3 to accelerate the DC motor. Press button 4 to decelerate the DC motor. Press one of the buttons, the LED lamp will blink.
Chapter 10 Rotary Encoder Module Project 10.1 Rotary Encoder Module Experimental objective: experiment In this , we will learn how to use the rotary encoder. Required materials: - 1* Arduino UNO - 1* USB cable - 1* Rotary encoders - 1* 5-pin wires Operating principle:...
Page 114
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 111 -...
Page 115
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 10.1 code folder - 112 -...
Page 116
Experimental result: When we rotate the rotary encoder clockwise, the value of rotary encoder will increase progressively, likewise, when we rotate the rotary encoder anticlockwise, the value of rotary encoder will decrease progressively. When we press the rotary encoder, its value will return to zero.
Page 117
Experimental conclusion: After this course we have known how to read the value of rotary encoder, and in the following courses, we will gradually learn some series experiment about rotary encoder. - 114 -...
Project 10.2 Rotary Encoder controls RGB Experimental objective: In this experiment, we will learn how to rotate the rotary encoder to control RGB lamp. Required materials: - 1* Arduino UNO - 1* USB cable - 1* Rotary encoders - 1* RGB LED - 3* 220Ω...
Page 119
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 10.2 code folder. - 116 -...
Page 120
Experimental result: Now we can see that when we rotate the rotary encoder, the RGB lamp will change color, when the value of rotary encoder get to 5, the RGB lamp will change color automatically. Experimental conclusion: After this course, we know how to use the rotary encoder to control RGB lamp.
Project10.3 LCD1602 display the value of the rotary encoder Experimental objective: In this experiment, we will combine the last two courses and learn how to read the value of rotary encoder to LCD1602 which is connected to IIC interface module.
Page 122
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 119 -...
Page 123
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 10.3 code folder - 120 -...
Page 124
Experimental result: rotate When we the rotary encoder, we can see the corresponding data on LCD. Experimental conclusion: After this course we have a better understanding about the rotary encoder and further consolidate the usage of LCD1602. - 121 -...
Chapter 11 Ultrasonic Distance Sensor Project 11.1 Ultrasonic Distance Sensor Experimental objective: experiment In this , we will learn about ultrasonic module. Required materials: - 1* Arduino UNO - 1* USB Cable - 1* Ultrasonic Distance Sensor - Several Jumper Wires Operating principle:...
Page 126
So, the formula for the one-way distance in centimeters is: microseconds / 29 Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 123 -...
Page 127
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 11.1 code folder. - 124 -...
Page 128
Experimental result: Now we can that ultrasonic distance senor displays the data that it read on the serial port. - 125 -...
Page 129
Experimental conclusion: After this course, we have a basic understanding about the ultrasonic module and we can display the value it read on the serial port. - 126 -...
Page 130
Project 11.2 LCD1602 display Ultrasonic value Experimental objective: In this experiment, we will combine the ultrasonic module we have learned before with LCD and IIC interface module and make series experiment. Required materials: - 1* Arduino UNO - 1* USB Cable...
Page 131
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 11.2 code folder. - 128 -...
Page 132
Experimental result: Now we can see the value read by ultrasonic on LCD1602. Experimental conclusion: After this course, we know how to read the value of ultrasonic and display it on LCD. We can use these components and parts to do other interesting experiments in the future.
Chapter 12 processing Project 12.1 Photoresistor Control picture brightness Experimental objective: In this experiment, we start to learn the software Processing, and combine it with Arduino, then use photoresistor to control the brightness of the picture. Required materials: - 1* Arduino UNO - 1* USB Cable - 1*10KΩ...
Page 134
Operating steps: 1. When the power is off, we integrate all the required materials according to the schematic diagram or connection diagram. Schematic diagram - 131 -...
Page 135
2.Compile the experimental code and download it to arduino UNO R3 Arduino Experimental code Refer to Project 12.1 cod/ photo_data folder 3. Start Processing, compile and execute Processing code. Processing Experimental code: Refer to Project 12.1 cod / Brightness_Photoresistor folder(Notice: the picture must be put in Processing folder, and then it can be operated correctly)...
Page 136
Experimental result: Now, when we cover the photoresistor on arduino UNO with hand, we can see that the brightness of the picture will change correspondingly. - 133 -...
Page 137
Experimental conclusion: After this course, we know how to combine Processing with Arduino, and use photoresistor to control the brightness of the picture. - 134 -...
Project 12.2 processing Control Experimental objective: In this experiment, we will learn how to control the color of RGB lamp through Processing. Required materials: - 1* Arduino UNO - 1* USB Cable - 3* 220Ω Resistor - 1* RGB LED...
Page 140
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 12.2 code folder Experimental result: Now, we click the picture on Processing, and the RGB lamp will show different colors. - 137 -...
Page 141
Experimental result: After this course, we can click any part of the picture on Processing and make the RGB on arduino display different colors. - 138 -...
Page 142
Project 12.3 processing Detect ultrasonic data Experimental objective: this experiment, we start to learn how to display the data that read by ultrasonic on Processing. Required materials: - 1* Arduino UNO - 1* USB Cable - 1* Ultrasonic module...
Page 144
2.Compile the experimental code and download it to arduino UNO R3 Experimental code Refer to Project 12.3 code folder. - 141 -...
Page 145
Experimental result: Now we can see the value of distance detected by arduino on Processing. - 142 -...
Page 146
Experimental conclusion: After this course, we know how to display the value of distance detected by ultrasonic on Processing. - 143 -...
Page 147
Project 12.4 Processing pong Experimental objective: In this course, we will learn to make a ping pong game. Required materials: - 1* Arduino UNO - 1* USB Cable - 2* 10KΩ Potentiometer - 1* Breadboard - Several Jumper Wires Operating steps:...
Page 148
2.Compile the experimental code and download it to arduino UNO R3 Refer to Project 12.4 code folder the code downloading process: First we download the ping program in folder to the UNO development board, and then start Processing, next compile and execute the code in pong folder.
Page 149
Experimental result: Now we can use two potentiometers to control the baffles on both sides of the table. - 146 -...
Page 150
Experimental conclusion: After this course, we know how to use the potentiometer to control the sliding of Processing ping pong bats and we can play it with our friends. - 147 -...
Need help?
Do you have a question about the Primary Starter Kit and is the answer not in the manual?
Questions and answers