KS0487 Keyestudio 37 in 1 Sensor Kit upgrade v3.0

From Keyestudio Wiki
Jump to navigation Jump to search


Keyestudio 37 in 1 Sensor Kit Upgraded v3.0



Description

This is an era of artificial intelligence. Artificial intelligence is everywhere and has been integrated into our lives, especially for all kinds of robots. To understand the robot, we should understand the control system of the robot. The microcontroller we learn is equivalent to the brain of the robot. The various sensors installed on the robot are their eyes, noses, mouths, ears and so on. To make it easier for beginners to understand these principles, Keyestudio has released the 3.0 version of the sensor kit, which includes digital and analog sensors as well as special modules such as ultrasound, digital tubes, temperature and humidity. For each module, there is a clear connection diagram and sample code. So it's easy to operate even you are a newbie.

The sample code of this sensor suite is based on ARDUINO because it is open source and easy to use. If you're good at it, you can also apply this kit to other development platforms such as 51, STM32, Raspberries Pi, micro:bit, the working principle of those platforms is almost same. Now let's enter the world of robotic sensors and learn together!



Component List

Straw Hat Led
0487-1.png
Traffic light module
0487-2.png
SMD RGB
0487-3.png
4-digit tube module
0487-4.png
Active buzzer module
0487-5.png
Passive buzzer module
0487-6.png
Vibration motor module
0487-7.png
button Module
0487-8.png
Touch module
0487-9.png
Knock module
0487-10.png
Tilt module
0487-11.png
IR Switch
0487-12.png
reed switch
0487-13.png
Hall transducer
0487-14.png
Crash Sensor
0487-15.png
Line tracking
0487-16.png
obstacle avoidance
0487-17.png
Photo resistor
0487-18.png
Simulated temperature
0487-19.png
Adjustable potentiometer module
0487-20.png
Sound module
0487-21.png
Flame
0487-22.png
Flame
0487-23.png
Soil
0487-24.png
Steam sensor
0487-25.png
Ceramic vibration sensor
0487-26.png
Voltage detection module
0487-27.png
IR receiver
0487-28.png
IR transmitter
0487-29.png
Joystick module
0487-30.png
5V single-channel relay
0487-31.png
Rotary encoder module
0487-32.png
finger-measuring heartbeat module
0487-33.png
LM35 Temperature
0487-34.png
Temperature and humidity
0487-35.png
ultrasound
0487-36.png
IR Sensor
0487-37.png


Project

Project 1: White LED


thumb
Description
This white LED light module is ideal for Arduino starters. It can be easily connected to IO/Sensor shield. It enables interaction with light-related works.
Note: You can choose other LED modules to emit different color like yellow, red, green and blue.
Specification

  • White LED module
  • Type: Digital
  • PH2.54 socket
  • Size: 30*20mm
  • Weight: 3g

Connection Diagram
First, you need to prepare the following parts before connection:

  • UNO board*1
  • White LED module *1
  • USB Cable*1
  • Jumper wire*3

Connect the S pin of module to Digital 3 of UNO board, connect the negative pin to GND port, positive pin to 5V port.

thumb
Sample Code
Copy and paste the below code to Arduino software.

int led = 3;
void setup()
{
  pinMode(led, OUTPUT);     //Set Pin3 as output
}
void loop()
{         digitalWrite(led, HIGH);   //Turn on led
          delay(2000);
          digitalWrite(led, LOW);    //Turn off led
          delay(2000);
}

Example Result
Done wiring and powered up, upload well the code, you will see the LED module emit the white light.
thumb

Project 2: RGB LED


thumb
Description
This is a full-color LED module, which contains 3 basic colors-red, green and blue. They can be seen as separate LED lights. After programming, you can turn them on and off by sequence or can also use PWM analog output to mix three colors to generate different colors.
Specification

  • Color: red, green and blue
  • Brightness: High
  • Voltage: 5V
  • Input: digital level
  • Size: 30*20mm
  • Weight: 3g

