Ks0464 keyestudio Smart Little Turtle Robot V3.0

From Keyestudio Wiki
Revision as of 16:10, 14 August 2019 by Keyestudio (talk | contribs) (Bluetooth Remote Control Robot)
Jump to: navigation, search


keyestudio Smart Little Turtle Robot V3.0


Description

People often match a control board, motor drive shield, DC motors, several sensor modules and a bunch of jumper wires to build own robot car. Have you feel very troublesome to connect a bunch of jumper wires?
Here comes keyestudio smart little turtle robot V3 upgraded version.
This new turtle robot simplify the wiring complication, avoiding wrong connection and saving your time.

The upgraded turtle robot still retains the functions like line tracking, obstacle avoidance, IR and Bluetooth control.
Furthermore, you can see terrific improvements as follows:

  • 1)The connectors on the motor drive shield have anti-reverse protection, simple to connect with only one cable.
  • 2)Themotor drive shield comes with a slide switch for power control, and also adds 8 jumper caps to control the DC motor direction, easy for code debugging.
  • 3)Adding a 8*8 dot matrix module to show the robot’s running status.
  • 4)Using Bluetooth HM-10 module; can support Bluetooth 4.0; Bluetooth APP supporting both Android and iOS system.
  • 5)Can freely connect the battery case 18650 or 4-cell AA battery case to supply power for the robot car. Note that batteries are Not Included. Users can freely choose two 18650 batteries or four AA batteries (1.5V) to supply power for the robot car.
  • 6)Clear silk-screen for motor A and B on the PCB plate or you can check it out on the Acrylic plate and motor drive shield. Protect motors from avoid wrong connection;
  • 7)Coding the robot car with Mixly blocks software, simple to code and ready to play.


From the basics up to complex projects, through this kit you can learn to control the robot car with Mixly blocks coding.
It allows you to quickly learn graphic programming in entertaining, nurturing your interest in science and logical thinking.
Take your brain on a fun and inspiring journey through the world of programming and electronics.



Parameters

  • 1)Motor’s voltage range: 1-6V; motor shaft length: 10mm; speed: 6.0V 100rpm/min.
  • 2)Motor control is driven by L298P.
  • 3)Three groups of line tracking modules, to detect black-white line with higher accuracy and can also be used for anti-fall control.
  • 4)Ultrasonic module is used to detect whether there is obstacles or not.
  • 5)Bluetooth wireless module can be paired with Bluetooth device on mobile phone to remotely control the turtle robot.
  • 6)Infrared receiver module matches with an infrared remote control to control the turtle robot.
  • 7)Add a 8*8 dot matrix module, showing the robot states.
  • 8)Can access to the external voltage 6~12V


0464图片3.png


Component List

Each component is tidily packed inside the packaging box. What components you should get to build the robot? We have listed all the components as follows:

0464图片4.png

0464图片5.png

0464图片6.png

0464图片7.png

0464图片8.png


Getting Started with Mixly and ARDUINO

1)Installing Arduino IDE

When program the UNO development board, you can download the Arduino integrated development environment from the link:


See more contents at:


Ks0436-9.png

The functions of each button on the Toolbar are listed below:
IDE.png

IDE 1.png Verify/Compile Check the code for errors
IDE 2.png Upload Upload the current Sketch to the Arduino
IDE 3.png New Create a new blank Sketch
IDE 4.png Open Show a list of Sketches
IDE 5.png Save Save the current Sketch
IDE 6.png Serial Monitor Display the serial data being sent from the Arduino


Or you can browse the KEYESTUDIO website at this link, https://www.keyestudio.com/ and then click on the WIKI Tutorial.
Ks0446图片6.png



2)Introduction for Mixly Blocks

Mixly is a free open-source graphical Arduino programming software, based on Google’s Blockly graphical programming framework, and developed by Mixly [email protected] BNU.
It is a free open-source graphical programming tool for creative electronic development; a complete support ecosystem for creative e-education; a stage for maker educators to realize their dreams.
More info please check the link to download the Mixly blocks software.

Before starting the robot projects, please click the link to get the basic understanding of Mixly software.
Ks0446图片8.png



3)Import Robot Library

For the robot kit, we have developed keyestudio Small_Turtle_Robot library.
Don’t forget to import the keyestudio Small_Turtle_Robot library to Mixly software before coding the robot projects.
Must import the robot car library first, or else you CANN'T check all the test code.


0464图片9.png

Unzip the Small_Turtle_Robot library exe.package, you can see the Small_Turtle_Robot XML.document.
0464图片10.png

Then import this document into Mixly library. Import custom library successfully!
0464图片11.png

You are able to click “Manager” to manage all imported libraries.
Note: sometimes it may exists a conflict between libraries, so should keep only correct car library when using and delete other library.

0464图片12.png



Getting Started with Hardware Projects


Project 1: Built-in LED

Keyestudio UNO R3

When it comes to using the UNO R3 as core of our robot, the UNO is the best board to get started with electronics and coding.
If this is your first experience tinkering with the platform, the UNO is the most robust board you can start playing with.
Well, let's at first have a look at this UNO R3 board.

Here is an explanation chart of what every element and interface of the board does:
Ks0001-pinout.png

KS0001 5-1.png ICSP (In-Circuit Serial Programming) Header

In most case, ICSP is the AVR,an Arduino micro-program header consisting of MOSI, MISO, SCK, RESET, VCC, and GND. It is often called the SPI (serial peripheral interface) and can be considered an "extension" of the output. In fact, slave the output devices under the SPI bus host.
When connecting to PC, program the firmware to ATMEGA328P-PU.

KS0001 5-2.png Power LED Indicator

Powering the Arduino, LED on means that your circuit board is correctly powered on. If LED is off, connection is wrong.

KS0001 5-3.png Digital I/O

Arduino UNO has 14 digital input/output pins (of which 6 can be used as PWM outputs). These pins can be configured as digital input pin to read the logic value (0 or 1). Or used as digital output pin to drive different modules like LED, relay, etc. The pin labeled “〜” can be used to generate PWM.

KS0001 5-4.png GND ( Ground pin headers)

Used for circuit ground

KS0001 5-5.png AREF

Reference voltage (0-5V) for analog inputs. Used with analogReference().

KS0001 5-6.png SDA

IIC communication pin

KS0001 5-7.png SCL

IIC communication pin

KS0001 5-8.png ICSP (In-Circuit Serial Programming) Header

In most case, ICSP is the AVR,an Arduino micro-program header consisting of MOSI, MISO, SCK, RESET, VCC, and GND. Connected to ATMEGA 16U2-MU. When connecting to PC, program the firmware to ATMEGA 16U2-MU.

KS0001 5-9.png RESET Button

You can reset your Arduino board, for example, start the program from the initial status. You can use the RESET button.

KS0001 5-10.png D13 LED

There is a built-in LED driven by digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.

KS0001 5-11.png USB Connection

Arduino board can be powered via USB connector. All you needed to do is connecting the USB port to PC using a USB cable.

KS0001 5-12.png ATMEGA 16U2-MU

USB to serial chip, can convert the USB signal into serial port signal.

KS0001 5-13.png TX LED

Onboard you can find the label: TX (transmit) When Arduino board communicates via serial port, send the message, TX led flashes.

KS0001 5-14.png RX LED

Onboard you can find the label: RX(receive ) When Arduino board communicates via serial port, receive the message, RX led flashes.

KS0001 5-15.png Crystal Oscillator

Helping Arduino deal with time problems. How does Arduino calculate time? by using a crystal oscillator.
The number printed on the top of the Arduino crystal is 16.000H9H. It tells us that the frequency is 16,000,000 Hertz or 16MHz.

KS0001 5-16.png Voltage Regulator

To control the voltage provided to the Arduino board, as well as to stabilize the DC voltage used by the processor and other components.
Convert an external input DC7-12V voltage into DC 5V, then switch DC 5V to the processor and other components.

KS0001 5-17.png DC Power Jack

Arduino board can be supplied with an external power DC7-12V from the DC power jack.

KS0001 5-18.png IOREF

Used to configure the operating voltage of microcontrollers. Use it less.

KS0001 5-19.png RESET Header

Connect an external button to reset the board. The function is the same as reset button (labeled 9)

KS0001 5-20.png Power Pin 3V3

A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.

KS0001 5-21.png Power Pin 5V

Provides 5V output voltage

KS0001 5-22.png Vin

You can supply an external power input DC7-12V through this pin to Arduino board.

KS0001 5-23.png Analog Pins

Arduino UNO board has 6 analog inputs, labeled A0 through A5.
These pins can read the signal from analog sensors (such as humidity sensor or temperature sensor), and convert it into the digital value that can read by microcontrollers) Can also used as digital pins, A0=D14, A1=D15, A2=D16, A3=D17, A4=D18, A5=D19.

KS0001 5-24.png Microcontroller

Each Arduino board has its own microcontroller. You can regard it as the brain of your board.
The main IC (integrated circuit) on the Arduino is slightly different from the panel pair. Microcontrollers are usually from ATMEL. Before you load a new program on the Arduino IDE, you must know what IC is on your board. This information can be checked at the top of IC.



Let’s make a simple test for the UNO built-in LED (D13).
We will work on blinking an LED. That’s right - it’s as simple as turning a light on and off!
Now enough talking - let’s get started with the LED project.

Blinking an LED
It’s pretty simple to turn a built-in led on and off. We only require UNO R3 control board and a USB cable to enter the wonderful programming world.
Connect your UNO R3 board to the computer’s USB port using a USB cable for communication.

0428图片15.png


Test Code:
Open Mixly blocks platform to get started with coding.
First, click IN/OUT, drag the “DigitalWrite PIN# (0)Stat(HIGH)” block.

0428图片16.png

This block is used to set the level HIGH or LOW of Digital pin.

  • Select HIGH is to set the HIGH level.
  • Select LOW is to set the LOW level.
  • The HIGH level is the state of high voltage, generally recorded as 1.
  • High voltage, high current, the LED lights.
  • The LOW level is the state of low voltage, generally recorded as 0.
  • Low voltage, low current, the LED Not lights.

To observe the LED blink obviously, we need to add a Delay block.
Check the test code below and upload it to your UNO R3 board.
0428图片17.png

What you should see:
Drag the test code to Mixly window; remember to select the proper board and COM port.
Then compile and upload the code to your control board. Upload success message will appear on the bottom bar.
The UNO built-in LED (label “L”) will turn on for 1 second, and then turn off for 1 second, alternately and circularly.

0428图片18.png

0428图片19.png



Project 2: Light up an LED

keyestudio red LED module

In this course, we create 2 test codes. One for turning LED on and off, blinking effect; the other is to change the brightness of LED using the step and delay function in the code, simulating the breath effect.


Overview:
This is keyestudio red LED module. On the module, you will see a light emitting diode (LED), which has two states ON and OFF.
The LED module leads out three pins of 2.54mm pitch, respectively negative pin (marked -), positive pin (marked +) and signal pin (marked S).
The - pin is connected to ground, + pin is connected to VCC(3.3-5V), S pin is for signal control; you can set the High or Low level to control the LED on and off.

After programming, it will emit red light color. You can combine with other sensors to do various interactive experiments.
You can choose other LED modules to emit different light colors like blue, green, yellow and white.


Wiring Diagram:
Stack the motor drive shield on the UNO R3 board and connect the LED module to pin 3 (S, 5V, G).
464图片14.png


Test Code:
Code 1:
464图片15.png

Code 2:

464图片16.png


What you will see
Drag the test code 1 to Mixly window, compile the code and then click on the 'Upload' button.
You will see the message “Upload success” appear on the bottom bar.
Turn the slide switch to ON position.
Eventually, the LED lights up for one second, then off one second, circularly.
464图片17.png

464图片18.png

Upload Code 2 to the UNO R3 board; turn the slide switch to ON position.
The LED will simulate the human breath, gradually brightening and then gradually dimming, alternatively and circularly.
464图片19.png



  • Little Knowledge:

1.441图15.png In the code 1, we’ve set the signal pin of LED module to D3 in the library. Or be able to randomly set the LED signal pin without library. using the block 441图16.pngalso makes sense.

2.What happens when you change the number in one or both of the delay(1000):441图17.png
This delay period is in milliseconds, so if you want the LED display as low or fast, change the value, try 2000 or 500.

3.In the code 2, we use the block 464图片23.png
The LED signal pin is connected to D3; set the PWM value to 0. The PWM value is in the range of 0-255. The greater the value set, the brighter the LED is.

4.464图片24.pngmeans the variable i increases direct from 0 to 255; each step plus 1.
464图片25.png means the variable i direct reduces direct from 255 to 0; each step minus 1.



  • Extension Practice:

1.Set the LED blink without using library; set the signal pin of LED to D11; turn on for 0.5 second, then off for 0.2 second, alternately and circularly.
2.Change the Code 2. Set the LED signal pin connect to D10;
When gradually brightening: PWM value increases from 0 to 255; each step plus 5; delay 30ms.
When gradually dimming: PWM value reduces from 255 to 0; each step minus 5; delay 50ms.



Project 3: Light up LED Matrix

464图片26.png

In the previous project, we have simply tested the LED. We now have added a new 8*8 Dot Matrix module to the turtle robot to show the moving states. Amazing display!
Do you know how is the cool advertising display made? It is exactly composed of these small LED matrix. If you want to make a similar display, this keyestudio 8*8 Dot Matrix module will meet you need.


Overview:
This tiny display has 64 LEDs packed into a 8*8 dot matrix. It integrated HT16K33 as driver chip, so with this LED matrix module, you can control it through connecting I2C communication interfaces ( A4-SDA ; A5-SCL).
It is great for displaying image/text or creating bizarre patterns, and is highly portable and convenient to use. Of course you can program it via IDE or via Mixly block. With just a few steps, you are ready to impress others!


Wiring Diagram:
Stack the motor drive shield on the UNO R3 board and connect the 8*8 dot matrix module to pin A5, A4, 5V, G.
464图片27.png


Test Code:

464图片28.png


What you will see:
464图片29.png
Drag the test code to Mixly window, compile the code and then click on the 'Upload' button. You will see the message “Upload success” appear on the bottom bar.
Turn the slide switch to ON position.
You should see the keyestudio 8*8 Dot matrix show the square icon for 2 seconds, a smile face icon for 2 seconds, stop displaying for 2 seconds, alternately and circularly.
464图片30.png464图片31.png

464图片32.png



  • Little Knowledge:

1.464图片33.png In the code, we are able to set the I2C communication pin and connect to the proper pin.

2.464图片34.png Means clear the patterns shown on the dot matrix screen.

3.You can define the pattern you want to display; no need to set by yourself; just direct call the patterns in the library.
464图片35.png

4.In the code, we can also set any patterns as we like; just tick in the dot matrix, indicating that the point is lit.
464图片36.png
Set the first pattern as464图片37.png; the second pattern should be LedArray2; And so on...



  • Extension Practice:

1.Set a static icon you like and show on the dot matrix;
2.Set a dynamic icon you want to show on the dot matrix.



Project 4: Line Tracking Sensor


Overview:
The tracking sensor is actually an infrared sensor. The component used here is the TCRT5000 infrared tube. Its working principle is to use the different reflectivity of infrared light to the color, then convert the strength of the reflected signal into a current signal.
During the process of detection, black is active at HIGH level, but white is active at LOW. The detection height is 0-3 cm.
For keyestudio 3-channel line tracking module, we have integrated 3 sets of TCRT5000 infrared tube on a single board. It is more convenient for wiring and control.
By rotating the adjustable potentiometer on the sensor, it can adjust the detection sensitivity of the sensor.

Special note: before testing, turn the potentiometer on the sensor to adjust the detection sensitivity.
When adjust the LED front the trimpot at the threshold between ON and OFF, the sensitivity is the best.


TECH SPECS:

  • Operating Voltage: 3.3-5V (DC)
  • Interface: 5PIN
  • Output Signal: Digital signal
  • Detection Height: 0-3 cm


441图66.png


Wiring Diagram:
Stack the motor drive shield on the UNO R3 board and connect the LED module to pin 3 (S, 5V, G).
464图片38.png


Test Code:

464图片39.png


Result:
464图片40.png
Drag the test code to Mixly window, compile the code and then click on the 'Upload' button.
You will see the message “Upload success” appear on the bottom bar. Turn the slide switch to ON position.
When any TCRT5000 infrared pair transistor on the line tracking sensor detects white, LED module will turn on; otherwise, LED turns off.
464图片41.png



  • Little Knowledge:

1.In the code, we use the library 441图71.png to read the HIGH/LOW of the left sensor (D6); using the block 441图72.png also makes sense.
The signal pin of the middle sensor is D7; the signal pin of the right sensor is D8.
464图片43.png

2.0428图片45.pngmeans that if condition 1 is satisfied, it's going to be A, otherwise it's going to be B.
When using, you can find the if...do...statement block in the Mixly Control Block. Then click the gear icon on the block to drag out the else or else if block you need to use.
0428图片46.png

3.464图片42.pngThis is a logical statement. It’s available as long as can satisfy any one of the three conditions.


  • Extension Practice:

1.Try to change the code without using library to make the same result.
2.Set to control the 3 LEDS turn on or off by using line tracking sensor’s control pins.




Project 5: Ultrasonic Detecting Obstacles


Overview:
The ultrasonic module will emit the ultrasonic waves after trigger signal. When the ultrasonic waves encounter the object and are reflected back, the module outputs an echo signal, so it can determine the distance of object from the time difference between trigger signal and echo signal.
We can use the ultrasonic sensor to detect whether there is an obstacle ahead. It is commonly used to measure the distance between the front obstacle and robot.

In the process of robot DIY, we can use the measured distance by ultrasonic sensor to build functional robots, such as automatic avoiding, following, etc.
In the experiment, we use the ultrasonic sensor to measure the distance between the robot and front obstacle, controlling the LED matrix show the images.
441图47.png


TECH SPECS:

  • Operating Voltage: DC 5V
  • Operating Current: 15mA
  • Operating Frequency: 40khz
  • Maximum Range: 2-3m
  • Minimum Range: 2m
  • Sensing Angle: 15 degrees
  • Trigger Input Signal: 10µS TTL pulse


Wiring Diagram:
Stack the motor drive shield on the UNO R3 board; connect ultrasonic sensor to P2 connector and the 8*8 dot matrix module to pin A5, A4, 5V, G.
464图片44.png


Test Code:

464图片45.png


Result:
What you will see Upload the code success, open the monitor and set the baud rate to 9600. Turn the Slide switch ON.
When place an obstacle in front of the ultrasonic sensor, the measured distance between an obstacle and sensor is showed on the monitor. The unit is cm.
464图片46.png
When the measured distance is less than 10cm, LED matrix shows a smile image; otherwise, no image display.
464图片47.png




  • Little Knowledge:

1.In the code, we use the 441图51.png to measure the distance between ultrasonic sensor and obstacle ahead, with a unit of cm.
2.441图53.png: print the distance value on the newline of monitor. The baud rate default by 9600.

3.What happens when you change the number in one or both of the delay(1000)
441图17.png
This delay period is in milliseconds, so if you want the LED to blink as low or fast, change the value, try 500 or 2000.

4.0428图片45.pngmeans that if condition 1 is satisfied, it's going to be A, otherwise it's going to be B.
When using, you can find the if...do...statement block in the Mixly Control Block. Then click the gear icon on the block to drag out the else or else if block you need to use.
0428图片46.png



  • Extension Practice:

1.Change the distance value measured by ultrasonic sensor to make the LED panel show different patterns.
464图片48.png



Project 6: Infrared Receiver


  • IR Remote Control:
remote control

There is no doubt that infrared remote control is commonly seen in our daily life. It's hard to imagine our world without it.
An infrared remote control can be used to control a wide range of home appliances such as television, audio, video recorders and satellite signal receivers.
Well, in the following let’s get a better understanding of the infrared remote control.

Infrared remote control is composed of infrared transmitting and infrared receiving systems. That is, consist of an infrared remote control, an infrared receiver module and a microcontroller that can decode. You can refer to the figure below.

Ks0436-201.png

The 38K infrared carrier signal transmitted by an infrared remote controller is encoded by an encoding chip inside the remote controller. It is composed of a pilot code, user code, data code, and data inversion code.
The time interval between pulses is used to distinguish whether it is a signal 0 or 1. (when the ratio of high level to low level is about 1:1, considered as signal 0.) And the encoding is just well composed of signal 0 and 1.

