Introduction: Blockly RC Car for Programming

In this Instructable I will add Google Blockly programming functionality to RC 8 wheels stunt car that I gave to my son at Birthday.

I started to write the instruction after I finished the project, so the initial disassembled RC controller' photos already include final electronics.

Supplies

These are the list of materials that are needed to make this project:

- RC car - 1 piece, but it won't be changed

- RC controller - 1 piece

- ESP32 Lolin S2 Mini - 1 piece

- resistors 500 - 2000 Om, 1kOm is fine - 6 pieces

- optocoupler PC817 - 6 pieces

- Boost converter Li-ion 3.7V to 5V - 1 piece

- Button with fixation - 1 piece

- Wire 0.2 mm, about 2.5 meters

- 18650 accumulator - 1 piece

- Case for 18650 accumulator - 1 piece

Step 1: RC Disassembling

Unscrew the bolts and open the cover

Step 2: RC Soldering Electronics

I found six buttons and it's soldered points.

Then:

  1. I cutted and tinned 6 * 4 = 24 pieces of 0.2mm thickess wires with length dependant on length from button soldered points to Lilo S2 Mini pins, from 5 cm up to 10 cm.
  2. Soldered resistor to input PIN 1 of each optocouple, and all wires to each optocouple
  3. I did not solder resistor to output PINs 3 or 4 of optocouple, beause RC controller already limit current, otherwise pressed buttons would fry RC controller.

Step 3: RC Soldering Power

I attached 18650 case and passed power wires through the holes and twisted around inner plastic guides for fixation and glued by hot glue.

Then:

- I glued power button to place of fake antenna.

- I soldered boost converter to button and to ESP32 VBUS/GND pins

Step 4: Arduino IDE Preparation

Clone sources https://github.com/vadimostanin/BlocklyRCCar

Steps for preparing Arduino IDE:

- Install Arduino IDE 2.3.X

- Install ESP board:

  1. "esp32" by Espressif Systems, version 3.0.0

3.0.0 works fine, but 3.1.0-3.3.0 have DHCP issue with assigning IP to WiFi client while connecting.

But maybe it's just my code issue.

- Install Arduino libraries:

  1. "ESP Async WebServer" by EP32Async, version 3.8.0
  2. ArduinoJson" by Benoit Blanchon, version 7.4.2

- Install tool for uploading HTML file to LittleFS/SPIFFS memory:

  1. According to the instruction https://randomnerdtutorials.com/arduino-ide-2-install-esp32-littlefs/:

Copy https://github.com/earlephilhower/arduino-littlefs-upload/releases/download/1.5.4/arduino-littlefs-upload-1.5.4.vsix or other newest to folder "<Windows_User>\.arduinoIDE\plugins\" and restart Arduino IDE 2.3.X

Step 5: Flashing Firmware

  1. Plug-in Lolin S2 mini to PC USB port
  2. If Lolin S2 mini is not recognizable, then at the board press-hold "0" button, then press-release "RST" button, then release "0" button
  3. Select port
  4. Pressing "Upload" button will compile and upload firmware

Step 6: Uploading HTML

- Check that file "arduino-littlefs-upload-1.5.4.vsix" is present at folder "<Windows_User>\.arduinoIDE\plugins\" and Arduino IDE 2.3.X was restarted after copying, as specified at "Step 4: Arduino IDE preparation"

- Close "Serial monitor" as it will interfere process.

- Check Port, it should be the same value as during flashing.

- Press "Ctrl+Shift+P", and type "Upload LittleFS", press Enter

Process will fail and will switch port to another, select new port value and try again, now process should success.

Step 7: Testing

  1. Insert 18650 to battery case
  2. Turn-on CAR
  3. Turn-on power button for ESP
  4. Connect Tablet or smartphone to WiFi AP "ESP32_Robot"
  5. Open web browser to URL "httpt://192.168.4.1", wait and reload page 1-2 times, it can lag due to HTML size.
  6. Make program and press "Send to ESP32"

Expected behaviour is that the car should move and follow the program.


Feel free to extend project.