Connection Diagram
First, you need to prepare the following parts before connection:

  • UNO Board*1
  • RGB LED module *1
  • USB Cable*1
  • Jumper Wire*4

Connect the V pin of module to 5V port of UNO board, connect the B pin to Digital 9, R pin to Digital 10, G pin to Digital 11 .

thumb

Sample Code
Copy and paste the below code to Arduino software.

int redpin = 11; //select the pin for the red LED
int bluepin =10; // select the pin for the blue LED
int greenpin =9;// select the pin for the green LED
int val;
void setup() {
  pinMode(redpin, OUTPUT);
  pinMode(bluepin, OUTPUT);
  pinMode(greenpin, OUTPUT);
  }
void loop() 
{for(val=255; val>0; val--)
  {analogWrite(11, val);
   analogWrite(10, 255-val);
   analogWrite(9, 128-val);
   delay(1); 
  }
for(val=0; val<255; val++)
  {analogWrite(11, val);
   analogWrite(10, 255-val);
   analogWrite(9, 128-val);
   delay(1);  }
}

Example Result
Done wiring and powered up,upload well the code, you will see the RGB LED module emit shiny colors.
thumb

Project 3: Traffic Light


thumb
Description
When learning the microcontroller, you may usually use three LEDs, namely red, green and yellow lights to simulate the traffic light blinking via external connection.
This time we specially design this module which is very convenient for wiring, and on the module you can see the red, yellow and green LED. This module is fully compatible with Arduino microcontroller and Raspberry Pi system.

Specification

  • Working Voltage: 3.3-5v
  • Interface Type: digital
  • PH2.54 Socket
  • Connection Diagram:
  • First, you need to prepare the following parts before connection:
  • UNO Board*1
  • Traffic light module *1
  • USB Cable*1
  • Jumper Wire*4

Connect the R pin of module to Digital 5 of UNO board, connect the Y pin to Digital 4, G pin to Digital 3, GND pin to ground port.

thumb


Sample Code:
Copy and paste the below code to Arduino software.

int redled =5; // initialize digital pin 5.
int yellowled =4; // initialize digital pin 4.
int greenled =3; // initialize digital pin 3.
void setup()
{
pinMode(redled, OUTPUT);// set the pin with red LED as “output”
pinMode(yellowled, OUTPUT); // set the pin with yellow LED as “output”
pinMode(greenled, OUTPUT); // set the pin with green LED as “output”
}
void loop()
{
digitalWrite(greenled, HIGH);//// turn on green LED
delay(5000);// wait 5 seconds
digitalWrite(greenled, LOW); // turn off green LED
for(int i=0;i<3;i++)// blinks for 3 times
{
delay(500);// wait 0.5 seconds
digitalWrite(yellowled, HIGH);// turn on yellow LED
delay(500);// wait 0.5 seconds
digitalWrite(yellowled, LOW);// turn off yellow LED
} 
delay(500);// wait 0.5 seconds
digitalWrite(redled, HIGH);// turn on red LED
delay(5000);// wait 5 seconds
digitalWrite(redled, LOW);// turn off red LED
}

Example Result:
Done uploading the code, powered up, three LEDs on the module will automatically simulate the traffic light on and off, circularly.


thumb

Project 4: Buzzer Beeping


thumb
Introduction:
Here is the simplest sound making module. You can use high/low level to drive it. Changing the frequency it buzzes can produce different sounds. This module is widely used on our daily appliances like PC, refrigerator, phones, etc. In addition, you can create many interesting interactive projects with this small but useful module.Just try it!! You will find the electronic sound it creates so fascinating.

Specification:

  • Working voltage: 3.3-5v
  • Interface type: digital
  • Size: 30*20mm
  • Weight: 4g

