Elego 37 SENSOR KIT Tutorial

Text of the manual

2 / 137

Preface Our Company Established in 2011, Elego Inc. is a professional manufacturer and exporter that is concerned with the design, development production and marketing of arduino, 3d printers, raspberry pi and STM32. We are located in Shenzhen which is known as Chinese Silicon Valley. All of our products comply with international quality standards and are greatly appreciated in a variety of different markets throughout the world. Our official website is: Http://www.elego.cc Our USA amazon shop is: Http://www.amazon.com/shops/A2WWHQ25ENKVJ1 Our Tutorial The tutorial is for beginners. In the tutorial, you can learn how to use arduino controller board, sensors and components. You can also learn the basic knowledge of all the parts. But if you want to study arduino systematically, we recommend you to buy the book "Arduino Cookbook" which is written by Michael Margolis. Our after-sales If you have any question or suggestion about our company, product or tutorial. Please send us a email. Our email address is [email protected]. We will very appreciate and improve ourselves so that we can offer you a better service.

5 / 137

Lesson Listing Lesson 0 Installing IDE ......................................................................................................................................... 6 Lesson 1 Add Libraries....................................................................................................................................... 14 Lesson 2 TEMP AND HUMIDITYMODULE .......................................................................................................... 18 Lesson 3 DS18B20 DIGITAL TEMPERATURE SENSOR MODULE ......................................................................... 23 Lesson 4 BUTTON SWITCH MODULE ................................................................................................................. 28 Lesson 5 FOUR TYPE OF SWITCH MODULE........................................................................................................ 31 Lesson 6 IR RECEIVER AND EMISSION ............................................................................................................... 37 Lesson 7 Active and passive buzzer................................................................................................................... 43 Lesson 8 LASER MODULE .................................................................................................................................. 49 Lesson 9 SMD RGB MODULE AND RGB MODULE .............................................................................................. 53 Lesson 10 PHOTO-INTERRUPTER MODULE ....................................................................................................... 59 Lesson 11 DUAL-COLOR COMMON-CATHODE LED ........................................................................................... 63 Lesson 12 PHOTORESISTOR MODULE ............................................................................................................... 68 Lesson 13 BIG SOUND SENSOR MODULE AND SMALL SOUND SENSOR MODULE ............................................ 73 Lesson 14 REED SWITCH AND MINI REED SWITCH MODULE ............................................................................ 78 Lesson 15 DIGITAL TEMPERATURE MODULE .................................................................................................... 85 Lesson 16 LINEAR HALL AND ANALOG HALL MODULE ...................................................................................... 91 Lesson 17 FLAME SENSOR MODULE.................................................................................................................. 98 Lesson 18 MENTAL TOUCH MODULE .............................................................................................................. 102 Lesson 19 7 COLOR FLASH LED MODULE ......................................................................................................... 106 Lesson 20 Magic light cup MODULE ................................................................................................................ 109 Lesson 21 JOYSTICK MODULE ......................................................................................................................... 112 Lesson 22 TRACKING MODULE ........................................................................................................................ 117 Lesson 23 Infrared 38KHz obstacle avoidance module ................................................................................... 120 Lesson 24 ROTARY ENCODERS MODULE ......................................................................................................... 125 Lesson 25 1 CHANNEL RELAY MODULE ........................................................................................................... 130 Lesson 26 HEARTBEAT MODULE ..................................................................................................................... 134

6 / 137

Lesson 0 Installing IDE Introduction In this lesson, you will learn how to setup your computer to use Arduino and how to set about the lessons that follow. Installing Arduino (Windows) The Arduino software that you will use to program your Arduino is available for Windows, Mac and Linux. The installation process is different for all three platforms and unfortunately there is a certain amount of manual work to install the software. There is no installer program, but rather you have to unzip a folder which gives you an Arduino folder that contains the Arduino program and a few other items. In a separate step, you must then install USB drivers, which is the only bit that is a bit fiddly. Get started by visiting the Arduino.cc website. As of April 2014 we suggest v1.05 as 1.5 is still in beta. If 1.5 is no longer in beta when you read this you can try it out! Start by downloading the zip file for Windows. There is only one version of the software, whether you are using Windows XP through to Windows 7.