The user code of the same button on remote controller is unchanged. Using difference data distinguish the key pressed on the remote control.
When press down a button on the remote control, it will send out an infrared carrier signal. And when infrared receiver receives that signal, its program will decode the carrier signal, and through different data codes, thus can judge which key is pressed.
The microcontroller is decoded by an received signal 0 or 1 to determine which key is pressed by the remote control.


  • IR Receiver Module:

As for an infrared receiver module, it is mainly composed of an infrared receiving head. This device integrates with reception, amplification and demodulation. Its internal IC has been demodulated, outputting Digital signal. Suitable for IR remote control and infrared data transmission.
The infrared receiver module has only three pins (Signal, VCC, GND), very convenient to communicate with Arduino and other microcontrollers.

IR Receiver Module


Parameters of IR Receiver:

  • 1)Operating Voltage: 3.3-5V(DC)
  • 2)Interface: 3PIN
  • 3)Output Signal: Digital signal
  • 4)Receiving Angle: 90 degrees
  • 5)Frequency: 38khz
  • 6)Receiving Distance: 18m


Wiring Diagram:
Let’s connect the infrared receiver and 8*8 dot matrix to motor drive shield to make a simple test.
464图片49.png


Test Code:
464图片50.png


What you will see:
Upload the code success, open the monitor and set the baud rate to 9600. Turn the Slide switch ON.
Aimed at the infrared receiver, press your remote control to send the signal, and you will see the encoding of each button on the remote control.
Note if press the control button too long, easily appear unreadable code. Shown as below figure.
464图片51.png

464图片52.png

If receive the 464图片53.png up button value from IR remote control, LED dot matrix shows the front icon0428图片31.png ; if receive the 464图片55.pngOK key value, shows “STOP”.


464图片56.png



Below we have listed out each button value of keyestudio remote control. So you can keep it for reference.
thumb



Little Knowledge:
1.In the code, we direct use the library441图78.png; the signal pin of IR receiver module is A1; the IR receiver receives an infrared signal and outputs 16-bit encoding, printing out on serial monitor (baud rate 9600).
thumb

2.We have tested out the 16-bit encoding of each button on the infrared remote control by source code.
Or you can see the button encoding chart shown above.
In the code, we can change the different key encoding to control dot matrix display different icons.
thumb


Extension Practice:
1.Making the LED panel show different patterns by infrared remote control.
2.Driving the 2 motors’ turning direction and speed by infrared remote control.
(refer to project 9/10 - motor driving)
Combine infrared receiver and motors driving knowledge to build an infrared remote control car.



Project 7: Bluetooth Module

keyestudio HM-10 Bluetooth-4.0 V3

Description:
Bluetooth technology is a wireless standard technology that enables short-distance data exchange between fixed devices, mobile devices, and building personal area networks (using UHF radio waves in the ISM band of 2.4 to 2.485 GHz).
The Keyestudio HM-10 Bluetooth-4.0 V3 Module is a master-slave machine. When use as the Host, it can send commands to the slave actively; when use as the Slave, it can only receive commands from the host.
The HM-10 Bluetooth module supports the Bluetooth 4.0 protocol, which not only supports Android mobile, but also supports iOS system.


Technical Details:

  • 1)Bluetooth protocol: Bluetooth Specification V4.0 BLE
  • 2)No byte limit in serial port Transceiving
  • 3)In open environment, realize 100m ultra-distance communication with iphone4s
  • 4)USB protocol: USB V2.0
  • 5)Working frequency: 2.4GHz ISM band
  • 6)Modulation method: GFSK(Gaussian Frequency Shift Keying)
  • 7)Transmission power: -23dbm, -6dbm, 0dbm, 6dbm, can be modified by AT command.
  • 8)Sensitivity: ≤-84dBm at 0.1% BER
  • 9)Transmission rate: Asynchronous: 6K bytes ; Synchronous: 6k Bytes
  • 10)Security feature: Authentication and encryption
  • 11)Supporting service: Central & Peripheral UUID FFE0, FFE1
  • 12)Power consumption: Auto sleep mode, stand by current 400uA~800uA, 8.5mA during transmission.
  • 13)Power supply: 5V DC
  • 14)Working temperature: –5 to +65 Centigrade


thumb


Pins Description:

thumb


Wiring Diagram:
connect the VCC to 5V,GND to GND, TXD to RXD, RXD to TXD.
thumb


Test Code:
When uploading the code, CANNOT connect the Bluetooth module; otherwise uploading fails!
You are supposed to upload the code to control board, then connect the Bluetooth module.


thumb


Result:
First should install the APP on the cellphone. Download the APP from the link: https://wiki.keyestudio.com/KS0455_keyestudio_HM-10_Bluetooth-4.0_V3_Compatible_with_HC-06_Pins


  • For Android APP:

APP installed well, you can see the icon thumb on your Android phone.
After wiring, upload the test code to UNO R3 board and then connect the Bluetooth module. Powered on, Bluetooth module’s built in LED flashes.
Open the Android APPthumb, click to scan device. As shown below.
thumb

Click Scan Device to search the Bluetooth.
thumb

Click the first device thumb to connect the Bluetooth.
Connected, built-in LED on the Bluetooth module is normally on. APP interface will show the state connected.
thumb

On the bar enter letter a, and click to send, APP will print out the character “keyestudio” and D13 indicator on the UNO R3 board will flash once.
Continue to send the letter a, APP prints out multiple “keyestudio” character and D13 indicator flashes.
thumb


  • For mac/iOS APP

You need to download the mac/iOS compatible APP in APP store.
First we enter the APP store, search hm10, and select the hm10 bluetooth serial lite.
thumb


Click to install the APP, as shown below.
thumb


APP installed well, a Bluetooth iconthumb will pop up on your phone. Click to enter the APP.

Upload the test code to control board successfully, then plug in the Bluetooth module.
Open the Bluetooth APP, click thumb to start searching and pairing the Bluetooth module. Click thumbto start connecting HM-10 Bluetooth module.
Connected, the built-in LED on the Bluetooth module will be from quick flash to normally on.

thumb

On the input bar enter a letter a, and click to send, APP will print out the character “keyestudio” and D13 indicator on the UNO R3 board will flash once.
Continue to send the letter a, APP prints out multiple “keyestudio” characters and D13 indicator flashes.
thumb




Project 8: Adjusting Servo Angle

Servo


Introduction:
Servo motor is a position control rotary actuator. It mainly consists of housing, circuit board, core-less motor, gear and position sensor.
Included with your servo motor you will find a variety of black mounts that connect to the shaft of your servo.
You may choose to attach any mount you wish for the circuit. It will serve as a visual aid, making it easier to see the servo spin.

Working principle:
The receiver or MCU outputs a signal to the servomotor. The motor has a built-in reference circuit that gives out reference signal, cycle of 20ms and width of 1.5ms. The motor compares the acquired DC bias voltage to the voltage of the potentiometer and outputs a voltage difference.

