ESP32 Easy Coding Board
1. Development Board
2. Kidsblock Software
2.1 Installation
Windows System
Download:
Click to download: http://xiazai.keyesrobot.cn/KidsBlock.exe
Or find the software we provided:
After downloading, click to open “KidsBlock.exe”
Tick “Anyone who uses this computer(all users)” and click “Next”.
Click “Browse…” to choose an installation path of the software, and click “Install”.
click “Finish”.
Here is the main interface of Kidsblock. If there is a warningin your computer, just click “Allow access” to enter the software.
MacOS
Download Kidsblock package: http://xiazai.keyesrobot.cn/KidsBlock.dmg
After downloading, click KidsBlock. And then drag the KidsBlock Desktop into Applications.
After installation, you can see the icon of KidsBlock.
Open KidsBlock, but it cannot be opened, because Mac devices is set that they only allow to open apps from its App store by default. Thus, we need to modify some settings.
Open settings and enter Privacy&Security, tick App Store and identified developers in Security. And then click Open Anyway.
Click Open and the software can be opened.
Now re-open the Kidsblock.
Now enjoy your programming!
2.2 Using Tutorial
We demonstrate on Windows, and MacOS users may take as a referance.
Kidsblock Toolbar
Language
Click to shift languages:
Device Driver
If the driver is already installed on the computer, you do not need to install another one. If not, you need to do the following.
click to choose “Install driver”.
Enter Device Driver Installation Wizard and click “Next”.
“Finish”.
“Next”.
“Finish”.
If a warning appears, just click “Allow” and “Install”.
“Finish”.
“Extract”.
“Next”.
Tick “I accept this agreement” and click “Next”.
“Finish”.
Click “INSTALL”.
After the driver is installed, click “OK”.
Board
Connect a board and a port:
Click to choose a device.
Click Kit and find ESP32 Easy Coding Board to load it. Required sensors and modules are included in it so you do not need to load them one by one.
The following interface will appear, and we need to choose the correct port and click Connect.
Go to Editor
The main interface:
Disconnect:
Click and Disconnect.
Kidsblock Main Interface Functions
Extensions
This kit has been integrated required sensors and modules so does not need to be additionally loaded. If you want to add them that are not available in the kit, please refer to these steps.
Click to choose an extension:
For instance, if you want to load a passive buzzer, click it:
When “Not loaded” becomes “Loaded”, the buzzer module is successfully imported.
Click and you can see a passive buzzer in the blocks:
For how to remove the mosule, click first.
Click the passive buzzer.
When you see “Loaded” changes into “Not loaded”, the module is removed from blocks.
Open Code
Method One:
Click SB3 file to open it. If you want to open , just double click to directly open it. After that, please connect to board and port.
Method Two:
Open Kidsblock and click “file” to choose “Load from your computer”
Find and open the SB3 file, like
Upload Code
Load code to Kidsblock.
Connect the board to your computer. If there is no port, please install driver first. Choose the correct board and port and click
Wait for uploading.
Set Baud Rate
Click one of to set the size of print box.
Small:
Large:
None:
After opening print box, click to set baud rate:
After setting the baud rate and uploading the code, “Hello KidsBlock” will be printed on the box.
3. ESP32 Easy Coding Board Basic Projects
Project 1: Heartbeat
1. Introduction
This project is easy to conduct with an ESP32 Easy Coding Board, a USB type-C cable and a computer. The ESP32 Easy Coding Board RGB dot matrix will display a beating heart. It serves as a start for your entry to the programming world!
2. Components
ESP32 Easy Coding Board *1 |
|
---|---|
USB type C cable *1 |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
4. Test Code
Please check code in Project 1 file.
==>
Find RGB blocks to change its brightness and colors.
Build blocks:
Initialize the RGB dot matrix.
Set color, brightness and display icons.
Complete code:
5. Test Result
After uploading test code to ESP32 Easy Coding Board and powering via USB cable, the RGB dot matrix alternately shows patterns of a small and a large heart.
Project 2: Single RGB Blinking
1. Introduction
In this project, we intend to control a certain RGB of the ESP32 Easy Coding Board to be on and off.
2. Components
ESP32 Easy Coding Board *1 |
|
---|---|
USB type C cable *1 |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
4. 5*5 RGB Dot Matrix
The RGB dot matrix has a total of 25 beads, and we mark them as number 0 to 24 from left to right and from top to bottom.
The serial number is as follows:
5. Test Code
Find code blocks:
Initialize RGB:
Set one RGB to light up in a certain color:
Clear RGB display:
Refresh all RGB:
Build blocks:
6. Test Result
The set RGB will light up once per second.
Project 3: LED Dot Matrix
1. Introduction
Dot matrices are very commonplace in daily life. They have found wide applications in RGB advertisement screens, elevator floor display, bus stop announcement and so on.
The dot matrix of ESP32 Easy Coding Board contains 25 RGB in a grid. Previously, we have succeeded in controlling a certain RGB to light by integrating its position value into the test code. Theoretically, we can turn on many LEDs at the same time to show patterns, digits and characters.
What’s more, we can also click ”show icon“ to choose the pattern we like to display. Last but not the least, we can design patterns by ourselves as well.
2. Components
ESP32 Easy Coding Board *1 |
|
---|---|
USB type C Cable *1 |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
4. Test Code
Find code blocks:
Build blocks:
We set the icon to an arrow and set its brightness and color.
Set the full color brightness and delay time
Complete code:
5. Test Result
After uploading test code, the dot matrix start to show arrows in may directions, and then it exhibits two light shows in full color with each for 5 seconds.
Project 5: Passive Buzzer
1. Introduction
The board boasts an built-in passive buzzer, which is a device without an oscillating circuit so need an external driving signal to produce sound.
Passive: Unlike active buzzers, passive buzzers do not include a built-in oscillator circuit, so an external driving signal with a certain frequency is required. This is usually done by a microcontroller or other signal source.
Frequency control: The frequency of the driving signal determines the frequency at which the buzzer produces sound. By changing the frequency of the input signals, different tones of sound can be played.
Applications: Passive buzzers are widely used in various electronic devices to provide audio prompts or alerts, such as embedded systems, electronic products, alarm systems, etc.
Driving: Due to its passiveness, they have relatively low requirements for external drive signals, so they usually only need to provide enough current and the appropriate frequency.
2. Components
ESP32 Easy Coding Board *1 |
|
---|---|
USB type C cable *1 |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
4. Test Code
Find code blocks:
Build blocks:
Play do, re, mi, fa, sol, la, si, or you may compose them by yourself.
Integrated musics and songs:
Complete code:
5. Test Result
Play do, re, mi, fa, sol, la, si, and a song.
Project 6: Microphone
1. Introduction
Microphone is a device that converts sound into electrical signals, which is an important part of the audio field. It is widely used in voice recording, communication and audio playback.
Microphones can be divided into many types, including Dynamic Microphone, Condenser Microphone, Wireless Microphone, USB Microphone and Laser Microphone.
In this project, we use a minimal capacitive microphone.
2. Components
ESP32 Easy Coding Board *1 |
|
---|---|
USB type C cable *1 |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
4. Test Code 1
Find code blocks:
Build blocks:
5. Test Result 1
After uploading test code and setting baud rate to 115200, speak to the ESP32 Easy Coding Board or clap your hands or desks, and the analog value of sound will increase. The louder the sound is, the greater the value will be.
6. Test Code 2
We represent the sound on RGB dot matrix, and as the sound gets louder, the lighting RGB will be more.
Initialize RGB.
Determine the sound level and rate it.
RGB display:
Complete code:
7. Test Result 2
Upload test code and power on, and the louder the sound is, the more the RGB will light up.
Project 7: Temperature and Humidity Detection
1. Introduction
AHT11 temperature and humidity sensor is equipped on the board, which outputs digital signals. It uses special analog signal acquisition&conversion technology and temperature and humidity sensing technology to ensure that the sensor features good long-term stability and high reliability. The MCU on the ESP32 Easy Coding Board communicates with it via I2C.
2. Components
ESP32 Easy Coding Board*1 |
|
---|---|
USB type C cable *1 |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
4. Test Code
Find code blocks:
Build blocks:
5. Test Result
After uploading test code, open the serial monitor and set baud rate, and the temperature, humidity and Dewpoint value will be printed.
Project 8: MPU6050 Accelerometer and Gyroscope
1. Introduction
The MPU6050 is a six-axis motion processor that includes a 3-axis gyroscope and a 3-axis accelerometer. Two sensors integrated on a single chip that can detect static and dynamic object motion states, including angular speed, Angle and acceleration.
The MPU6050 is integrated with a 16-bit ADC that can simultaneously read data from six axes to measure diagonal speed and Angle, and can also infer acceleration information from the object. The MPU6050 also boasts a built-in temperature sensor used to measure the temperature of the chip, helping to monitor the temperature of the sensor during operation.
In addition, the MPU6050 is equipped with a fast Digital Motion Processor (DMP), which helps process raw data from the gyroscope and accelerometer to obtain the motion state of the object.
Typical circuit diagram:
# |
NAME |
DESCRIPTION |
---|---|---|
1 |
GND |
Negative interface (0V). |
2 |
VCC |
Positive interface (3.3V or 5V). |
3 |
SDA |
I2C data line, connected to MCU, used to transmit data. |
4 |
SCL |
I2C clock line, connected to MCU, used to synchronize data transmission. |
5 |
XDA |
I2C data line, connected to external extension sensors, used to transmit data. |
6 |
XCL |
I2C clock line, connected to external extension sensors, used to synchronize data transmission. |
7 |
AD0 |
I2C Slave address. The sensor address is 0x69 at high and 0x68 at low. |
8 |
INT |
External interrupt pin, detects the internal interrupt time of the MPU6050. |
Operating voltage: 3.3V, 5V
Static current: 5μA
Rotating current: 3mA
Maximum rotation speed: 2000°/s
Acceleration range: ±2g, ±4g, ±8g, ±16g
Temperature range: –10 ~ +65°C
MPU6050 can be used to measure the attitude of an object. Measurements of three angles can be provided: roll, pitch and yaw. It can also provide the acceleration of the object, and obtain the speed and position information of the object through calculation.
Its three axises:
The corresponding Euler Angle indicates the Angle of rotation of the object in three-dimensional space, and its coordinate axis can be adjusted arbitrarily.
Euler Angle consists of three angles, namely Roll, Pitch and Yaw.
Roll |
Rotation Angle with x-axis as rotation axis |
---|---|
Pitch |
Rotation Angle with y-axis as rotation axis |
Yaw |
Rotation Angle with z-axis as rotation axis |
When acquiring Yaw, the gyroscope inside the MPU6050 is automatically calibrated to zero, which causes Yaw to drift to zero.
Zero drift means that the detected data will have an accidental small fluctuation, for example, the sensor value will automatically have an accidental small change. Even after a good algorithm, zero drift still exists, as it is limited by hardware.
Solution: add a magnetometer to calibrate the MPU6050.
For more details, please refer to the MPU6050 data sheet:
https://www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf
https://www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Register-Map1.pdf
2. Components
ESP32 Easy Coding Board*1 |
|
---|---|
USB type C cable *1 |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
4. Test Code
Find code blocks:
Build blocks:
Initilize serial monitor and MPU6050
This block is used to update the data each time it is fetched
Complete code:
5. Test Result
After uploading code and powering on, Put ESP32 Easy Coding Board flatwise on the desk, press the reset button to initialize MPU6050, and wait 2 or 3 seconds.
When the serial monitor shows values, the initialization is completed; and if values on each axis is not greater than 10, the initialization is correct; otherwise you need to re-initialize.
Project 9: Light Brightness
1. Introduction
Photoresistors measure light intensity and are commonly used to detect brightness in the surrounding environment.
Working principle: This module is designed by the light-sensitive materials. There are two main types: photoresistor and photodiode.
Photoresistor: The resistance of a photoresistor varies with the intensity of ambient light. For one photoresistor, the stronger the ambient light is, the lower the resistance will be.
Photodiode: The current output of a photodiode is proportional to the intensity of the incident light. The electrical signals they produce can be used to measure light brightness.
Applications: Photoresistors are widely applied to various fields, including light control systems, lighting systems, camera exposure control, light monitoring, automatic adjustment of screen brightness, etc.
Unit of brightness: They usually measure light intensity in illuminance units (such as Lux). Illuminance represents the luminous flux per unit area.
2. Components
ESP32 Easy Coding Board *1 |
|
---|---|
USB type C cable *1 |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
4. Test Code
Find code blocks:
Build blocks:
5. Test Result
Upload the test code and open the serial monitor. When the light intensity detected by the sensor changes, the sensor values will also change.
Project 10: Read SD Card
1. Introduction
The SD card module is used in conjunction with the MCU on the ESP32 Easy Coding Board for reading and writing data on the SD (Secure Digital) card. This module makes it easier to use SD cards to store and access data in projects.
Function: SD card module allows the ESP32 Easy Coding Board to communicate with the SD card to achieve data reading and writing. This is very useful for data logging, file storage, logging, etc.
Interface: The SD card module usually connects to the ESP32 Easy Coding Board using the Serial Peripheral Interface (SPI) interface. It needs to be connected to the corresponding pin of the ESP32 Easy Coding Board, For example, MOSI (Master Out Slave In), MISO (Master In Slave Out), SCK (Serial Clock), and CS (Chip Select).
SD card type: SD card modules are generally compatible with various types, including standard SD cards, SDHC cards (High Capacity), and SDXC cards (eXtended Capacity).
2. Components
ESP32 Easy Coding Board*1 |
|
---|---|
USB type C cable *1 |
|
SD card *1 (not included in the kit) |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
Insert the SD card into the slot.
4. Test Code
Find code blocks:
Initialize the serial monitor and SD card.
Refresh the SD data before using.
Read SD card type
Serial monitor outputs type:
Read SD card message
Serial monitor outputs messages:
File:
Determine whether there is a ‘’file.txt‘’ file in SD card.
If there is no ‘’file.txt‘’, it create a file and input “hello,world” in a new line.
After that, read the content in ‘’file.txt‘’.
Read all list files in SD card, including hidden files.
Delet this ‘’file.txt‘’.
Complete code:
Serial monitor output:
Project 11: Read ESP32 Easy Coding Board Current
1. Introduction
ESP32 Easy Coding Board boasts a built-in current measurement module (only measure USB power supply and PH2.0 interface power supply) to measure current by a resistive current sensor.
Resistive current sensor is commonly used to monitor the current value by measuring the voltage drop generated by the current through the resistance. The working principle of such sensors is based on Ohm’s law, which states that when a current passes through a resistor, the voltage generated at both ends of the resistor is proportional to the current.
Current sensing: Resistive current sensor contains a current sensing element, usually, a resistor. When current passes through this resistor, a voltage drop will be generated at both ends of the resistor, the magnitude of which is proportional to the strength of the current.
Volateg output: By measuring the voltage drop at both ends of the resistor, the sensor can provide a voltage signal that is related to current. This voltage signal can be digitally processed by devices like an analog-to-digital converters (ADC).
Resistive current sensors are widely applied to power system monitoring, power consumption measurement of electronic devices, electric vehicle current monitoring and so on.
2. Components
ESP32 Easy Coding Board *1 |
|
---|---|
USB type C cable*1 |
3. Connection
Connect the ESP32 Easy Coding Board to your computer via USB cable.
4. Test Code 1
Read current value:
Complete code:
5. Test Result 1
After uploading test code, open the serial monitor and you will see the current value is 0. Because many modules are not working on the board, so the current is close to 0.
6. Test Code 2
Enable RGB dot matrix and then measure the current value.
Initialize the seial monitor and RGB dot matrix.
First measure 10 RGB beads.
Then measure 18 RGB beads.
Last measure 25 RGB beads.
Complete code:
7. Test Result 2
Upload test code and you will find that the more the beads are, the larger the current will be.
8. Test Code 3
The conversion of current to power: power (P) equals current (I) times voltage (V).
P = IV
P is power, unit: Watt(W)
I is current, unit: ampere(A)
V is voltage, unit: volt(V)
This formula is suitable for DC circuits.
For AC circuits, power calculation may require more complex formulas due to power factor.
In a circuit, power describes the conversion of electrical energy. Input current and voltage values into the above formula and you can get real-time power values.
This is commonly used for energy monitoring, power system management and equipment power consumption evaluation.
The power voltage of ESP32 Easy Coding Board is 3.3V, so we only need to measure the current and multiply it by 3.3 to get the power of the Board at this time.
Find code blocks:
Create valriables P and I.
Assign the read current value to variable I.
I multiplies by 3.3 is power of the ESP32 Easy Coding Board(the board voltage is 3.3V).
Complete code:
9. Test Result 3
Upload code and open serial monitor to set baud rate. The more the beads are, the greater the current value and power will be.
Project 12: WiFi Wireless Communication
ESP32 Easy Coding Board is built with Wi-Fi (2.4G) and Bluetooth (4.2) to easily connect to a Wi-Fi network and communicate with other devices in the network, so you can use this Board to display web pages in your browser.
ESP32 Easy Coding Board WiFi Function
Base mode (STA / Wi-Fi Client mode): ESP32 Easy Coding Board is connected to a Wi-Fi hotspot (AP).
AP mode (Soft-AP / Wi-Fi hotspot mode): Other Wi-Fi devices connect to ESP32 Easy Coding Board.
AP-STA mode: ESP32 Easy Coding Board is both a Wi-Fi hotspot and a Wi-Fi device connected to another Wi-Fi.
These modes support multiple security modes: WPA, WPA2, WEP, etc.
Wi-Fi hotspots can be searched (active and passive scanning).
Support hybrid mode monitoring of IEEE802.11 Wi-Fi packets.
For more wifi reference, please visit: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/network/esp_wifi.html
Espressif Official: https://www.espressif.com.cn/en/home
WiFi Web Page
Add an extension of web page editing.
Load it.
You will see code blocks:
Connect to a Wifi and input your wifi name and passwords. After connecting, the IP address will be printed on the serial monitor.
Set up a web component and name as temperature in the unit of ℃.
Add a button module and name as button.
Complete code:
As long as connecting to Wi-Fi, you may use the Web Server Library of ESP32 Easy Coding Board to provide web page.
In the example, we set up a simple web page to display a certain temperature value.
Open your browser to check and visit the IP address of ESP32 Easy Coding Board. Herein, you may access to “http://[IP address of ESP32 Easy Coding Board]” to visit its website.
NOTE: When PC, mobile phone and ESP32 Easy Coding Board are connected to one network, this website(your own IP address of ESP32 Easy Coding Board) can be accessed via PC and mobile at the same time.
PC:
Mobile:
5. FAQ
Q: Battery model?
A: 4 AAA batteries. Please mount batteries in a correct way. Do not insert the them backwards! For children, please be accompanied by parents!
Q: Errors in burning programs to ESP32 board?
A:
Please check whether the USB port is correct.
Please check whether the board model is correct.
Q: Other external modules?
A: This kit is able to connect to external modules. When connecting, please check the ESP32 pin instructions to ensure a right installation so that modules can work properly.
6. Resources
Keyestudio Official:
Keyestudio wiki:
ESP32 development board:
Arduino Official:
ESP32 Espressif Official: