Advertisement

Preface
About SunFounder
SunFounder is a technology company focused on Raspberry Pi and Arduino open source
community development. Committed to the promotion of open source culture, we strive to
bring the fun of electronics making to people all around the world and enable everyone to
be a maker. Our products include learning kits, development boards, robots, sensor modules
and development tools. In addition to high quality products, SunFounder also offers video
tutorials to help you build your own project. If you have interest in open source or making
something cool, welcome to join us! Visit www.sunfounder.com for more!
About Sensor Kit V1.0
This kit is suitable for SunFounder Uno, SunFounder Mega 2560, SunFounder Duemilanove and
SunFounder Nano. All the code in this user manual is compatible with these boards.
Our SunFounder board is fully compatible with Arduino board.
You can go to our official website
www.sunfounder.com
to download related code by
clicking LEARN -> Get Tutorials. If you have any questions, please send an email to
support@sunfounder.com. Also welcome to leave a message and share your projects on our
FORUM.
Note: This kit is different from other kits. All the components in this kit are provided in the form
of modules which integrate some necessary components, such as comparator, resistor, and
capacitor and so on. Therefore it is convenient for circuit connection.
Reprint 2.0

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Sensor Kit V1.0 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for SunFounder Sensor Kit V1.0

  • Page 1 About Sensor Kit V1.0 This kit is suitable for SunFounder Uno, SunFounder Mega 2560, SunFounder Duemilanove and SunFounder Nano. All the code in this user manual is compatible with these boards. Our SunFounder board is fully compatible with Arduino board.
  • Page 2: Table Of Contents

    Contents Components List ..........................1 Notice ..............................8 Lesson 1 Hall Sensor ........................... 10 Lesson 2 RGB LED ..........................15 Lesson 3 Dual-color Common-Cathode LED ................. 18 Lesson 4 Shock Switch ........................20 Lesson 5 Knock Sensor ........................22 Lesson 6 Infrared Transmitter ......................24 Lesson 7 Laser Transmitter .........................
  • Page 3 Lesson 27 Flame Sensor ........................69 Lesson 28 Relay Module ........................71 Lesson 29 Joystick PS2 ........................73 Lesson 30 MQ-2 Gas Sensor......................75 Lesson 31 Password Lock ........................77 Lesson 32 Lie Detector ........................79 Lesson 33 Fire Alarm .......................... 81 Lesson 34 Thermostatic Water Tank System ...................
  • Page 4: Components List

    Components List Name Qty. Component Analog Hall Sensor Switch Hall Sensor RGB LED Dual-color Common-Cathode LED...
  • Page 5 Shock Switch Knock Sensor Infrared Transmitter Laser Transmitter Reed Switch Mini Reed Infrared Receiver...
  • Page 6 Analog Temperature Sensor Digital Temperature Sensor Active Buzzer Passive Buzzer Button Switch Photo-interrupter Tilt Switch...
  • Page 7 Mercury Switch Magic Cup DS18B20 Temperature Sensor Rotary Encoder 7-color Auto-flash LED Photoresistor Sensor...
  • Page 8 Humiture Sensor Obstacle Avoidance Sensor Tracking Sensor Microphone Sensor High-sensitive Voice Sensor Metal Touch Sensor Flame Sensor...
  • Page 9 Relay Module Joystick PS2 MQ-2 Gas Sensor LCD1602 4x4 Keypad Remote Control...
  • Page 10 250k Ohm Potentiometer 470k Ohm Resistor Breadboard Jumper Wire (M to F) Jumper Wire (M to M)
  • Page 11: Notice

    Notice All the experiments in this kit are done with SunFounder Uno R3 board, but they are also compatible with SunFounder Mega 2560, SunFounder Nano and all official Arduino Boards. All the code included in this kit works with these boards.
  • Page 13: Lesson 1 Hall Sensor

    Lesson 1 Hall Sensor Introduction Based on the Hall Effect, a hall sensor is one that varies its output voltage in response to a magnetic field. Hall sensors are used for proximity switching, positioning, speed detection, and current sensing applications. Hall sensors can be categorized into linear (analog) Hall sensors and switch Hall sensors.
  • Page 14 Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Hall sensor module - 1 * LCD1602 - 1 * Potentiometer - Several jumper wires Experimental Principles Hall Effect Hall Effect is a kind of electromagnetic effect. It was discovered by Edwin Hall in 1879 when he was researching conductive mechanism about metals.
  • Page 15 Step 4: Upload the sketch to SunFounder Uno Now, you can see the LED attached to pin 13 on SunFounder Uno board blinking. If a magnet approaches the linear Hall sensor, the blinking frequency of LED will increase or decrease.
  • Page 16 Now, place a magnet close to the switch Hall sensor. Then the indicator LED on the switch Hall sensor will light up and the buzzer will beep. At the same time, the LED attached to pin 13 on the SunFounder Uno board will light up.
  • Page 17 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, put a magnet close to the linear Hall sensor, and the indicator LED on the linear Hall sensor will light up. At the same time, the analog and digital value displayed on the LCD will...
  • Page 18: Lesson 2 Rgb Led

    There are two kinds of packages for RGB LED (as shown below) in this kit. One is Surface Mount Device (SMD) type, and the other is Dual In-line Package (DIP) type. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * RGB LED module...
  • Page 19 at any given time. Voltage or current source is applied to an analog load in the form of ON or OFF repetitive pulse sequence. When it is on, DC power supply will be applied to the load; when it is off, DC power supply will be disconnected. If only the bandwidth is wide enough, any analog value can be encoded by PWM.
  • Page 20 LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, you can see the RGB LED flash red, green and blue first, and then red, orange, yellow, green, blue, indigo and purple.
  • Page 21: Lesson 3 Dual-Color Common-Cathode Led

    Dual-color Common-Cathode LED SunFounder Uno Y ------------------------------------------- D10 - ------------------------------------------ GND R ------------------------------------------- D11 Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno...
  • Page 22 Now, you can see the dual-color LED flashing yellow, red, and mixed colors.
  • Page 23: Lesson 4 Shock Switch

    It composes of conductive vibration spring, switch, trigger pin, packaging agent and so on. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Shock switch module - Jumper wires...
  • Page 24 LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, shake the switch module and you will see the LED attached to pin 13 on the SunFounder Uno board light up.
  • Page 25: Lesson 5 Knock Sensor

    Knock Sensor Module SunFounder Uno S ----------------------------------------D3 - ------------------------------------- GND + --------------------------------------- 5V Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno...
  • Page 26 Now, knock the sensor and the LED attached to pin 13 on the SunFounder Uno board will light up.
  • Page 27: Lesson 6 Infrared Transmitter

    An infrared transmitter module (as shown below) is a device that uses 38K modulation signal generated by MCU to emit infrared rays. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Infrared transmitter module...
  • Page 28 Now, you can see the infrared transmitter emit infrared rays through a camera or your phone camera. At the same time, the LED attached to pin 13 on SunFounder Uno board lights up and a coded value is displayed on the LCD.
  • Page 29: Lesson 7 Laser Transmitter

    The Laser Transmitter module (as shown below), as the name suggests, is a one that can emit laser. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Laser transmitter module...
  • Page 30 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, you can see the laser transmitter module send out Morse signals. Note: DO NOT look directly at the laser head. It can cause great harm to your eyes.
  • Page 31: Lesson 8 Reed Switch

    There are two reed switches in this kit: reed switch and mini reed. They work in the same principle. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Reed switch module - Several jumper wires Experimental Principle A reed switch is a type of line switch component that realizes control by magnetic signals.
  • Page 32 In this experiment, since an LED has been attached to pin 13, just connect pin D0 of the reed switch to D8 of the SunFounder Uno board. When the reed switch inducts magnetic field signals, the LED will be on. Otherwise, it will be off.
  • Page 33 Mini Reed The experimental procedures are the same as those of Reed Switch. Connect pin S to D2 of the SunFounder board, and you will see the LED attached to pin 13 light up when a magnet approaches the mini reed.
  • Page 34: Lesson 9 Infrared-Receiver

    Control a certain key (for example, Power key) via a remote controller by programming. When you press the key, infrared rays will be emitted from the remote controller and received by the infrared receiver, and the LED on the SunFounder Uno board will light up. Experimental Procedures...
  • Page 35 Now, press Power on the remote control and the LED attached to pin 13 on the SunFounder Uno board will light up. If you press other keys, the LED will go out.
  • Page 36: Lesson 10 Analog Temperature Sensor

    It can detect surrounding temperature changes in real time and send the temperature data to analog I/O port of the SunFounder Uno board. You only need to convert the output to Celsius temperature by simple programming and display it on an LCD.
  • Page 37 Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, touch the thermistor and you can see the current temperature displayed on the LCD in both Celcius and Fahrenheit degrees.
  • Page 38: Lesson 11 Digital Temperature Sensor

    13 of SunFounder to build a simple circuit to make a temperature light. With the LED attached to pin 13, connect the pin DO to D7 of SunFounder Uno. When the Digital Temperature Sensor detects that the ambient temperature is higher than a certain value (threshold), the LED will be on.
  • Page 39 LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, touch the thermistor and you will see the LED attached to pin 13 on SunFounder Uno board light up after a while.
  • Page 40: Lesson 12 Buzzer

    Lesson 12 Buzzer Introduction Buzzers can be categorized as active buzzers and passive ones (See the following picture). Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Buzzer module - Several jumper wires...
  • Page 41 + -------------------------------------- 5V Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, you can hear the passive buzzer beep for warning.
  • Page 42 - ----------------------------------- GND + ------------------------------------ 5V Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, you can hear the active buzzer beep.
  • Page 43: Lesson 13 Button Switch

    Lesson 13 Button Switch Introduction Most SunFounder boards already have an LED attached to pin 13 itself. So we will use a button module and this LED to build a simple circuit and make an LED brighten. Components - 1 * SunFounder Uno board...
  • Page 44 Now, press the button and the LED attached to pin 13 on the SunFounder Uno board will light...
  • Page 45: Lesson 14 Photo-Interrupter

    Photo-interrupter Module SunFounder Uno S --------------------------------------- A0 - -------------------------------------- GND + --------------------------------------- 5V Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno...
  • Page 46 Now, stick a piece of paper in the gap of the sensor, and the LED attached to pin 13 on the SunFounder Uno will go out; remove the paper, and then the LED will light up again.
  • Page 47: Lesson 15 Tilt-Switch

    SunFounder board to build a simple circuit. With the LED attached to pin 13, connect pin S to D2 of SunFounder Uno board. When the Tilt-switch inducts tilt signals, the LED will be on. Otherwise, it will be off.
  • Page 48 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, tilt the switch and the LED attached to pin 13 on the SunFounder Uno board will light...
  • Page 49: Lesson 16 Mercury Switch

    - Several jumper wires Experimental Principle Since the LED has been attached to pin 13, just connect pin S to D2 of the SunFounder Uno board. When the mercury switch inducts tilt signals, the LED will be on. Otherwise it will be off.
  • Page 50 Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, tilt the switch and the LED attached to pin 13 on the SunFounder Uno board will light...
  • Page 51: Lesson 17 Magic Cup

    LED will slowly brighten. The effect is just like the telepathy. Experimental Procedures Step 1: Connect pin S and pin L of one module to D7 and pin 5 of the SunFounder Uno; pin S and pin L of the other module to D4 and pin 6 of Uno.
  • Page 52 Now, tilt the breadboard and you will see the LED on one module gets dimmer while that on the other LED becomes brighter.
  • Page 53: Lesson 18 Ds18B20 Temperature Sensor

    Different from conventional AD collection temperature sensors, it uses a 1-wire bus and can directly outputs temperature data. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * DS18B20 Temperature Sensor module - 1 * LCD1602...
  • Page 54 Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, you can see the value of the current temperature displayed on the LCD.
  • Page 55: Lesson 19 Rotary Encoder

    Rotary encoders act as sensors for detecting angle, speed, length, position and acceleration in automation field. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Rotary Encoder module...
  • Page 56 1 is high, then you can tell whether the rotary encoder turns left or right as long as you know the state of output 2. Experimental Procedures Step 1: Build the circuit Rotary Encoder Module SunFounder Uno CLK -----------------------------------D2 DT ------------------------------------ D3 SW ------------------------------------ D4 + -------------------------------------- 5V...
  • Page 57 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, you can see the angular displacement of the rotary encoder printed on Serial Monitor. When you spin the rotary encoder clockwise, the angular displacement increases; when you spin it counterclockwise, the value decreases.
  • Page 58: Lesson 20 7-Color Auto-Flash Led

    When being power on, the 7-color auto-flash LED will flash built-in colors. Experimental Procedures Just connect pin S to 5V of the SunFounder Uno board and pin - to GND. Now, you can see the 7-color auto-flash LED flashing seven colors.
  • Page 59: Lesson 21 Photoresistor Sensor

    A photoresistor can be applied in light-sensitive detector circuits, and light- and dark-activated switching circuits. In this experiment, hook up pin S to an analog port of the SunFounder board. When the light intensity changes, the resistance of photoresistor will change accordingly. Thus it will also change the output voltage of pin S.
  • Page 60 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, cover the photoresistor with a cloth or your palm to change the light intensity, and you will find the value displayed on the LCD changes accordingly.
  • Page 61: Lesson 22 Humiture Sensor

    The sensor includes a resistive sense of wet component and an NTC temperature measurement device, and is connected with a high-performance 8-bit microcontroller. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Humiture sensor module...
  • Page 62 Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, you can see the value of the current humidity and temperature displayed on the LCD.
  • Page 63: Lesson 23 Obstacle Avoidance Sensor

    In this experiment, we will use an obstacle avoidance sensor module and an LED attached to pin 13 of the SunFounder board to build a simple circuit. With the LED attached to pin 13, connect pin OUT to D8 of the SunFounder board. When the obstacle avoidance sensor detects an obstacle, the LED will be on.
  • Page 64 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, put an obstacle in front of the Obstacle Avoidance Sensor and the LED attached to pin 13 on the SunFounder Uno board will light up.
  • Page 65: Lesson 24 Tracking Sensor

    13 of the SunFounder Uno board to build a simple circuit to make a tracking light. Since an LED has been attached to pin 13, connect the pin out to D8 of the SunFounder Uno board. When the tracking sensor detects reflection signals (white), the LED will be on.
  • Page 66 Step 4: Upload the sketch to SunFounder Uno Now, draw two black thick lines on the paper. If the rays emitted by the sensor encounter the black lines, the LED attached to pin 13 on SunFounder Uno board will light up. Otherwise, it will go out.
  • Page 67: Lesson 25 Microphone Sensor

    DO: When sound intensity reaches a certain threshold, the sensor outputs high or low level (you can adjust the threshold by potentiometer) Microphone Sensor High-sensitive Voice Sensor Components - 1 * SunFounder Uno board - 1 * Breadboard - 1 * USB data cable - 1 * Microphone sensor module - Several jumper wires...
  • Page 68 LED is on; when there is voice input, the resistance of the microphone decreases, pin 1 outputs low and the LED is off. And connect pin 1 to IO of the SunFounder Uno board to detect sounds by programming.
  • Page 69 Now, speak near or blow into the microphone, and you can see the LED attached to pin 13 on the SunFounder Uno board brighten.
  • Page 70: Lesson 26 Metal Touch Sensor

    A metal touch sensor is a type of switch that only operates when it's touched by a charged body. It has a high-frequency transistor which can conduct electricity when receiving electromagnetic signals. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Metal touch sensor module - Several jumper wires...
  • Page 71 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, touch the base electrode of the transistor and the LED attached to pin 13 on the SunFounder Uno board will light up.
  • Page 72: Lesson 27 Flame Sensor

    And then it converts analog quantities into digital ones. In this experiment, connect pin D0 to D8 of the SunFounder Uno board. When the flame sensor detects flame signals, the LED attached to pin 13 of the Uno board will brighten.
  • Page 73 Now, ignite a lighter near the flame sensor, and the LED on the module and that attached to pin 13 on Uno will light up.
  • Page 74: Lesson 28 Relay Module

    - Several jumper wires Experimental Principle Connect IO to the SunFounder Uno board. When we make the transistor output low level (0V) by programming, the transistor will conduct electricity because of current saturation. The normally open contact of the relay will be closed, while the normally closed contact of the relay will be opened;...
  • Page 75 Now, you may hear the ticktock. That's the normally closed contact opened and the normally open contact closed. You can attach a high voltage device to the module. For example, connect a bulb of 220V voltage to the output port of the relay module, and then the relay will act as an automatic switch.
  • Page 76: Lesson 29 Joystick Ps2

    Z axis. The module integrates power indicator and can display operation condition. In this experiment, we use the SunFounder Uno board to detect the moving direction of the Joystick knob and pressing of the button.
  • Page 77 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, push the rocker and the coordinates of X and Y axes displayed on Serial Monitor will change accordingly; press the button, and the coordinate of Z=0 will also be displayed.
  • Page 78: Lesson 30 Mq-2 Gas Sensor

    They are often used for detecting smoke and flammable gasses in households, industry or automobiles. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * MQ-2 Gas sensor module...
  • Page 79 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, ignite a lighter or light a candle and release a small amount of smoke or gases into a flask (or other glass containers). Then place the sensor over the container, or invert the container and place the sensor at the mouth.
  • Page 80: Lesson 31 Password Lock

    Step 1: Build the circuit Relay connection: Connect pin S to pin 13 on the SunFounder board, pin - to GND, + to 5V LCD1602 connection: Connect pin RS to D0; R/W to GND; E to D1; D4~D7 to D2, D3, D4, and D12;...
  • Page 81 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, the LCD will show "Welcome" after power on. When you press the * key, it will prompt "Input Your Code:". If you input 123456 and press # key to confirm, "Input Correctly Please Come In"...
  • Page 82: Lesson 32 Lie Detector

    The buzzer, despite of the noise level these things generate, is actually quite low in current consumption and can be driven directly from the SunFounder Uno digital pin. This experiment uses an RGB LED. In this case, however, we are not going to make it flash mixed colors but just turn one of the LEDs on at a time to display red, green, or blue.
  • Page 83 LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno To test the lie detector, you might need a test subject, as you will need one hand free to adjust the knob of the potentiometer.
  • Page 84: Lesson 33 Fire Alarm

    Flame Sensor: Connect pin DO to D8, G to GND, and + to 5V Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website) Step 3: Compile Step 4: Upload the sketch to SunFounder Uno...
  • Page 85 Now, ignite a lighter near the sensor and you can see the LED attached to pin 13 light up and the buzzer beeps.
  • Page 86: Lesson 34 Thermostatic Water Tank System

    Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * Rotary Encoder module...
  • Page 87 30℃, press the rotary encoder to confirm. Touch the thermistor and the value displayed on the LCD varies and finally the LED on the SunFounder Uno board will dim, for the measured temperature is higher than the threshold.
  • Page 88: Lesson 35 Intelligent Environment Monitoring

    LCD1602 and a remote control to build an intelligent environment monitoring system. Components - 1 * SunFounder Uno board - 1 * USB data cable - 1 * DHT11 Humiture Sensor module - 1 * DS18B20 module...
  • Page 89 Step 3: Compile Step 4: Upload the sketch to SunFounder Uno Now, press "Power" Key and you can see "Environment Monitor Begin:" on the LCD. Press digital 1 key and it will show "DS18B20" and a temperature value.
  • Page 90 All contents including but not limited to texts, images, and code in this manual are owned by the SunFounder Company. You should only use it for personal study, investigation, enjoyment, or other non-commercial or nonprofit purposes, under the related regulations and copyrights laws, without infringing the legal rights of the author and relevant right holders.

Table of Contents

Save PDF