Servo motor comes with many specifications. But all of them have three connection wires, distinguished by brown, red, orange colors (different brand may have different color).
Brown one is for GND, red one for power positive, orange one for signal line.

thumb

The rotation angle of servo motor is controlled by regulating the duty cycle of PWM (Pulse-Width Modulation) signal. The standard cycle of PWM signal is 20ms (50Hz).
Theoretically, the width is distributed between 1ms-2ms, but in fact, it's between 0.5ms-2.5ms. The width corresponds the rotation angle from 0° to 180°.
But note that for different brand motor, the same signal may have different rotation angle.

thumb


Parameters:

  • Operating voltage: DC 4.8V〜6V
  • Angle range: about 180°(in 500→2500μsec)
  • Pulsewidth range: 500→2500μsec
  • No-load speed: 0.12±0.01 sec/60(DC 4.8V); 0.1±0.01 sec/60(DC 6V)
  • No-load current: 200±20mA(DC 4.8V); 220±20mA(DC 6V)
  • Stop torque: 1.3±0.01kg/cm(DC 4.8V); 1.5±0.1kg/cm(DC 6V)
  • Stop current: ≦850mA(DC 4.8V); ≦1000mA(DC 6V)
  • Standby current: 3±1mA(DC 4.8V); 4±1mA(DC 6V)
  • Operation temperature: -10℃〜50℃
  • Save temperature: -20℃〜60℃
  • Motor wire length: 250 ± 5 mm


Connection Diagram:
Connect the servo pin to pin A3

thumb


Sample Code:
We can set the HIGH/LOW for corresponding pins in the Mixly blocks software, so as to adjust the servo angle; furthermore, we specially create the robot library, so easy to control the servo angle with simplified code.


Code 1: without the library

thumb


Code 2: using the library

thumb


Test Result:
Upload the Code 1 success, turn the slide switch to ON position. The servo motor will rotate to 90 degrees.
Upload the Code 2 success, turn the slide switch to ON position. The servo motor will rotate back and forth from 0°to 180°.



Little Knowledge:
1.In the code 1, we direct regulate the servo angle by servo control principle.
464图片63.png this piece of block is to set the procedure; connect the servo signal pin to A3 and set the servo angle to 90°

2.For procedure code, send 50 square signals; Each square signal has a HIGH level time of 1490 (90*11+500) microseconds; LOW level time of 18.51 (20-1490/1000) milliseconds.
thumb

3.In the code 2, we direct use the library to set the servo angle. Set the servo signal pin to A3.


Extension Practice:
1.Refer to the servo regulation principle and code1 method. Try rotating the servo angle to 0°, 45°and 180°
2.Set the servo angle with library. Make the servo angle first turn gradually from 0°to 180°, then rotate from 180°to 0°gradually, alternately and circularly.
(refer to the project 2 Code 2 - LED breath)




Project 9: Motor Driving and Speed Control

Overview:

KS0435-3.png

There are many ways to drive the motor. Our robot uses the most commonly used L298P solution.
L298P is an excellent high-power motor driver IC produced by STMicroelectronics. It can directly drive DC motors, two-phase and four-phase stepping motors. The driving current up to 2A, and output terminal of motor adopts eight high-speed Schottky diodes as protection.

We have designed the motor driver shield V2 based on the L298P circuit.
The stackable design can make it be plugged directly into the Arduino, reducing the technical difficulty of using and driving the motor.

Direct stack the motor driver shield onto UNO R3 board, after the BAT is powered on, turn the Slide button ON, to supply the power for both keyestudio motor driver shield V2 and UNO R3 board.
For simple wiring, the motor driver shield comes with anti-reverse interfaces. When connecting the motor, power supply and sensor modules, you just need to plug in directly.

The Bluetooth interface on the motor driver shield is fully compatible with keyestudio HM-10 Bluetooth module. When connecting, just plug HM-10 Bluetooth module into the corresponding interface.

At the same time, the motor drive shield has brought out extra digital and analog ports in 2.54mm pin headers, so that you can continue to add other sensors for experiments extension.
The motor drive shield can access to 4 DC motors, defaulted by jumper connection. The motor connector A and A1, connector B and B1 are separately in parallel.

The 8 jumpers can be applied to control the turning direction of 4 motors.
For instance, if change the 2 jumpers near the motor A connector from horizontal connection to vertical connection, the turning direction of motor A is opposite to the original rotation direction.

thumb


Specifications:

  • 1)Logic part input voltage: DC5V
  • 2)Driving part input voltage (limit): DC 6-18V
  • 3)Driving part input voltage (recommended): DC 7-12V
  • 4)Logic part working current: <36mA
  • 5)Driving part working current: <2A
  • 6)Maximum power dissipation: 25W (T=75℃)
  • 7)Working temperature: -25℃~+130℃


PINOUT Instructions:

thumb


Wiring Diagram:
Connect two motors to keyestudio motor drive shield V2; stack the motor drive shield onto UNO control board.
441图57.png


Driving Motor
According to the wiring diagram, default the jumper connection method.
Follow the table below to drive the 2 motors rotate by Digital, PWM pins, so as to control the robot car run.
The PWM value is in the range of 0-255. The greater the value set, the faster the motors rotate.

464图片64.png


Test Code:

464图片65.png


Result:
Drag the test code to Mixly window, compile the code and then click on the 'Upload' button. You will see the message “Upload success” appear on the bottom bar. Turn the slide switch to ON position.
The 2 motors act like the smart car to turn forward for 2 seconds, backward for 2 seconds, rotate to left for 2 seconds, rotate to right 2 seconds, and then stop; turn left for 2 seconds, turn right for 2 seconds, stop for 2 seconds, alternately and circularly.
441图61.png



  • Little Knowledge:

1.The code logic is completely based on the motor driving reference table. Check it out.
2.The PWM value is in the range of 0-255. The greater the value set, the faster the motors rotate. Base on that, you can set the speed as you like.


  • Extension Practice:

1.Based on the logic table, try to reset a new moving track for your smart car.




Project 10: Library Driving Motor

Overview:
There are many ways to drive the motor. We have learned how to control the 2 motors in the previous section, so as to drive the smart car run. It is troublesome to control the smart car via control port.
For this, we specially create the library to drive the robot car more simple and easier.
When setting, the PWM value is in the range of 0-255. The greater the value set, the faster the motors rotate.


Wiring Diagram:
441图57.png


Test Code:
464图片66.png


Result:
Done wiring, connect the UNO control board to computer’s USB port with USB cable to upload the code. Upload success, turn the Slide switch ON.
The 2 motors act like the smart car to turn forward for 2 seconds, backward for 2 seconds, rotate to left for 2 seconds, rotate to right 2 seconds, and then stop; turn left for 2 seconds, turn right for 2 seconds, stop for 2 seconds, alternately and circularly.



  • Little Knowledge:

1.The code using library to set the car’s motion state, easy and simple, shortening the code length.
2.The control logic is the same as project 9-motor driving. We can click to check out the corresponding language C of motor mixly code.
464图片67.png


  • Extension Practice:

1.Based on the logic table, try to reset a new moving track for your smart car.



Getting Started with Robot Projects

After learn the basic knowledge of robot hardware, now get ready to give the turtle robot capability to conquer everything!

0464图片1.png

Project 11: Turtle Assembly Guide


Follow the assembly steps to build your own turtle robot.

Step 1: Bottom motor wheel

(1)Firstly, you should prepare the components as follows:

  • M3*6MM round-head screw *2
  • Nut M3 nickle plating *2
  • Bottom PCB*1
  • Tracking sensor *1
  • Universal caster *1

Insert two M3*6MM round-head screw into the tracking sensor, then tighten two M3 Nuts to the screws.
464图片68.png

464图片69.png

Back view:
464图片70.png

Then fix 2 universal caster wheels to the bottom PCB board.
464图片71.png

464图片72.png


(2)Next, mount the motors on the bottom board. You should first get some parts below:

  • U-type holder* 2
  • M2*12MM round-head screws *4
  • M2 Nut *4
  • Motor *2


464图片73.png

Note: the Acrylic plate is marked with A, B for the two motors. Mount the motor A to label A on the Acrylic plate; motor B to Acrylic position B.

464图片74.png

Firstly place four M2 Nuts inside the holes of white N20 motor holders. You should get it as below.
464图片75.png

Then place the white holders onto the motors.
464图片76.png

After that, fix these two motor connectors on the bottom PCB with four M2*12MM round-head screws.
464图片77.png

464图片78.png


(3)Completed the above assembly, let's install the 2 wheels for this small car.


464图片79.png
Plug the two yellow wheels into the motor shaft directly.
464图片80.png



Step 2: Battery case

(1)Completed the above assembly, let's install the battery case.

  • M3*6MM round-head screws *2
  • M3 Nut *2
  • Battery case *1


464图片81.png

We have provided you with two kinds of battery case. The 18650 2-cell battery case or 4-cell AA battery case for the robot.

You can install the 2-cell 18650 battery case to the bottom PCB with two M3*6MM round-head screws and M3 nuts.
Then insert the batteries. The batteries are Not Included in shipping.

464图片82.png

Or install 4-cell AA battery case with 2 M3*6MM round-head screws and 2 M3 nuts:
464图片83.png

Here we install the 4-cell battery case for the robot car.
464图片84.png


Completed the above steps, you should get prepared for wire connection of motors and tracking sensor below.

  • JST-PH2.0MM-2P 24AWG black-red wire 160mm*2
  • JST-PH2.0MM-5P 24AWG blue-green-yellow-red-black wire 15CM *1


464图片85.png

Connect the 5P blue-green-yellow-red-black wire 15CM to the tracking sensor. Separately connect the 2P black-red wire 160mm to the motor A and motor B.
464图片86.png

464图片87.png


Step 3: Top PCB

(1)Above parts are installed well, start to install the top parts for the robot:

  • Top PCB *1
  • M3 Nut *1
  • M3*6MM round-head screws *9
  • M3*10MM dual-pass copper pillar *8
  • IR receiver sensor *1


464图片88.png

According to the silk mark of bottom PCB, install the IR receiver to the PCB using a M3 nut and a M3*6MM round-head screw.
Then screw 8 dual-pass copper pillars to the PCB with 8 M3*6MM round-head screws.
464图片89.png464图片90.png


Followed by assembling the control board on bottom PCB. Prepare well the components below:

  • Motor drive shield V2*1
  • UNO R3 board*1
  • M3*6MM round-head screws *4
  • JST-PH2.0MM-3P connector wire *1

First, tighten the UNO board to the PCB using four 3*6MM round-head screws.
464图片91.png

Then simply stack the motor drive shield V2 onto the UNO R3, and connect the IR receiver to P4 connector using JST-PH2.0MM-3P connector wire.
464图片92.png


Step 4: Servo plastic platform

(1)Time to assemble the motor and plastic platform:

  • black plastic platform *1
  • M1.2*5 tapping screws *4
  • Servo *1
  • cross white mount *1
  • þM2*8 screw *1

mount the servo to the black plastic platform with four M1.2*5 tapping screws(included in plastic platform), a cross white mount and a M2*8 screw (included for servo)
464图片93.png

First should upload the code to UNO R3 to make the servo rotate to 90 degrees.


Test code:
Connect the servo to pin 3 (S, 5V, G)
464图片94.png

Detailed method please refer to the project - adjusting servo angle
464图片95.png

Then fix the cross white mount to the black plastic platform with four M1.2*5 tapping screws.
464图片96.png

464图片97.png

Then adjust the servo towards front in 90 degrees to install it.
464图片98.png

After that, fix the servo to the plastic platform using a M2*8 screw.
464图片99.png

464图片100.png

Finally, mount well another two plastic platform holders using two M2*8 screws.
464图片101.png

464图片102.png


(2) Until now, let’s install the ultrasonic sensor to Servo platform part.

  • ultrasonic sensor *1
  • JST-PH2.0MM-4P wire 8CM *1
  • Nylon cable ties*2

Simply connect the wire to ultrasonic sensor, and then tighten the ultrasonic sensor to the black plastic platform using two cable ties through the holes of sensor.
464图片103.png
464图片104.png464图片105.png


(3)After that, mount the ultrasonic platform part onto the top PCB with four M3*6MM round-head screws.
Then connect ultrasonic sensor and servo motor to the motor drive shield.

  • Top PCB part
  • Ultrasonic platform part
  • M3*6MM round-head screw*4


464图片106.png

464图片107.png



Step 5: Matrix and Complete Robot

(3)Completed the above assembly, let's install the dot matrix display for this small turtle.

  • Dot matrix display *1
  • Jumper wire *4
  • M3*6MM round-head screws *4
  • M3*40MM dual-pass copper pillar* 4

Connect the jumper wires to the four pins of matrix display.
464图片108.png

464图片109.png

Then screw the four M3*40MM copper pillars to the bottom PCB with four M3*6MM round-head screws.
464图片110.png

464图片111.png

After that, assemble the bottom PCB parts, 8*8 dot matrix display and top PCB parts together using four M3*6MM round-head screws. Plug the matrix display into the bottom PCB.
464图片112.png

464图片113.png

Hookup Guide

Plug in the HM-10 Bluetooth module and 8 jumpers.
464图片114.png

Congrats! complete the turtle robot installation.
Begin with the following robot projects, should first upload the test code successfully, then plug in the Bluetooth module; otherwise, the code upload will fail.

464图片115.png


Note that you can use a black winding line to make the wires look better and neat.
The turtle robot is installed well. Learn the robot projects to give your robot car the powerful capability.
0464图片3.png


Project 12: Line Tracking Robot

464图片116.png


Circuit Design:
In the above sections we already introduced the motor drive shield, tracking sensor, matrix module, motors and other hardware.
According to the hardware knowledge -- motor drive shield, motor driving, line tracking sensor, we’re now ready to give the robot capability - Line Tracking!
In the project, we make the robot detect black line at the car bottom with line tracking sensor. Then control the 2 motors rotation by measured result, so as to drive the robot track black line.

Below is a specific logic table of line tracking robot for your reference:
464图片117.png

464图片118.png


Build Line Tracking Robot:
Based on the designed circuit, we are going to build a line tracking robot car.
Check the circuit diagram and test code below.


Hookup Guide:
464图片119.png


Code:
Note: should upload the code success first, then plug in Bluetooth module. Otherwise, code upload fails.

464图片120.png


What you will see:
Upload success and turn the slide switch to ON position.
The robot can automatically track black line.
464图片121.png



Little Knowledge:
1.The specific logic of tracking robot car please refer to the logic table mentioned above.
2.The PWM value is in the range of 0-255. The greater the value set, the faster the motors rotate. We can change the PWM value to randomly drive the robot car’s motion speed.


Extension Practice:
1.Based on the project 3 - light up LED matrix, try to make your robot show the motion state with a dot matrix.



Project 13: Ultrasonic Follow Robot

464图片122.png


Circuit Design:
We combine the hardware knowledge -- LED matrix, motor drive, ultrasonic and servo, to build an ultrasonic follow robot!
In the circuit process, we can make use of ultrasonic sensor to detect the distance between tank robot and front obstacles. Control the motor rotating by measured data, thus control the robot motion and show the running state by dot matrix.

The specific logic of ultrasonic follow robot is as shown below:
464图片123.png


Build Line Tracking Robot:
Based on the circuit design, we can start building our own ultrasonic following robot.
Check the circuit diagram and test code below.


Hookup Guide:
Connect the servo pin to pin header A3 (S, 5V, G); 8*8 dot matrix to pin header A5, A4, 5V, G; Ultrasonic sensor to P2 connector.
464图片124.png


Code:
Note: should upload the code success first, then plug in Bluetooth module. Otherwise, code upload fails.

464图片125.png


What you will see:
464图片126.png

Upload the code success to UNO R3 board; turn the slide switch to ON position.
The servo motor rotates to 90°and 8*8 dot matrix shows a smile face icon.
The turtle robot will walk along the front obstacle.



Little Knowledge:
1.The specific logic of following robot car please refer to the logic table mentioned above.
2.You can change the logic to make the robot follow an object.
For instance, in the source code, we’ve set the robot back when distance is less than 10cm (<10cm). Or you can change the distance value; reset the robot back when distance is less than 15cm (<15cm).
464图片127.png


Extension Practice:
1.Based on the project 3 - light up LED matrix, try to make your robot show the motion state with a dot matrix.
2.You can take the source code as reference. Just change different distance value to drive the robot car go front or go back.


Project 14: Ultrasonic Avoiding Robot

464图片128.png


Circuit Design:
We combine the hardware knowledge -- LED matrix, motor drive, ultrasonic and servo, to build an ultrasonic avoiding robot!
In the circuit process, we can make use of ultrasonic sensor to detect the distance between tank robot and front obstacles. Control the motor rotating by measured data, thus control the robot motion and show the running state by dot matrix.
The ultrasonic avoiding capability is almost the same as the ultrasonic following function. We only need to change the source code.

The specific logic of ultrasonic avoiding robot is as shown below:
464图片129.png


Based on the circuit design, we can start building our own ultrasonic avoiding robot.
Follow the wiring diagram and test code below.


Hookup Guide:
Connect the servo pin to pin header A3 (S, 5V, G); 8*8 dot matrix to pin header A5, A4, 5V, G; Ultrasonic sensor to P2 connector.
464图片130.png


Code:
Note: should upload the code success first, then plug in Bluetooth module. Otherwise, code upload fails.

464图片131.png


What you will see:
464图片132.png

Upload the code success to UNO R3 board; turn the slide switch to ON position.
The servo motor rotates to 90°and 8*8 dot matrix shows a smile face icon.
The turtle robot will drive forward until it senses an object. When it senses an object in its path, it will reverse and then turn to avoid the obstacle.
464图片133.png



Little Knowledge:
1.The specific logic of following robot car please refer to the logic table mentioned above.
2.When setting the robot car, we’ve set the servo angle separately to 0°and 180°to test the distance between the left and the right direction.


Extension Practice:
1.Based on the project 3 - light up LED matrix, try to make your robot show the motion state with a dot matrix.
2.Take the source code as reference, try to reset the servo angle separately to 20°and 160°to test the distance between the left and the right direction.



Project 15: IR Remote Control Robot

remote control


Circuit Design:
We combine the hardware knowledge -- LED matrix, motor drive, and IR receiver, to build an infrared remote control robot!
In the IR receiver section, we’ve listed out each key value of remote control. In this circuit design, we can set the key value in the code to navigate the robot movement.

The specific logic of infrared remote control robot is as shown below:
464图片134.png


Based on the circuit design, we can start building our own remote control robot.
Follow the wiring diagram and test code below.


Hookup Guide:
Connect the 8*8 dot matrix to pin header A5, A4, 5V, G; IR receiver sensor to P4 connector.
464图片135.png


Code:
Note: should upload the code success first, then plug in Bluetooth module. Otherwise, code upload fails.

464图片136.png464图片137.png


Result:
464图片138.png
Upload the code success to UNO R3 board; turn the slide switch to ON position.
We can navigate the tank robot by IR remote control, at the same time, the LED matrix will display the motion states.
464图片139.png



Little Knowledge:
1.The specific logic of remote control robot please refer to the logic table mentioned above;
2.When setting the smart car, we can combine multiple keys to navigate the multi-function motions of robot car.


Extension Practice:
1.Based on the project 9 - motor driving, try to drive the robot car without using the library.
2.Take source code as reference. Make full use of infrared remote control to lead the robot car’s multiple motions. For instance, go straight in S-shape path.




Project 14: Bluetooth Controlled Robot

We are now ready to give the turtle robot capability -- Bluetooth remote control!
For a control smart robot, there should be a control terminal and a controlled terminal.
In the course, we use the mobile phone as the console (host), and the HM-10 Bluetooth module (slave) connected to the robot as the controlled terminal.
When using, we need to install an APP on the phone, and connect the HM-10 Bluetooth module, then we tap the buttons on the Bluetooth APP to navigate the various motion states of robot.

Bluetooth Remote Control

Bluetooth technology is a wireless standard technology that enables short-distance data exchange between fixed devices, mobile devices, and building personal area networks (using UHF radio waves in the ISM band of 2.4 to 2.485 GHz).
The robot kit is equipped with the HM-10 Bluetooth module, which is a master-slave machine. When use as the Host, it can send commands to the slave actively; when use as the Slave, it can only receive commands from the host.
The HM-10 Bluetooth module supports the Bluetooth 4.0 protocol, which not only supports Android mobile, but also supports iOS system.

