#Design Inspiration#
One day, Wang Zai’s grandmother took the child outside to play and encountered a little friend riding a small cart. Wang Zai really wanted to ride his friend’s cart, so the other grandmother let Wang Zai ride it. However, once Wang Zai got on, he refused to get off. We also have a similar cart at home, which is hand-pushed. Wang Zai’s dad came up with the idea to modify the cart so that the child would enjoy playing with it and the grandmother wouldn’t have to push it, leading to today’s creation.
First, let’s take a look at the demonstration video:
#Solution Determined#
The main goal of this creation is to transform the cart into an electric one that can be remotely controlled, even allowing you to control it with your smartphone, using a motor to drive the cart forward and backward, and a servo to control the left and right steering.
To add electric functionality to the cart, it is essential to include an actuator motor. The choice of motor is crucial, and if it is to carry a person, you cannot use an ordinary motor. Therefore, I found a 735 motor for children’s pedal cars on a certain treasure site.
Once the motor is determined, the next issue is how to choose a motor driver. The 735 motor is a brushed DC motor, and the simplest and most direct method is to use a brushed DC electronic speed controller to drive the motor. The data is sent to the receiver via the car model or aircraft model remote control to control the cart’s movement. Additionally, you can add a servo to control the steering. This solution is clearly viable, as there are many mature cases to reference, especially in the combat robot community, where this approach is quite common. Previously, Wang Zai’s dad participated in a 2kg class combat robot competition, so the electrical components can be directly used.
Besides this, are there other solutions? Certainly! If the first solution is considered a non-programmable version, we can also create a programmable version. There are two ideas for implementation: using an Arduino Uno controller combined with a 2.4g remote control to control the cart’s movement or using an ESP32 type networked main control to connect to the main control via phone Wi-Fi or Bluetooth, thus achieving wireless communication to control the cart. This sounds like a high-tech approach, and without hesitation, Wang Zai’s dad decided to use the ESP32 as the main control for the programmable version. Next, this article will introduce the “Child Walking Device” through two modification solutions.
#Disassembly#
Regardless of which solution is chosen, the first step is to disassemble the cart.
The programmable and non-programmable versions share the same driving motor and steering servo, so let’s start with the motor modification installation.
How to install and secure the motor to drive the wheels is a critical part.
From the image below, you can see Wang Zai’s dad’s solution.
By using a 3D-printed shaft sleeve, the flange is fixed to the wheel, and a 16-tooth synchronous wheel is installed on the 735 motor shaft, driving an 80-tooth synchronous wheel on the optical axis through a synchronous belt for deceleration.
The shaft sleeve designed with 3D modeling software is shown in the image below.
After the design is complete, it is sliced and printed.
Below is the effect after printing is complete.
Next, install the shaft sleeve on the wheel, drill a 3mm round hole with a drill, and secure it with screws.
Next, install the flange and diamond-shaped bearing.
Using 3mm self-tapping screws, fix the flange to the 3D-printed coupling. The bearing is fixed to the chassis using 4mm screws and nuts.
The next step is to install the motor and drive components. The image below shows the 2GT5mm synchronous belt and the 16-tooth and 80-tooth synchronous wheels.
The 735 motor is fixed to the chassis using the bracket shown in the image below.
The final appearance of the actuator motor and driving wheels after modification is shown in the image below.
After the driving motor is modified, I will now introduce the steering servo. This project uses a 270-degree metal digital servo from DFRobot, with a working voltage of 4.8-7.2V and a load capacity of 15Kg, which is sufficient for the cart’s steering servo.
With the servo, we also need 1 servo arm and 1 ball head pull rod to control the cart’s steering.
The installation effect of the steering servo is shown below.
The installation of the steering arm and ball head pull rod is shown below.
After modifying the common motor parts and servo parts for both versions, let’s understand how each version implements other functions.
#Non-Programmable Version#
Below is the hardware list used in the non-programmable version:
735 DC Motor * 1
15kg 270-degree Metal Servo * 1
Brushed Motor ESC * 1
Fus FS-i6 2.4G 10-channel Remote Control * 1
Fus Receiver * 1
3s 1800mah Lithium Battery * 1
Servo Adapter Board * 1
Boat Switch * 1
Various hardware, wires, and power connectors
Fus FS-i6 2.4G 10-channel Remote Control
The circuit wiring is shown in the image below. The power supply uses a 1800mah 3s lithium battery. The brushed motor ESC is connected to channel 2 of the receiver, and the servo is connected to channel 4 of the receiver. A dedicated expansion board is used to power the servo.
The effect after wiring is shown in the image below (the servo image was missed).
For convenience, a hole was drilled in the car shell to install the switch.
Finally, let’s test how the non-programmable version performs.
#Programmable Version#
Now, let’s understand how the programmable version implements its functions.
First, let’s recognize the electronic hardware used.
The main control we chose is the ESP32, utilizing its Wi-Fi or Bluetooth wireless communication capabilities, allowing you to control the cart anytime and anywhere with your phone, which significantly enhances the quality of our creation.
For detailed information about the ESP32, please click the link below.
https://wiki.dfrobot.com.cn/_SKU_DFR0478_FireBeetle_Board_ESP32%E4%B8%BB%E6%9D%BF%E6%8E%A7%E5%88%B6%E5%99%A8V4_0
Next, the driving motor driver is crucial. It must bear the weight of a child, so the working current of the motor driver must be sufficient. Therefore, we chose a DC motor driver with a working voltage of 12-36V and a working current of 12A (without heat dissipation) – 20A (with heat dissipation).
The DC motor driver has three control pins: two pins control direction, and one pin controls speed, with a 5V power output. The following two images explain the pin functions and specific usage.
For detailed information about the DC motor driver, please click the link below.
https://wiki.dfrobot.com.cn/_SKU__DRI0042__12_24_36V_15A%E5%A4%A7%E5%8A%9F%E7%8E%87%E7%9B%B4%E6%B5%81%E7%94%B5%E6%9C%BA%E9%A9%B1%E5%8A%A8%E6%A8%A1%E5%9D%97
Finally, Wang Zai’s dad added music and lighting functions to the cart. To implement the music function, a DFPlayer Mini MP3 module was used (you need to prepare a micro SD card). This module is compact yet powerful, controlled directly via serial, and can drive an 8-ohm 0.5w speaker.
The following image shows the specific usage of the MP3 module pins.
For detailed information about the MP3 module, please refer to the link below.
https://wiki.dfrobot.com.cn/_SKU_DFR0299_DFPlayer_Mini%E6%A8%A1%E5%9D%97
The lighting function uses a WS2812 LED strip.
The complete list of electronic components is shown in the image below. A high-power adapter board is used to power the servo, and the main control ESP32 uses an expansion board for easy wiring, while the actuator motor remains the 735 motor.
The wiring diagram for the programmable version is shown below.
To facilitate the installation of electronic components, a plane-shaped base was designed, which also serves as a footrest for the child. The design drawings are shown below.
The following images show the physical product processed using a laser cutter on a 3mm linden wood board.
After completing the wiring, the effect is shown in the image below.
By punching and wiring, the WS2812 LED strip is installed to add lighting functions to the cart.
Like the non-programmable version, the power supply also uses a 1800mah 3s lithium battery, and a dedicated battery case is designed to connect with the plane base.
The final effect after assembly is displayed below.
#Program Design#
Program design mainly involves two parts: one part is the Blynk mobile terminal remote control component setup, and the other part is the program writing for the ESP32 main control. First, let’s set up the Blynk mobile terminal.
Blynk Setup
The first step is to log in. If you are using it for the first time, you need to register first. As shown in the image below, “Login” is for logging in, and “Create New Account” is for registration.
Enter your username and password to log in.
After a successful login, click the plus sign above “New Project” to create a new project.
Next, select the main control as ESP32 Dev Board.
Click “CONNECTION TYPE” to select the connection method.
For this task, we can choose between Wi-Fi and Bluetooth. In terms of control response speed, the Bluetooth mode is slightly faster, with virtually no delay. Wang Zai’s dad will explain using the Bluetooth method, so we select “BLE” mode here.
After completing the selection, click the “Create Project” button. It will ask if you want to send an email containing the authorization code. Click OK to create the project and receive the email. Of course, you can also find the authorization code in the project. This authorization code is key for the Blynk mobile terminal to connect to the ESP32 control board via Bluetooth, which will be used during programming.
Click the hexagon in the upper right corner to enter the project settings interface. At the bottom, you can also see the authorization code information, as shown in the image below.
Swipe left in the app to add components. The component list is shown in the image below. For this project, we need to use 1 button, 2 styled buttons, 2 joysticks, and 1 Bluetooth component.
The loaded components are shown in the image below.
We turn it sideways for easier explanation, which is also the posture during control. Since Blynk does not yet have a horizontal screen function, some text looks a bit awkward, but this does not affect our usage.
Why use two joysticks? It’s for convenience. We use the left joystick to control forward and backward movement, and the right joystick to control steering. The left joystick is set to virtual pins v0 and v1, while the right joystick is set to virtual pins v2 and v3. The setup process is shown in the image below.
V2 pin controls the servo’s rotation angle, which in turn controls the cart’s steering.
V0 pin controls the forward and backward direction.
After testing, the virtual pin V2 for controlling steering should be set to a range of 60-120 to allow flexible left and right turns. The virtual pin V0 is used to control speed, and when set to a range of 0-160, it can provide enough power to carry a child.
Next, we need to set up two types of buttons: “Button” and “Styled Button”. Why two types of buttons? The principle is the same; both can achieve the desired function, but for aesthetics, Wang Zai’s dad chose different buttons.
The three buttons correspond to virtual pins V4, V5, and V6. The left one is V5, the right one is V4, and the button in the middle of the two joysticks is V6. Careful partners should notice that some button settings have different modes. That’s right; button settings can be either “PUSH” or “SWITCH” mode.
V4 virtual pin is used to honk the horn, set to “PUSH” mode, playing the horn sound and flashing the LED strip effect when pressed, and resetting when not pressed.
V5 virtual pin is used to control whether to play music, set to “SWITCH” mode, locking to start playing when pressed, and stopping playback when pressed again.
V6 virtual pin is used to control lighting, set to “SWITCH” mode, locking to turn on the light mode when pressed, and stopping the light when pressed again.
Finally, there is one more Bluetooth module that needs to be set up. Click on the Bluetooth module to see the interface shown in the image below, then click “Connect BLE Device”.
Select the discovered Bluetooth name, which is set in the program. Find the name you set and click “OK” to wait for the connection to succeed.
Finally, click the triangle in the upper right corner to run this program.
After setting up the components of the Blynk mobile terminal, let’s write the program for the ESP32 main control.
This project’s program can be implemented using various programming environments such as Mind+, Mixly, or Arduino.
Since the Mind+ programming environment does not support Blynk for the ESP32 board, and Arduino IDE is relatively obscure for most people, Wang Zai’s dad chose to use the Mixly programming environment for this project.
Mixly Program Design
The first step is to understand the programming method for Blynk. Open the Mixly programming software, select Arduino ESP32 on the lower right corner, and drag the “Blynk IoT” module from the “Network” section on the left module bar to the right programming area. Then modify the “Blynk Authorization Code” and “BLE Name”. The authorization code is like a key that needs to match with the Blynk mobile terminal.
Once Blynk is set up, let’s try to accomplish some small tasks.
For example, we can choose “Get Data from App…” from the left “Network” module. This is the most used module in this project, and mastering this simple application will help you understand the rest.
We can try to write the following program. When the V4 virtual pin receives data, it will execute three actions: first, print the received data in the serial monitor for debugging; second, play the fourth song on the MP3 module; and finally, execute a custom function called “Blinking Eyes 2”. If you don’t get too caught up in the MP3 module and custom functions, this program is quite easy to understand.
MP3 and LED Strip Program
How does the MP3 module play songs? What preparations are needed? Obviously, some are required.
We need to select the initialization program block for the MP3 module from the “Actuator” section on the left. Here, Wang Zai’s dad wants to thank Teacher Qiu Jiongtao, because the latest version of Mixly did not support the Mini MP3 module for the ESP32, and it was Teacher Qiu who specially created the graphical library that enabled Wang Zai’s dad to use the MP3 module. Teacher Qiu also provided significant help in debugging the Blynk mobile terminal program, and I sincerely appreciate Teacher Qiu’s support and commendable contributions to the Blynk ecosystem. Teacher Qiu is also a dad, so this little cart can be enjoyed by his baby too!
The specific initialization program is shown in the image below. The MP3 module communicates with the ESP32 using a soft serial communication method. Note that when wiring, the MP3 module and ESP32 need to be crossed, meaning RX-TX and TX-RX.
Careful partners will have questions about how to determine which song is played. This is a very good question. The MP3 module, called DFPlayer Mini MP3 module, can insert a micro SD card. The songs we want to play should be placed in this SD card, and the MP3 module can read most audio file formats. However, when setting song files, they must be named with numbers like “0001” and placed in a folder named “mp3” on the SD card. After setting up these preparations, you can happily use it. The fourth song in the program is the sound of the horn, and the fifth song played in the initialization program is the sound of starting the car. Additionally, it is important to note that MP3 playback programs should not be placed in loops for continuous execution; it is better to place them in a function and execute them under certain conditions.
Next, let’s explore the custom function “Blinking Eyes 2”. Blinking eyes control the WS2812 LED strip, and the program is shown in the image below.
If you don’t understand the program above, it’s okay. Let’s look at a simple example. The following program allows a strip of 16 LED beads to light up red.
The control program for the LED strip is selected from the “Actuator” section on the left.
Of course, an initialization program is also necessary, as shown in the image below.
If you change the color to black, the effect will be to turn off all the LED beads.
In addition to using pre-built colors, we can also adjust the colors using RGB values, theoretically allowing for 256*256*256 possible colors. The program can also incorporate delay times for the LED strip to create a flowing effect.
After understanding the simple example, we can easily comprehend the custom function “Blinking Eyes 2”. From the previous explanation, we know that when the V4 virtual pin receives data, meaning the V4 button on the Blynk mobile terminal is pressed, it emits a horn sound while the LED strip shows the blinking effect. The custom function “Blinking Eyes 2” is designed to light the LED strip in white and create a “blinking” effect. To achieve this blinking effect, we need to adjust the brightness of the LED strip, so the program gradually increases the brightness from 1-100, then decreases from 100-1, and finally turns off. This process of gradually brightening and dimming is repeated three times.
The custom function “Blinking Eyes 2” mastered, we also have another custom function called “Blinking Eyes”, which works similarly but lights the strip in red. Let’s take a look at the program for the “Blinking Eyes” custom function.
After understanding the “Blinking Eyes” custom function, the other LED strip programs become much simpler. For instance, the following program detects when the V6 virtual pin is “1”, which means ON, and lights the white LED, simulating the car’s headlights at night. Conversely, when it is “0”, which means OFF, it turns off the lights.
Through the introduction of the WS2812 LED strip and MP3 module, I believe everyone will have many ideas for the diverse lighting effects and MP3 playback. I look forward to everyone implementing their ideas!
The explanation of the LED strip and MP3 program concludes here. Next, let’s understand the steering program for the servo.
Servo Steering Program
We use the V2 virtual pin to control the servo’s steering. We need to find the control program block for the servo in the “Actuator” section on the left module bar.
Next, we can try to write the following program. When the V2 virtual pin receives data from the mobile terminal, it performs two actions: first, print the received data in the serial monitor; second, allow the servo to rotate to the corresponding angle based on the received data.
To ensure the cart turns correctly, after testing, the servo angle should be set in the range of 60-120 degrees, with the default state at 90 degrees, meaning going straight. Angles between 91-120 degrees indicate a left turn, while executing the left-turn program for the LED strip. Angles between 60-89 degrees indicate a right turn, while executing the right-turn program for the LED strip. It is important to note that the servo is mounted on the cart’s chassis, and during testing, the cart must be turned upside down. When setting the angles for left or right turns, ensure the cart is facing upwards to avoid reversing the settings.
The above program involves two custom functions: “Left Turn” and “Right Turn”. Let’s introduce these two custom functions. Similar to the previous LED strip display program, we divide the 16 LED beads into two groups: the left 8 beads and the right 8 beads, defined from the perspective of the driver sitting in the cart. The left 8 beads are numbered 1-8, and the right 8 beads are numbered 9-16.
When the cart needs to turn left, the left 8 beads will blink to indicate the turning direction. Here, the LED strip’s turning effect references the design of Audi’s turn signal, presenting a flowing effect from the inside out.
The “Right Turn” custom function is similar to the “Left Turn” function, but the LED numbers differ.
Forward and Backward Program
After mastering the steering program, let’s understand the program for moving the cart forward and backward. The forward and backward movement of the cart is controlled by the V0 virtual pin. The program handles three situations: moving forward “forward”, moving backward “backward”, and stopping “stop”. The value range for the V0 virtual pin is 0-100. When the value equals 0, the cart stops, executing the “stop” custom function. When the value is greater than 51, it executes the “forward” custom function, and when the value is less than 49, it executes the “backward” custom function.
To allow the cart to adjust speed, we use a high-power motor driver. The method for controlling the cart’s forward and backward movement and speed is simple: the high and low levels of two digital pins control the motor’s forward and reverse rotation, allowing the cart to move forward and backward, while an analog pin is used to adjust speed. To ensure the safety of the cart, we limit the speed to a maximum of 80.
Backward
Forward
Stop
Let’s take a look at the test effects of the above program through the following animated images.
Finally, the music playback program uses the state of the V5 virtual pin to control whether to play music. When the value of the V5 virtual pin is “1”, meaning ON, it starts to play music randomly and executes the custom function “Inner Flow”. When the value of the V5 virtual pin is “0”, meaning OFF, it stops playing music.
Some partners may ask if there is an “Outer Flow” function, and indeed there is. The “Outer Flow” effect is displayed in red when the cart starts.
Finally, let’s take a look at the complete program. Since the program is lengthy, parts that have already been introduced will be folded.
#Summary#
This “Child Walking Device” project has not yet undergone actual testing of the lithium battery’s endurance. After testing, reference data will be provided. During the modification process, there were instances where the steering servo and driving motor could not work simultaneously. With the help of Teacher Qiu, it was discovered that the pin selection for the ESP32 was incorrect. This experience taught Wang Zai’s dad to comprehensively understand the various parameters of the main control board.
Additionally, this design and production stemmed from a life experience. The process of modifying the project allowed Wang Zai’s dad to learn many new knowledge and skills. This project involved many previously unencountered concepts, and to complete the project, one must explore and learn with questions, mastering the knowledge instead of passively receiving it from books. This approach solidifies the knowledge system and accelerates skill enhancement. In summary, life is full of learning opportunities; careful observation, deep thinking, and a willingness to change are essential. Maintain a lifelong learning mindset, coming from life and returning to life.
We welcome more like-minded dads and moms to communicate and improve together. We also welcome criticism and valuable suggestions regarding this article.
Creating makes life better. We look forward to meeting you again next time.