Connection Diagram:
First, you need to prepare the following parts before connection:

  • UNO Board*1
  • Active buzzer module *1
  • USB Cable*1
  • Jumper Wire*3

Connect the S pin of module to Digital 3 of UNO board, connect the negative pin to GND port, positive pin to 5V port.
thumb
Sample Code:
Copy and paste the below code to Arduino software.

int buzzPin =3;    //Connect Buzzer on Digital Pin3
 void setup()  
 {        
  pinMode(buzzPin, OUTPUT);     
}
 void loop()                     
{
  digitalWrite(buzzPin, HIGH);
  delay(1);
  digitalWrite(buzzPin, LOW); 
  delay(1);        
}

Example Result:
Done uploading the code to board, the buzzer will make a sound.

thumb

Project 5: Passive Buzzer


thumb
Introduction:
We can use Arduino to make many interactive works of which the most commonly used is acoustic-optic display. The circuit in this experiment can produce sound. Normally, the experiment can be done with a buzzer or a speaker, while buzzer is simpler and easier to use. The buzzer we introduced here is a passive buzzer. It cannot be actuated by itself, but by external pulse frequencies. Different frequencies produce different sounds. You can use Arduino to code the melody of a song, quite fun and simple.

Specification:

  • Working voltage: 3.3-5v
  • Interface type: digital
  • Size: 30*20mm
  • Weight: 4g

Connection Diagram:
First, you need to prepare the following parts before connection: UNO Board*1,Passive buzzer module *1,USB Cable*1,Jumper Wire*3 Connect the S pin of module to Digital 3 of UNO board, connect the negative pin to GND port, positive pin to 5V port.
thumb

Sample Code:
Copy and paste the below code to Arduino software.

int buzzer=3;//set digital IO pin of the buzzer
void setup() 
{ 
pinMode(buzzer,OUTPUT);// set digital IO pin pattern, OUTPUT to be output 
} 
void loop() 
{ unsigned char i,j;//define variable
while(1) 
{ for(i=0;i<80;i++)// output a frequency sound
{ digitalWrite(buzzer,HIGH);// sound
delay(1);//delay1ms 
digitalWrite(buzzer,LOW);//not sound
delay(1);//ms delay 
} 
for(i=0;i<100;i++)// output a frequency sound
{ 
digitalWrite(buzzer,HIGH);// sound
digitalWrite(buzzer,LOW);//not sound
delay(2);//2ms delay 
}
} 
} 

Example Result:
Done uploading the code to board, the buzzer will make a sound.

thumb

Project 6: Motor Module

Introduction: The keyestudio vibration motor module facilitates the conversion of electrical signals to mechanical vibration. It mainly uses a high quality, high standard vibration motor. We can directly control the motor vibration using the digital pin of Arduino microcontroller - HIGH level for triggering; LOW for breaking. Or control the vibration intensity of the motor by Arduino PWM pins. This module is suitable for the vibration-sensitive interactive creations, wearable smart device and so on. The module comes with a 3mm fixing hole, easy to fix it to other devices.

Features:

  • Operating voltage: DC 5V
  • Operating current: 35mA
  • Max power: 0.5W
  • Operating temperature range: -25℃ to 65℃
  • Interface: 3pin of 2.54mm pitch
  • Fixed hole diameter: 3mm
  • Dimensions: 34mm*19mm*6mm
  • Weight: 3.2g

Connection Diagram:
thumb

Test Code:

#define ZD 3
void setup() {
  // put your setup code here, to run once:
pinMode(ZD,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
analogWrite(ZD,200);
delay(5000);
analogWrite(ZD,0);
delay(1000);
analogWrite(ZD,100);
delay(5000);
analogWrite(ZD,0);
delay(1000);
}

Result Done uploading the code, the vibration motor on the keyestudio module will first strongly vibrate for 5 seconds, stop for 1 second, and weakly vibrate for 5 seconds, then stop for 1 second, alternately and circularly.

thumb

Project 7: Digital Push Button


thumb
Introduction:
This is a basic button module. You can simply plug it into an IO shield to have your first try of Arduino. Features:
Wide voltage range from 3.3V to 5V Easily recognizable interfaces of sensors ("A" for Analog and "D" for Digital) Standard assembled hole Clear icons illustration High quality connector Easy to plug and operate Large button and high-quality cap To achieve interesting and interactive works Specification:

  • Supply Voltage: 3.3V to 5V
  • Interface: Digital
  • Size: 30*20mm
  • Weight: 4g

Connection Diagram:

  • First, you need to prepare the following parts before connection:
  • UNO Board*1
  • Push button module *1
  • USB Cable*1
  • Jumper Wire*3

Connect the S pin of module to Digital 3 of UNO board, connect the negative pin to GND port, positive pin to 5V port.

thumb

Sample Code:
Copy and paste the below code to Arduino software.

/* # When you push the digital button, the Led 13 on the board will be turned on. Otherwise,the led is turned off.
*/
int ledPin = 13;                // choose the pin for the LED
int inputPin = 3;               // Connect sensor to input pin 3 
void setup() {
  pinMode(ledPin, OUTPUT);      // set LED as output
  pinMode(inputPin, INPUT);     // set pushbutton as input
}
void loop(){
  int val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {            // check if the input is HIGH
    digitalWrite(ledPin, LOW);  // turn LED OFF
  } else {
    digitalWrite(ledPin, HIGH); // turn LED ON
  }
}

Example Result:
Wire it up well as the figure shown below, and then upload the code to the board.
thumb
When you push the digital button, the Led 13 on UNO board will be on. When release the button,the led is off. Shown as below.


thumb

Project 8: Collision Flash


thumb

Description: Crash sensor, also known as electronic switch, is a digital on-off input module necessary for elementary electronic learning. By programming, it can realize to control over light, sound device, key choice function of LCD display, etc. Using 3P sensor cable to connect it to sensor shield, it can be installed to 4WD AL alloy mobile robot platform to realize collision detection function. It is both convenient and efficient. Note:You can make a collision flasher using collision module and built-in LED on interface 13. Connect the collision sensor to pin 3. When the collision sensor senses a collision signal, the LEDs on both mainboard and module will light up simultaneously.

Parameters: If collision happens upfront of where collision module is installed, module outputs low level signal; no collision, outputs high level signal. Module reserves M3 mounting hole, convenient for fixation on a car. Module size: 3.1cm * 2.1cm With switch indicator light, if there is collision, light is on; no collision, light is off. Pin definition: 1.Positive pin (+): connect to 3v-12v power supply 2.Negative pin (-): connect to GND 3.Signal pin (S): connect to High-low level output

Connection Diagram: First, you need to prepare the following parts before connection: UNO Board*1 Crash module *1 USB Cable*1 Jumper Wire*3 Connect the S pin of module to Digital 3 of UNO board, connect the negative pin to GND port, positive pin to 5V port.
thumb

Sample Code

Copy and paste the below code to Arduino software.

int Led=13;// set pin for LED 
int Shock=3// set pin for collision sensor
;int val;// set digital variable val
void setup()
{ 
pinMode(Led,OUTPUT);// set pin LED as output
pinMode(Shock,INPUT);// set collision sensor as input
}
void loop()
{
val=digitalRead(Shock);// read value on pin 3 and assign it to val
if(val==HIGH)// when collision sensor detects a signal, LED turns on.
{
digitalWrite(Led,LOW);
} else
{
digitalWrite(Led,HIGH);
}
}

Example Result:
Wire it up well and then upload the code to the board.

thumb
When the object crashes the switch of sensor, both the led on the sensor and led 13 on the board are turned on.

thumb

Project 9: Line Tracking


thumb
Introduction: This Line Tracking Sensor can detect white line in black or black line in white. The single line-tracking signal provides a stable output signal TTL for a more accurate and more stable line. Multi-channel option can be easily achieved by installing required line-tracking robot sensors. Specification:

  • Power supply: +5V
  • Operating current: <10mA
  • Operating temperature range: 0°C ~ + 50°C
  • Output Level: TTL level
  • Size: 41.7*10.7mm
  • Weight: 3g

Connection Diagram: First, you need to prepare the following parts before connection: UNO Board*1 Line tracking module *1 USB Cable*1 Jumper Wire*3 Connect the S pin of module to Digital 3 of UNO board, connect the GND pin to GND port, V+ pin to 5V port.
thumb
Sample Code: Copy and paste the below code to Arduino software. //Arduino Sample Code void setup() {

 Serial.begin(9600);

} void loop() {

 Serial.println(digitalRead(3)); // print the data from the sensor
 delay(500);

} Example Result: Done uploading the code to board, open the serial monitor and set the baud rate as 9600, then you can see the data from the sensor. Shown below.


thumb

Project 10: Infrared Obstacle Avoidance


thumb
Introduction: Infrared obstacle detector sensor is equipped with distance adjustment function and is especially designed for wheeled robots. This sensor has strong adaptability to ambient light and is of high precision. It has a pair of infrared transmitting and receiving tube. When infrared ray launched by the transmitter tube encounters an obstacle (its reflector), the infrared ray will be reflected to the receiver tube, thus the indicator will light up, and signal output interface outputs digital signal. In addition, you can rotate the potentiometer knob to adjust detection distance ( effective distance: 2~40cm, working Voltage: 3.3V-5V ). Thanks to a wide voltage range, this sensor can work steadily even under fluctuating power supply voltage and is suitable for the use of various micro-controllers, Arduino controllers and BS2 controllers. A robot mounted with this sensor can sense obstaclein the environment. Specification:

  • Working voltage: DC 3.3V-5V
  • Working current: ≥20mA
  • Working temperature: -10℃—+50℃
  • Detection distance: 2-40cm
  • IO Interface: 4 wire interface (-/+/S/EN)
  • Output signal: TTL voltage
  • Accommodation mode: Multi-circle resistance regulation
  • Effective Angle: 35°
  • Size: 41.7*16.7mm
  • Weight: 5g

Connection Diagram: First, you need to prepare the following parts before connection:

  • UNO Board*1
  • Obstacle detector module *1
  • USB Cable*1
  • Jumper Wire*3

Connect the Out pin of module to Digital 2 of UNO board, connect the V+ pin to 5V port, GND pin to GND port.
thumb
Sample Code: Copy and paste the below code to Arduino software. const int sensorPin = 3; // the number of the sensor pin const int ledPin = 13; // the number of the LED pin int sensorState = 0; // variable for reading the sensor status void setup() {

 pinMode(ledPin, OUTPUT);      
 pinMode(sensorPin, INPUT); }

void loop(){

 // read the state of the sensor value:
 sensorState = digitalRead(sensorPin);
 // if it is, the sensorState is HIGH:
 if (sensorState == HIGH) {     
    digitalWrite(ledPin, HIGH);  
 } 
 else {
      digitalWrite(ledPin, LOW); 
 }

} Example Result: Done uploading the code to board, you can see the led on both UNO board and obstacle detector sensor is turned on.
thumb
If we put a foam block in front of the sensor, this time when sensor detects the obstacle, sled on the sensor will be turned on.
thumb

Project 11: Photo Interrupter

Test code


thumb



Test Result

According to wiring diagram, upload test code successfully. After power-on, insert the sensor into soil. The LED dot matrix of micro:bit control board displays the analog value of corresponding soil moisture.


Resources

Download Test Code:
https://1drv.ms/u/s!ArhgRvK6-RyJg2ks7fRZun4VQLEg?e=rGnT7g


Get One Now

  • [ Official Website]
  • [ Shop on aliexpress ]