In the experiment, we default use the HM-10 Bluetooth module as a Slave and the cellphone as a Host.
We install the Bluetooth APP on the mobile phone, connecting the Bluetooth module; finally use the Bluetooth APP to control the robot move, or to control the working status of other sensor modules on the robot car.
We provide you with 2 types of mobile APP, for Android and iOS system.
In the experiment, connect the Bluetooth module by mobile Bluetooth APP, tap the front button on the Bluetooth APP to control the LED matrix displaying front image; release the button, display the “STOP”.


Parameters of HM-10 Bluetooth Module:

thumb

  • Bluetooth protocol: Bluetooth Specification V4.0 BLE
  • No byte limit in serial port Transceiving
  • In open environment, realize 100m ultra-distance communication with iphone4s
  • USB protocol: USB V2.0
  • Working frequency: 2.4GHz ISM band
  • Modulation method: GFSK(Gaussian Frequency Shift Keying)
  • Transmission power: -23dbm, -6dbm, 0dbm, 6dbm, can be modified by AT command.
  • Sensitivity: ≤-84dBm at 0.1% BER
  • Transmission rate: Asynchronous: 6K bytes ; Synchronous: 6k Bytes
  • Security feature: Authentication and encryption
  • Supporting service: Central & Peripheral UUID FFE0, FFE1
  • Power consumption: Auto sleep mode, stand by current 400uA~800uA, 8.5mA during transmission.
  • Power supply: 5V DC
  • Working temperature: -5 to +65 Centigrade


Using Bluetooth APP


  • For Android system:
0428图片138.png

1.Click the Turtle_Car compression package to direct install the Turtle_Car APP; installed well, appear the icon below on your mobile phone:
thumb

Download the Turtle_Car package from the link below:
https://drive.google.com/open?id=16JD3LuLzFQBBXSVdquNSAcypa0HFz1Xs


Or you can download the keyestudio Turtle_Car APP direct from the Google Play:
thumb


2.Tap the Turtle_Car icon to enter the Bluetooth APP. As shown below.
thumb

3.Done uploading the code to UNO R3 board, connect the Bluetooth module, the LED on the Bluetooth module will flash.
Then tap the option CONNECT on the APP, searching the Bluetooth.
thumb

4.Click to connect the Bluetooth. HMSoft connected, Bluetooth LED will turn on normally.
thumb

5.Click the up button 464图片146.pngon the APP, 8*8 dot matrix will display the front icon. Release the button, display the “STOP” icon.


For iOS system:
1.Open the APP store
thumb

2.Click to search keyestudio, and you will see the keyes BT car.
thumb

3.Tap to open the keyes BT car
4.To open Bluetooth, click the “Connect” on the upper left corner, searching and connecting Bluetooth.
thumb

5.Tap the Turtle_Car icon464图片147.png to enter the control interface.
thumb



Hookup Guide:
Connect the 8*8 dot matrix to pin header A5, A4, 5V, G; Bluetooth sensor to pin header TX, RX, G, 5V.
thumb


Test Code:
Note: should upload the code success first, then plug in Bluetooth module. Otherwise, code upload fails.

thumb


Result:
Make sure you have installed the Bluetooth APP on mobile phone. Power on the motor drive shield, Bluetooth indicator flashes and then open mobile APP to connect the Bluetooth module. Bluetooth connected, tap the button 464图片146.png on the Bluetooth APP, dot matrix will display the front icon0428图片31.png ; release the button, display the “STOP” icon.
thumb



Bluetooth Remote Control Robot


Circuit Design:
We have introduced how to use Bluetooth APP to control the LED matrix display.
Based on the above section, we now extend to control the motor drive shield, ultrasonic sensor, dot matrix module using several keys on the Bluetooth APP.
Before build a Bluetooth control robot, let’s get the basic understanding of each button on the APP and figure out what function they have.


Below is Turtle Car Bluetooth APP interface:
thumb

thumb


Based on the circuit design, we can start building our own Bluetooth remote control robot.
Follow the wiring diagram and test code below.


Hookup Guide:

thumb


Code:
Note: should upload the code success first, then plug in Bluetooth module. Otherwise, code upload fails.
thumb


Result:
thumb
Stack the motor drive shield onto UNO board. Connect the UNO control board to computer’s USB port with USB cable to upload the code.
Turn the slide switch ON.
Make sure you have installed the Bluetooth APP on mobile phone.
Power on the motor drive shield, Bluetooth indicator flashes and then open mobile APP to connect the Bluetooth module.
Bluetooth connected, we can use Bluetooth APP to randomly navigate the robot.

Tag the key464图片146.png, go front; tap464图片156.png, go back; press464图片156.png, rotate to left; press464图片157.png, rotate to right; press464图片158.pngand release all the keys, turtle robot stops; press464图片159.png, start mobile direction sensing control, and tap the key again to exit. At the same time, LED matrix will show the robot motion states.
thumb



Little Knowledge:
1.We’ve listed out the control character and function of each key on the Bluetooth APP. So you can change the source code according to the control character. Press different keys to realize different functions.


Extension Practice:
1.Based on the project 9 - motor driving, try to drive the robot car without library.
2.Take source code as reference. Make full use of Bluetooth APP to lead the robot car’s multiple motions. For instance, go straight in S-shape path.



Project 17: Bluetooth Multi-function Robot


Circuit Design:
How to build a multi-function robot combined with all the functions we’ve learned? In this circuit, we use a complete code to program the smart car to switch different functions with Bluetooth APP, pretty simple and easy.


Hookup Guide:

thumb


Test Code:
Note: should upload the code success first, then plug in Bluetooth module. Otherwise, code upload fails.

thumb


Result:
thumb
Upload the code success to UNO R3 board; turn the slide switch to right position.
Connected the Bluetooth module with mobile Bluetooth APP, we can navigate the robot by Bluetooth remote control.
Tag the different keys to switch different functions; tap stop button to exit the function.
thumb



Resources

  • Get all the resources here:

https://1drv.ms/u/s!ArhgRvK6-RyJdbBmQ2kCzCJVKY8?e=RbrWBU

  • Video:

http://video.keyestudio.com/ks0464/



About keyestudio

Located in Shenzhen, the Silicon Valley of China, KEYES DIY ROBOT co.,LTD is a thriving technology company dedicated to open-source hardware research and development, production and marketing.

Keyestudio is a best-selling brand owned by KEYES Corporation, our product lines range from Arduino boards, shields, sensor modules, Raspberry Pi, micro:bit extension boards and smart car to complete starter kits designed for customers of any level to learn Arduino knowledge.

All of our products comply with international quality standards and are greatly appreciated in a variety of different markets throughout the world.
Welcome check more contents from our official website:
http://www.keyestudio.com

Logo图片1.png


For more details of our products, you can check it from the links below.


Customer Service

As a continuous and fast growing technology company, we keep striving our best to offer you excellent products and quality service as to meet your expectation.
We look forward to hearing from you and any of your critical comment or suggestion would be much valuable to us.
You can reach out to us by simply drop a line at: [email protected]
Thank you in advance.



Buy From