7 / 137

When the zip file has downloaded, extract the contents onto the Desktop, by right-clicking on the file and selecting 'Extract All...' from the pop-up menu. Next select your Desktop and click 'Extract'. You can move it somewhere else onto your computer later, just by moving the folder, but for now, just keep it on the Desktop. The Arduino folder contains both the Arduino program itself and also 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. The power light on the LED will light up and you may get a 'Found New Hardware' message from Windows. Ignore this message and cancel any attempts that Windows makes to try and install drivers automatically for you. The most reliable method of installing the USB drivers is to use the Device Manager. This is accessed in different ways depending on your version of Windows. In Windows 7, you first have to open the Control Panel, then select the option to view Icons, and you should find the Device Manager in the list. Under the section ‘Other Devices’ you should see an icon for ‘unknown device’ with a little yellow warning triangle next to it. This is your Arduino.

8 / 137

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 arduino-1.0.2-windows\arduino1.0.2\drivers.

9 / 137

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. That's it, you are now ready for action, so Skip the next section on installation on Mac and Linux and move straight on to 'Boards and Ports'. Installing Arduino (Mac and Linux) Get started by visiting the Arduino.cc website and downloading the matching IDE for your operating system. As of April 2014 we suggest v1.05 as 1.5 is still in beta. If 1.5 is no longer in beta when you read this you can try it out!

10 / 137

Save the install software to your desktop or wherever The process for installing the Arduino software on the Mac is a lot easier than on the PC. As before, the first step is to download the file. In the case of the Mac, it is a zip file. Once downloaded, double-click on the zip file, which will extract a single file called ‘Arduino.app’. This is the whole Arduino application, just drag it into your Applications Folder.

11 / 137

You can now find and launch the Arduino software in your Applications folder. As you are going to use it frequently, you may wish to right-click its icon in the dock and set it to Keep In Dock. There are many different LINUX distributions and the instructions for each distribution are a little different. The Arduino community has done a great job of putting together sets of instructions for each distribution. So follow the link below and select one of the ten or more distributions on offer. Boards and Ports You are now ready to start the Arduino Software, so whatever platform you are using, open the Arduino folder and open the Arduino application contained within it.

12 / 137

This will start the Arduino IDE, but before you can get programming, you have to tell the Arduino software which type of Arduino board you are using and also select the port it is connecting to. To tell the Arduino IDE which type of board you are using. From the 'Tools' menu, select Board and then 'Arduino Uno' or 'Leonardo' as appropriate. Also on the 'Tools' menu, you will find the 'Serial Port' option. Select this option.

13 / 137

If you are using Windows, there will probably only be one option here and it will either say COM3 or COM4. Even though there is only one option, you will still need to select it. If you are using a Mac or Linux, there will be more options there, but it will usually be the top option in the list, as this will be the device most recently plugged in. This is useful, as the name of the port may not look like it has anything to do with Arduino. It will probably be called something like /dev/tty.usbmodemXXXX or /dev/ttyUSBn

14 / 137

Lesson 1 Add 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. For example, the built-in LiquidCrystal library makes it easy to talk to character LCD displays. There are hundreds of additional libraries available on the Internet for download. The built-in libraries and some of these additional libraries are listed in the reference. To use the additional libraries, you will need to install them. How to Install a Library Using the Library Manager To install a new library into your Arduino IDE you can use the Library Manager (available from IDE version 1.6.2). Open the IDE and click to the "Sketch" menu and then Include Library > Manage Libraries.

15 / 137

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. If the version selection menu does not appear, don't worry: it is normal. 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. You can now find the new library available in the Include Library menu. If you want to add your own library open a new issue on github.

16 / 137

Importing a .zip Library Libraries are often distributed as a ZIP file or folder. The name of the folder is the name of the library. Inside the folder will be a .cpp file, a .h file and often a keywords.txt file, examples folder, and other files required by the library. Starting with version 1.0.5, you can install 3rd party libraries in the IDE. Do not unzip the downloaded library, leave it as is. In the Arduino IDE, navigate to Sketch > Include Library. At the top of the drop down list, select the option to "Add .ZIP Library''. You will be prompted to select the library you would like to add. Navigate to the .zip file's location and open it. 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 > Examplesuntil after the IDE has restarted. Manual installation To install the library, first quit the Arduino application. Then uncompress the ZIP file containing the library. For example, if you're installing a library called "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.)

17 / 137

Drag the ArduinoParty folder into this folder (your libraries folder). Under Windows, it will likely be called "My Documents\Arduino\libraries". For Mac users, it will likely be called "Documents/Arduino/libraries". On Linux, it will be the "libraries" folder in your sketchbook. Your Arduino library folder should now look like this (on Windows): My Documents\Arduino\libraries\ArduinoParty\ArduinoParty.cpp My Documents\Arduino\libraries\ArduinoParty\ArduinoParty.h My Documents\Arduino\libraries\ArduinoParty\examples .... or like this (on Mac and Linux): Documents/Arduino/libraries/ArduinoParty/ArduinoParty.cpp Documents/Arduino/libraries/ArduinoParty/ArduinoParty.h Documents/Arduino/libraries/ArduinoParty/examples .... There may be more files than just the .cpp and .h files, just make sure they're all there. (The library won't work if you put the .cpp and .h files directly into the libraries folder or if they're nested in an extra folder. For example: Documents\Arduino\libraries\ArduinoParty.cpp and Documents\Arduino\libraries\ArduinoParty\ArduinoParty\ArduinoParty.cpp won't work.) Restart the Arduino application. Make sure the new library appears in the Sketch->Import Library menu item of the software. That's it! You've installed a library! Summary In this lesson, we will install all the libraries which we will use in the tutorial. So in the following lesson, we don't need to install them anymore. We just connect the component as the schematic and upload the code provided. Then the kit will work.

18 / 137

Lesson 2 TEMP AND HUMIDITYMODULE Overview In this tutorial we will learn how to use a 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. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x DHT11 module (x) x F-M wires Component Introduction Temp and humidity sensor:

19 / 137

DHT11 digital temperature and humidity sensor is a composite Sensor contains a calibrated digital signal output of the temperature and humidity. Application of a dedicated digital modules collection technology and the temperature and humidity sensing technology, to ensure that the product has high reliability and excellent long-term stability. The sensor includes a resistive sense of wet components and an NTC temperature measurement devices, and connected 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℃ ±5% RH Interchangeability: fully interchangeable Response time: 1 / e (63%) of 25℃ 6s 1m / s air 6s Hysteresis: <± 0.3% RH Long-term stability: <± 0.5% RH / yr in Temperature: Resolution: 16Bit

20 / 137

Repeatability: ±0.2℃ Range: At 25℃ ±2℃ Response time: 1 / e (63%) 10S Electrical Characteristics Power supply: DC 3.5~5.5V Supply Current: measurement 0.3mA standby 60μA 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 Typical Application Connection Schematic

22 / 137

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 21 degree)

23 / 137

Lesson 3 DS18B20 DIGITAL TEMPERATURE SENSOR MODULE Overview In this experiment, we will learn how to use DS18B20 module test the environmental temperature and make a thermometer. Since the previous temperature sensor output is analog. So we need to add additional A/D and D/A chip into the line transformation. More -over, the Arduino external port is not rich resources and the utilization rate is not high. These cause a big challenge. So we are create the Ds18b20 module. The new DS18B20 Temperature Sensor Module is very good solve the problem. It have the characteristicoftheeconomy,unique1-wirebusanditcanfullyapplytheArduinoplatform. Users can easily forma sensor network through using this module. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x DS18B20 module (x) x F-M wires

25 / 137

Principle DS18B20 module is using a single bus. The power supply voltage range of 3.0 V to 5.5 V and no standby power supply. It can Measuretemperaturerangefor-55degreeto+125degree with accuracy of+/-0.5°C. The programmable DPI of temperature sensor is From 9 to 12. temperature conversion is 12 digits lattice type. maximum is 750 milliseconds. Families can be defined non-volatile temperature alarm Settings. Each DS18B20 contains a unique serial number so that multiple ds18b20 scan exist in a bus. Connection Schematic

27 / 137

Temperature sensor can detect temperature in numbers of different places at the same time. Upload the program then open the monitor, we can see the data as below:

28 / 137

Lesson 4 BUTTON SWITCH MODULE Overview In this experiment, we will learn how to use button switch. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x Button module (x) x F-M wires Component Introduction PUSH SWITCHES: Switches are really simple components. When you press a button or flip a lever, they connect two contacts together so that electricity can flow through them. The little tactile switches that are used in this lesson have four connections, which can be a little confusing.

29 / 137

Actually, there are only really two electrical connections, as inside the switch package pins B and C are connected together, as are A and D. Principle BUTTON SWITCH and number 13 port have the built-in LED simple circuit. To produce a switch flasher, we can use connect the digital port 13 to the built-in LED and connect the BUTTON SWITCHS port to number3 port of Elego Uno board. When the switch sensing, LED twinkle light to the switch signal. Connection Schematic

30 / 137

wiring diagram Result Connect the circuit as above and upload the program. Then push the button, you can see led on and off.

31 / 137

Lesson 5 FOUR TYPE OF SWITCH MODULE Overview In this experiment, we will learn how to use switch modules. Including shock switch module, mercury switch module, tilt switch module and knock switch module.

32 / 137

Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x Shock switch module (1) x Mercury switch module (1) x tilt switch module (1) x Knock switch module (x) x F-M wires Principle switch and number 13 port have the built-in LED simple circuit. To produce a SWITCH flasher, we can use connect the digital port 13 to the built-in LED and connect the SWITCH S port to number 3 port of Elego Uno board. When the SWITCH sensing, LED twinkle light to the SWITCH signal. Connection Schematic

36 / 137

Connect the circuit as above and upload the program. Then lean or shock the sensor, you can see led on and off.

37 / 137

Lesson 6 IR RECEIVER AND EMISSION Overview In this experiment, we will learn how to use Infrared Receiver and IR Emission module. In fact now in our daily life they play an important role, a lot of household electrical appliances are used to this kind of device, such as air conditioning, TV, DVD, etc. Actually it is based on its wireless remote sensing and it is very convenient by using them. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x IR Receiver module (1) x IR Emission module

38 / 137

(x) x F-M wires Component Introduction IR RECEIVER SENSOR: IR detectors are little microchips with a photocell that are tuned to listen to infrared light. They are almost always used for remote control detection - every TV and DVD player has one of these in the front to listen for the IR signal from the clicker. Inside the remote control is a matching IR LED, which emits IR pulses to tell the TV to turn on, off or change channels. IR light is not visible to the human eye, which means it takes a little more work to test a setup. There are a few difference between these and say a CdS Photocells: IR detectors are specially filtered for Infrared light, they are not good at detecting visible light. On the other hand, photocells are good at detecting yellow/green visible light, not good at IR light  IR detectors have a demodulator inside that looks for modulated IR at 38 KHz. Just shining an IR LED won't be detected, it has to be PWM blinking at 38KHz. Photocells do not have any sort of demodulator and can detect any frequency (including DC) within the response speed of the photocell (which is about 1KHz)  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

39 / 137

As you can see from these datasheet graphs, the peak frequency detection is at 38 KHz and the peak LED color is 940 nm. You can use from about 35 KHz to 41 KHz but the sensitivity will drop off so that it wont detect as well from afar. Likewise, you can use 850 to 1100 nm LEDs but they wont work as well as 900 to 1000nm so make sure to get matching LEDs! Check the datasheet for your IR LED to verify the wavelength. Try to get a 940nm - remember that 940nm is not visible light (its Infra Red)! Principle Firstly, let's know the structure of the infrared receiving head: there are two important elements inside the infrared receiving head, IC and PD. IC is receiving head processing components, mainly composed of silicon and circuit. It is a highly integrated device. The main function is filter, plastic, decoding, amplification, etc. PD is a photosensitive diode. The main function is to receive the light signal. Below is a brief working principle diagram:

40 / 137

Infrared emitting diode launch out the modulation signal and infrared receiver head will receive, decode, filter and soon to regain the signal. Infrared emitting diode: keep clean and in good condition. All the parameters in the process of working shall not exceed the limit value (positive To the current 30~60mA, positive pulse current 0.3~1A, reverse voltage 5V, dissipation power 90mW, working temperature range -25~+80℃, and storage temperature range between 40~100℃, the welding temperature 260℃) infrared to be with a closed head should be matching use, otherwise it will influence the sensitivity. Connection Schematic

43 / 137

Lesson 7 Active and passive buzzer Overview In this experiment, we will learn how to use buzzer module. With the Arduino we can complete a lot of interactive work, commonly what we used is the light shows. And we has been use the LED small lights in the experiment before. In this experiment we will make the circuit having noise. The common components that can make sound are buzzer and speakers. Compared to the speaker, buzzer is more simple and easy to use so in this experiment we adopts the buzzer. Component Required: (1) x Elego Uno R3

44 / 137

(1) x USB cable (1) x Active buzzer module (1) x Passive buzzer module (x) x F-M wires Component Introduction Active Buzzer: As a type of electronic buzzer with integrated structure, buzzers, which are supplied by DC power, are widely used in computers, printers, photocopiers, alarms, electronic toys, automotive electronic devices, telephones, timers and other electronic products for voice devices. Buzzers can be categorized as active and passive ones (see the following picture). Turn the pins of two buzzers face up, and the one with a green circuit board is a passive buzzer, while the other enclosed with a black tape is an active one. The difference between an active buzzer and a passive buzzer is: An active buzzer has a built-in oscillating source, so it will make sounds when electrified. But a passive buzzer does not have such source, so it will not tweet if DC signals are used; instead, you need to use square waves whose frequency is between 2K and 5K to drive it. The active buzzer is often more expensive than the passive one because of multiple built-in oscillating circuits. Passive Buzzer: Passive buzzer, in fact, just use PWM generating audio, drives the buzzer, allowing the air to vibrate, can sound. Appropriately changed as long as the vibration frequency, it can generate different sound scale. For example, sending a pulse wave can be generated 523Hz Alto Do, pulse 587Hz can produce midrange Re, 659Hz can produce midrange Mi. If you then with a different beat, you can play a song. Here be careful not to use the Arduino analog Write () function to generate a pulse wave, because the frequency analog Write () is fixed (500Hz), no way to scale the output of different sounds. Distinguish between Active and Passive Buzzer Teach you to distinguish between active and passive buzzer Now a small buzzer on the market because of its small size (diameter of only ll mm), light weight, low price, solid structure, and is widely used in a variety of needs audible electrical

45 / 137

equipment, electronic production and microcontroller circuits, etc. . From the exterior, two kinds of buzzer seems the same, but a closer look, a slight difference between the height of the active buzzer a, height of 9mm, and passive buzzer b height of 8mm. When the buzzer as the two pins are facing up, you can see there is a green circuit board is passive buzzer, no closed circuit boards with a vinyl is active buzzer . Further determine the active and passive buzzer, you can also use a multimeter to test the resistance profile Rxl file: buzzer with black pen then "+" pin, the red pen to touch on another pin back and forth, if trigger a cracking, cracking sound and the resistance only 8Ω (or 16Ω) is passive buzzer; If you can emit continuous sound, and the resistance in Europe and more than a few hundred, and is an active buzzer. Active buzzer directly connected to the rated power (new buzzer has stated on the label) can be a continuous sound; rather passive electromagnetic buzzer and speaker are the same, you need to take in order to sound the audio output circuit . Connection Schematic

47 / 137

Result After we connect the circuit as the picture, we upload the program of each module. We can hear that the active buzzer can make sound in one voice. And the passive can sing a song.

49 / 137

Lesson 8 LASER MODULE Overview I n this experiment, we will learn how to use laser module. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x Laser module (x) x F-M wires Component Introduction Laser sensor:

52 / 137

Result After we connect the circuit as the picture, we upload the program. We can see the module can emission lasers.

53 / 137

Lesson 9 SMD RGB MODULE AND RGB MODULE Overview In this experiment, we will learn how to use SMD RGB module and RGB module. Actually, the function of SMD RGB module and RGB module are almost the same. But we can choose the shape we like or we need. SMD RGB LED module and RGB module are made from a patch of full-color LED. By adjusting the voltage input of R, G, B pins, we can adjust the strength of the three primary colors (red/blue/green) so as to implementation result of full color effect. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x SMD RGB module

54 / 137

(1) x RGB module (x) x F-M wires Component Introduction SMD RGB: RGB:

57 / 137

Result After we connect the circuit as the picture, we upload the program of each module. We can see the module changing their color as the code set. If you want to make it change the color in different way, you can revise the code.

59 / 137

Lesson 10 PHOTO-INTERRUPTER MODULE Overview I n this experiment, we will learn how to use Photo-interrupter module. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x Photo-interrupter MODULE (x) x F-M wires Component Introduction Opto Interrupter Sensor:

60 / 137

Opto Interrupters are commonly used in many arcade games e.g. steering assembly in older driving games, scoring switches in Whack A Crock etc. Uninterrupted light beam will turn the phototransistor "ON" connecting the ground to the game board input. When the light beam is interrupted the phototransistor turns "OFF" , the ground is disconnected from the input and the pull-up resistor R1 forces the input to go "HIGH" (5V level). Principle Photo-interrupter module and number 13 port have the built-in LED simple circuit. To produce a switch flasher, we can use connect the digital port 13 to the built-in LED and connect the Photo-interrupter MODULE S port to number 3 port of Elego Uno board. When the switch sensing, LED twinkle light to the switch signal.

62 / 137

Result After we connect the circuit as the picture, we upload the program, we sensing the opto Interrupter, then we can see the LED13 light up and light off.

63 / 137

Lesson 11 DUAL-COLOR COMMON-CATHODE LED Overview In this experiment, we will learn how to use Dual-color Common-Cathode LED. Component Required: (1) x Elego Uno R3 (1) x USB cable (2) x Dual-color Common-Cathode LED (x) x F-M wires Component Introduction Dual-color Common-Cathode led:

66 / 137

Result After we connect the circuit as the picture, we upload the program of each module. We can see the module changing their color as the code set. If you want to make it change the color in different way, you can revise the code.

68 / 137

Lesson 12 PHOTORESISTOR MODULE Overview In this experiment, we will learn how to use the photo-resistor module. Photo-resistor is very common in our daily life. it is mainly used in intelligent switch so as to bring convenience to our life. At the same time, in our daily life, we also use it in electronic design. So in order to use it in a better, we provide the corresponding modules to help us to use it more conveniently and efficiently. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x Photoresistor module (x) x F-M wires Component Introduction PHOTOCELL: The photocell used is of a type called a light dependent resistor, sometimes called an LDR. As the name suggests, these components act just like a resistor, except that the resistance changes in response to how much light is falling on them. This one has a resistance of about 50 kΩ in near darkness and 500 Ω in bright light. To convert this varying value of resistance into something we can measure on an Arduino's

69 / 137

analog input, it need to be converted into a voltage. The simplest way to do that is to combine it with a fixed resistor. The resistor and photocell together behave rather 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 1kΩ resistor and it is as if the pot were being turned towards GND. Load up the sketch given in the next section and try covering the photocell with your finger, and holding it near a light source. Connection Schematic

71 / 137

Result Upload the program then open the monitor, we can see the data as below:

72 / 137

In the test, we only read the output analog voltage value of photo-resistor module. In the test results, we will find that when there is lighting, high voltage output equivalently of switch on, when there is no light, low voltage equivalently of switch off. This is what we can use this in practice.

73 / 137

Lesson 13 BIG SOUND SENSOR MODULE AND SMALL SOUND SENSOR MODULE Overview In this experiment, we will learn how to use the High-sensitive Voice Sensor. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x Big sound sensor module (1) x Small sound sensor module (x) x F-M wires

74 / 137

Component Introduction Sound sensor: The sound sensor module provides an easy way to detect sound and is generally used for detecting sound intensity. This module can be used for security, switch, and monitoring applications. Its accuracy can be easily adjusted for the convenience of usage. It uses a microphone which supplies the input to an amplifier, peak detector and buffer. When the sensor detects a sound, it processes an output signal voltage which is sent to a microcontroller then performs necessary processing. Connection Schematic

75 / 137

wiring diagram Result High-sensitive Voice Sensor has two output: AO, analog output, real-time output voltage signal of microphone DO, 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 potentiometer adjustment period. The module features: The installation of 3mm screw holes use 5 v dc power supply have analog output turn a threshold level of output microphone GaoGan degree, high sensitivity. has a power light the comparator output indicator light. Upload the program then open the monitor, we

78 / 137

Lesson 14 REED SWITCH AND MINI REED SWITCH MODULE Overview In this experiment, we will learn how to use reed switch and mini reed switch module. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x Reed switch module (1) x Mini Reed switch module (x) x F-M wires

79 / 137

Component Introduction Reed Switch and Reed Sensor Activation: Although a reed switch can be activated by placing it inside an electrical coil, many reed switches and reed sensors are used for proximity sensing and are activated by a magnet. As the magnet is brought into the proximity of the reed sensor/switch, the device activates. As the magnet is removed from the proximity of the reed sensor/switch, the device deactivates. However, the magnetic interaction involved in activating the reed switch contacts is not necessarily obvious. One way of thinking about the interaction is that the magnet induces magnetic poles into the metal parts of the reed switch and the resulting attraction between the electrical contacts causes the reed switch to activate. Another equally valid way of thinking about the interaction between a magnet and a reed switch is that the magnet induces magnetic flux through the electrical contacts. When the magnetic flux is high enough, the magnetic attraction between the contacts causes the reed switch to close. The following are examples of typical reed switch and reed sensor activate distances.

80 / 137

Difference between the reed switch module and mini reed switch module As we can see, the reed switch module is bigger than the mini reed switch module. So the bigger one may have more function than the mini one. The reed switch can output in two ways: digital and analog. The mini reed can only output in digital. In the 37 sensor kit, there have 7 red pcb modules. The difference between the red and small pcb is same as above. Principle As can be seen, the magnetic orientation and location relative to the reed switch play important roles in the activation distances. In addition, the size of the activate regions(lobes) will vary depending on the strength of the magnet and the sensitivity of the reed switch. Proper orientation of the magnet with respect to the reed sensor/switch is an important consideration in meeting the application’s requirements across the tolerance range for mechanical systems, magnetic strength and reed sensor or reed switch sensitivity.

82 / 137

Result Upload the program, When the module access to magnetic, you can see the led on or off. Mini switch module and number 13 port have the built-in LED simple circuit. To produce a switch flasher, we can use connect the digital port 13 to the built-in LED and connect the switch module S port to number 3 port of Elego Uno board. When the switch sensing, LED twinkle light to the switch signal. Connection of reed switch module Schematic

84 / 137

In this experiment, we use the AO pin of reed switch module. When the sensor sensing magnetism, the module will output a data which reflect the strength of the magnetism. The number is from 0 to 1023. Upload the program then open the monitor, we can see the data as below:

85 / 137

Lesson 15 DIGITAL TEMPERATURE MODULE Overview In this experiment, we will learn how to use digital temperature module andanalog temp module. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x digital temperature module (1) x temperature module (x) x F-M wires

86 / 137

Component Introduction Thermistor: These thermistors have a narrow tolerance on the B-value, the result of which provides a very small tolerance on the nominal resistance value over a wide temperature range. For this reason the usual graphs of R = f(T) are replaced by Resistance Values at Intermediate Temperatures Tables, together with a formula to calculate the characteristics with a high precision.

87 / 137

Connection of digital temperature module wiring diagram Result Upload the program, open the monitor then you can see the data as below:

90 / 137

In this experiment, we use the AO pin of reed switch module. When the sensor sensing temperature, the module will output a data which reflect the temperature. The number is from 0 to 1023. Upload the program then open the monitor, we can see the data as below:

91 / 137

Lesson 16 LINEAR HALL AND ANALOG HALL MODULE Overview In this experiment, we will learn how to use the linear hall and analog hall module. Component Required: (1) x Elego Uno R3

92 / 137

(1) x USB cable (1) x DHT11 module (x) x F-M wires Component Introduction Hall Sensor:

93 / 137

Design Factors – Magnetic Types Unipolar: Only a south pole will operate the sensor. The sensor turns on with the south pole(+) and off when the south pole is removed. • Bipolar: Sensor output is pole-dependent. A south pole (+) is designed to activate the sensor; a north pole(-) is designed to deactivate. It’s possible that the sensor could turn off and still be within a positive Gauss level. • Latching: Specifications are tighter on latching. Sometimes it is designed to make certain that when the south pole(+) is removed from the sensor, it will stay on until it sees the opposite pole(-). • Omnipolar: The sensor is designed to operate with either magnetic pole(+ or -). • Ratiometric linear: Output is proportional to magnetic field strength. Output sensitivity range is 2.5 – 3.75 mV per unit of Gauss. Connection Schematic

95 / 137

Result For the hall sensor module, we can choose the output: digital output or analog output. In the following picture, we use the DO port to output. so we can see that if the hall sensor sensing the magnetic force, the light will turn on.

96 / 137

Connection wiring diagram Result In the following picture, we use the AO port to output. so we can see that if the hall sensor sensing the magnetic force, the module will output a data which reflect the strength of the

97 / 137

magnetic force. The number is from 0 to 1023. Upload the program then open the monitor, we can see the data as below: Upload the program then open the monitor, we can see the data as below:

98 / 137

Lesson 17 FLAME SENSOR MODULE Overview In this experiment, we will learn how to use the flame sensor module. This module is sensitive to the flame and radiation. It also can detect ordinary light source in the range of a wavelength 760nm-1100 nm. The detection distance is up to 100 cm. The Flame sensor can output digital or analog signal. It can be used as a flame alarm or in fire fighting robots. Component Required: (1) x Elego Uno R3 (1) x USB cable (1) x Flame sensor module (x) x F-M wires Component Introduction Flame sensor: •Detects a flame or a light source of a wavelength in the range of 760nm-1100 nm • Detection distance: 20cm (4.8V) ~ 100cm (1V) • Detection angle about 60 degrees, it is sensitive to the flame spectrum. • Comparator chip LM393 makes module readings stable. • Adjustable detection range.

99 / 137

• Operating voltage 3.3V-5V • Digital and Analog Output " DO digital switch outputs (0 and 1) " AO analog voltage output • Power indicator and digital switch output indicator Connection Schematic wiring diagram

100 / 137

Result For the flame sensor module, we can choose the output: digital output or analog output. In the following picture, we use the DO port to output. so we can see that if the flame sensor sensing the flame, the light will turn on.

Other Microcontrollers Manuals