How to build EDA-Robot dog: the whole process
153 steps to build EDA-Robot dog, from buying parts, printing and assembly to software, calibration and training, with the bill of materials, shop links and the official…
The creator's estimate is about CN¥30 without batteries (single-unit prices ignoring minimum order quantities); the page's recommended parts list totals CN¥61.49 at LCSC minimum quantities and CN¥30.47 per unit, both including a CN¥0.5 Taobao battery holder and four SG90 servos for CN¥14 (the listed unit prices add up to about CN¥43.9, which does not match the per-unit subtotal); 14500 cells, the charger module, PCB, shell printing and shipping are excluded
Buy parts
- Prepare the Core Hardware
Prepare an ESP8266 controller, 0.96-inch OLED display, AMS1117 regulators, two-cell 14500 battery pack, charging module, and servos. Select SG-90/MG-90 180-degree or 360-degree servos; the recommended 180-degree version has built-in limiters.
- Choose a 180-degree servo
Use a recommended 180-degree servo with a built-in limiter. This type does not require calibration.
- Prepare the 0.96-inch OLED
Use a 0.96-inch OLED display driven by an SSD1306 or SSD1315.
- Prepare a series 14500 battery pack
Use two 14500 lithium batteries rated at 3.7–4.2V each and place them in a two-cell series 14500 battery holder.
- Prepare a two-cell lithium charger
Provide a main switch and external charging connector. Use a two-cell series lithium battery charger with a full-charge voltage of 8.1–8.4V, and fly-wire the balance connector to the midpoint between the two cells.
- Check battery capacity and discharge rate
Use 14500 cells of approximately 1000–1200mAh. Ensure a discharge capability of at least 1C, with a maximum output current preferably of 1200mA.
- Three ways to search components
Components can be placed from the official reference library in the left panel; via the Place button in the top menu, which shows the real part image, reference price and datasheet; or by searching in the bottom panel, which shows symbol, footprint and 3D model previews.
- Place components from the BOM
Use the device numbers and notes in the provided BOM: open the bottom library panel in the schematic workspace, pick the component category, type the device number, search and click to place it on the canvas; the M3 standoff is the last item in the left common library.
- Organize the schematic
Organize the placed components and wiring on the schematic sheet, and frame-select each circuit module in preparation for transferring the layout to the PCB.
Print and make
- Replace footprint with 14500 battery holder
- Transfer layout by circuit module
After generating the PCB the components are scattered, so first frame-select each circuit module on the schematic sheet, then use the Layout Transfer function under the Design menu to extract those components into the PCB for re-placement.
- Set the SG90 servo 3D model
The project draws several icons and footprints to act as servo models for preview; choose SG90 in the model library to find the servo model, select it and adjust the model position parameters.
- Set the PCB Board Outline
- Place Holes and Arrange Components
Place four mounting holes around the board outline and arrange the larger components inside the board for an initial layout.
- Check Layout with 3D Preview
Use the 3D preview to inspect the component arrangement in real time.
- Hide AGND and GND Ratsnest
- Arrange Modules Using the Ratsnest
Place related circuit modules together, follow the ratsnest, and keep the connections as horizontal as possible. Put switch interfaces near the board edge and minimize later routing bends.
- Verify the Final PCB Layout
Compare the final arrangement with the shown images to verify the component and module placement.
- Apply Basic PCB Routing Requirements
Complete the PCB routing according to the basic requirements shown in the figures.
- Review the Remaining Routing Examples
Review the remaining PCB routing example images and complete the tracks as required.
- Submit PCB Files for Fabrication
After completing the PCB design, submit the files to the JLC platform for fabrication. Free fabrication is available twice per month for one board design, producing five boards with nationwide shipping.
- Log In and Claim a Coupon
Open the coupon area on the JLC ordering platform and sign in with the shared JLC ordering or EasyEDA account. Claim a free fabrication coupon after signing in.
- Claim the PCB and SMT Coupon
- Generate PCB Manufacturing Files
- Open the PCB Order Platform
After entering the JLCPCB ordering platform, fill in the board’s production process parameters.
- Enter Basic PCB Information
Select FR-4 for the board material, and let the system recognize the size or enter it manually; the free sample quantity is five boards, with extra boards costing extra, and select two layers.
- Set PCB Production Options
For a free sample, select one panelization quantity and single-board shipment; use the default 1.6 mm thickness. Seven solder-mask colors are available, with green having the fastest production cycle and shipping within 48 hours, while the other colors ship within 72 hours.
- Select Optional Services
Keep the default options for personalized services when there are no special requirements.
- Confirm PCB Delivery Time
The delivery time depends on the selected color; JLCPCB offers the fastest 12-hour rush option for an additional fee. Use the default delivery time when there are no special requirements.
- Enter invoice information
Enter the tax number before ordering. Free samples do not require an invoice, and personal information can be used.
- Enable automatic payment confirmation
- Select a free courier
Choose among the couriers displayed for the region and select a free one.
- Check coupon process setting
The coupon should be for 20 yuan. If it shows more than 20 yuan, a special process may be selected; return to the default process before applying the coupon.
- Automatic production entry
If automatic payment and confirmation were selected and the account has sufficient balance, the system automatically confirms the order and starts production.
- Check PCB order progress
Check production and courier status in the PCB orders section of the JLC ordering platform. After a few days, five circuit boards arrive.
- Build the 3D shell model
Build the robot enclosure in the JLC Cloud CAD platform using the provided 3D shell project link. The V1.3 enclosure supports resin printing.
- Make the bottom shell
The bottom shell has four servo limit slots. After the main shell is fitted, the PCB holds the servos down, so no screw holes are required in the bottom shell.
- Make the foot screw slots
The red-marked area on the foot is a screw slot. It can be fixed with either of the two large-head screws supplied with the servo.
- Print and fasten to specification
Print the V1.3 enclosure using resin printing. Use M2×2 screws to secure the PCB and M1.4×3 screws to secure the enclosure.
Assemble
- Connect the 14500 Battery Pack
Use a two-cell 14500 battery pack as the power source and connect it to the voltage-regulation circuit.
- Install Both AMS1117 Regulators
Install AMS1117-5V and AMS1117-3.3V linear regulators to convert the battery voltage of 8.4V into 5V and 3.3V respectively. Use 5V for the servos and 3.3V for the ESP8266 controller.
- Configure the ESP8266 Control Pins
Connect the controller according to the ESP8266 datasheet. Pull up IO0, IO2, the EN enable pin, and the RST reset pin, and pull down the CS chip-select signal so the ESP8266 and SPI communication operate correctly.
- Connect the SSD1315 OLED Module
Use an SSD1315 OLED module with integrated display-driver circuitry and configure the board interface to match the module pin order. Plug the display module directly into the prepared interface.
- Set Up the Serial Download Jumper
Expose separate IO0 and GND interfaces for a jumper. With the jumper installed, IO0 is pulled low and the controller enters download mode; without it, the controller circuit pulls IO0 high and the controller operates normally.
- Connect the Battery Switch and Charging Port
Expose VIN and VBAT as the power-switch interface, and VIN and GND as the external charging-module interface. Select an external two-cell lithium charging module whose full-charge voltage is approximately 8.4V.
- Connect the IO2 and IO15 Buttons
Use IO2 and IO15 for the buttons. IO2 is low while pressed and high when idle; because IO15 requires a pull-down resistor, it is high while pressed and low when idle.
- Set Up the 8.4V-to-1V Divider
Adapt the ADC divider for a maximum input of 8.4V so the ESP8266 1.0V ADC input remains within the 0-to-1V range. With R1 approximately 740kΩ and R2 equal to 100kΩ, an 8.4V input produces approximately 1.0V and a 4.2V input produces approximately 0.5V.
- Solder and trim the PCB
Solder the PCB; only the controller and LDO use non-insertable parts. After soldering, use side cutters to flatten the protruding pins at the bottom for assembly.
- Install the upper charging module and switch
Install the charging module and main switch inside the upper shell, corresponding to the PCB switch and charging connector.
- Install four servos in the lower layer
Place four servos in the lower servo compartment and use the limit slots in the bottom shell to position them.
- Secure the middle-layer PCB
The middle layer houses the PCB. Use the limit slots inside the upper shell to secure the PCB in the center while holding down the bottom motor.
- Avoid damaging the servo motor
Do not force or bend the servos during assembly and adjustment because the motor may be damaged. A metal-geared MG90 servo can be used instead.
- Select the ESP8266 Controller
Use an Espressif ESP8266 chip module as the controller. The controller handles button input, display driving, and built-in Wi-Fi connectivity for real-time information and remote data updates.
- Design the ESP8266 External Circuit
Fit 10K pull-up resistors on GPIO0, GPIO2, RST, and EN, and use a 10K pull-down resistor on GPIO15. Because project space is limited and an LDO regulator is used, omit the 10uF and 100nF peripheral capacitors; the recommended design retains them for filtering, and finalize the circuit in EasyEDA.
- Connect the ESP8266 IIC Interface
Use the ESP8266 SDK definitions to assign GPIO4 as SDA and GPIO5 as SCL. Connect the screen through the SDK-provided IIC interface for convenient debugging; custom pins may also be used without affecting operation.
- Add the Download-Mode Switching Interface
Expose the TX, RX, GND, and 3.3V pins as a serial communication interface for flashing firmware and debugging programs. Add IO0 and GND pins with jumpers to switch between operating mode and download mode.
- Connect the OLED Screen Module
Use an OLED screen module with integrated driver circuitry and connect it directly to the controller's IIC interface to display images and information. Check the module specifications to confirm pin arrangement, interface type, and power requirements, and connect the screen through a standard socket.
- Begin PCB soldering practice
Prepare the components and PCB, then begin soldering and debugging practice using common tools and through-hole component soldering and removal methods.
- Choose a soldering iron
A conventional soldering iron is sufficient; a soldering station with fast, stable heating is an option.
- Observe soldering-iron safety
Do not touch the metal part of the heated iron. Tie back hair and keep the work surface tidy to avoid burns.
- Use lead-free solder
Lead-free solder is recommended because it tins easily. Normally hold the solder in the left hand and iron in the right, reversed for left-handed users.
- Safely trim excess leads
When cutting excess leads with diagonal cutters, hold the lead between your fingers before cutting so it cannot fly away.
- Identify essential and optional tools
The soldering iron, solder wire, heat-resistant sponge, and diagonal cutters are essential. A desoldering pump, rosin, and PCB cleaner are preferable but optional.
- Solder from low to high
Solder from the lowest components to the highest, following the order given in the document’s table.
Software
- Download and flash attachments
Download the complete project files, directly flashable program binary, and filesystem binary from the attachments, then flash both binaries.
- Define motion control constants
Define the engine1, engine2, engine3, and engine4 servo pins as 14, 16, 12, and 13 in the motion control code; set speed to 300 and runtime to 100 as a reserved variable for controlling action continuity.
- Style the control page
Add the provided CSS to the control page: use Arial with default body margins and padding removed, center a container with a maximum width of 800px, style buttons with a deepskyblue background, rounded corners, and shadows, and change them to skyblue with a 2px upward movement on hover.
- Create the remote console header
- Add movement controls
- Add expression controls
- Add network function controls
- Store the page and connect AJAX
Store the control page code in the FS filesystem. Clicking page buttons triggers AJAX requests corresponding to the page route listener; simplifying the HTML avoids slow loading and response and possible incorrect display on the ESP8266.
- Register the left90 route
Register the GET route “/left90”, set actionstate to 10, and return status 200 with the text “Front function started”.
- Register the right90 route
Register the GET route “/right90”, set actionstate to 11, and return status 200 with the text “Front function started”.
- Register the front route
Register the GET route “/front”, set actionstate to 1, and return status 200 with the text “Front function started”.
- Register the back route
Register the GET route “/back”, set actionstate to 4, and return status 200 with the text “Front function started”.
- Register the left route
Register the GET route “/left”, set actionstate to 2, and return status 200 with the text “Front function started”.
- Register the right route
Register the GET route “/right”, set actionstate to 3, and return status 200 with the text “Front function started”.
- Register the left-hand route
Register the GET route “/toplefthand”, set actionstate to 5, and return status 200 with the text “Front function started”.
- Register the right-hand route
Register the GET route “/toprighthand”, set actionstate to 6, and return status 200 with the text “Front function started”.
- Add the sit-down endpoint
Register the /sitdown GET endpoint, set actionstate to 8, and return "Front function started".
- Add the lie-down endpoint
Register the /lie GET endpoint, set actionstate to 7, and return "Front function started".
- Add the free-mode endpoint
Register the /free GET endpoint, set freestate to true, and return "Front function started".
- Disable free mode
Register the /offfree GET endpoint, set freestate to false, and return "Front function started".
- Add the expression-state endpoint
Register the /histate GET endpoint, set emojiState to 0, and return "Front function started".
- Add the angry-expression endpoint
Register the /angrystate GET endpoint, set emojiState to 1, and return "Front function started".
- Add the error-expression endpoint
Register the /errorstate GET endpoint, set emojiState to 2, and return "Front function started".
- Read engine 1 left offset
Register the /engine1offsetleftpwm GET endpoint and return engine1offsetleftpwm as plain text.
- Read engine 2 left offset
Register the /engine2offsetleftpwm GET endpoint and return engine2offsetleftpwm as plain text.
- Read engine 3 left offset
Register the /engine3offsetleftpwm GET endpoint and return engine3offsetleftpwm as plain text.
- Read engine 4 left offset
Register the /engine4offsetleftpwm GET endpoint and return engine4offsetleftpwm as plain text.
- Read engine 1 right offset
Register the /engine1offsetrightpwm GET endpoint and return engine1offsetrightpwm as plain text.
- Read engine 2 right offset
Register the /engine2offsetrightpwm GET endpoint and return engine2offsetrightpwm as plain text.
- Read engine 3 right offset
Register the /engine3offsetrightpwm GET endpoint and return engine3offsetrightpwm as plain text.
- Read engine 4 right offset
Register the /engine4offsetrightpwm GET endpoint and return engine4offsetrightpwm as plain text.
- Set the weather servo action
Register the GET /weather route, set emojiState to 7, and return the plain-text response "Front function started".
- Read connection parameters
Read the ssid, pass, uid, city, and api parameters from the POST /connect request.
- Print received parameters
Print the received ssid and pass to the serial output in order.
- Create the WiFi JSON document
Create a DynamicJsonDocument with a capacity of 1024 and assign ssid, pass, and uid.
- Complete the JSON parameters
Add city and api to the JSON document so it contains all five parameters.
- Save parameters to SPIFFS
Open ssidFile in write mode, serialize the JSON content into it when the file opens, and close the file.
- Update state and connect WiFi
Update useruid, cityname, and weatherapi, then begin the WiFi connection using ssid and pass.
- Check and open the home page file
In the GET / route, check whether /index.html exists in SPIFFS and open it in read mode when present.
- Read and return the home page
Read the file size and full contents, close the file, return the contents as text/html, and end the request handling.
Calibrate and test
- Calibrate motor compensation values
Adjust the reference compensation values for each motor batch through the motor calibration page: engine1 is -93/-87, engine2 is -120/-122, engine3 is -3/-57, and engine4 is -78/-109, with the left and right values corresponding to left-turn and right-turn compensation.
- Adjust motor compensation with buttons
Use the left and right rotation buttons at the bottom of the motor, and calibrate the motor with the decrease and increase motor left/right-turn compensation buttons.
- Perform rough servo calibration
- Perform precise servo calibration
- Save compensation and reflash
Record reasonable compensation values for each motor, modify the compensation definitions in the program, and reflash it. Values can also take effect immediately when entered, but they are not saved to the FS file system and will not persist after restart.
- Tune servo compensation
Use engineXoffsetXpwm to adjust each motor’s compensation until all four servos rotate through consistent angles and move in synchrony. SG90 servos have no magnetic encoder, so friction, wire length, current stability, and other external factors will affect the adjustment.
Use it
- Add obstacle, temperature, or turret hardware
Add hardware such as obstacle avoidance, temperature measurement, or a turret to give the robot more capabilities.
Parts
- ESP-12F (ESP8266MOD) module; AMS1117‑5.0 and AMS1117‑3.3 regulators taking 8.4V down to 5V and 3.3V
- 4 SG90/MG90 servos: the 180° version is advised (built-in end stops, no calibration), with metal-gear MG90s as an option
- 0.96-inch OLED module (SSD1306/SSD1315; listed part HS96L03W2C03)
- Two 14500 Li-ion cells with a two-cell holder, an external 2S charger module and a 10×15 mm rocker switch
- Through-hole resistors and capacitors, two 6×6 tact buttons, an SK12D07VG6 slide switch, a 1×10 pin header
- 3D-printed body, base and four feet; M2×2 screws for the PCB, M1.4×3 for the shell, and the servo's own screws for the feet
Tools
- A soldering iron (everything except the controller and LDOs is through-hole) and flush cutters for trimming leads
- A USB-TTL adapter or DAP-Link (CH340 driver), with a jumper on IO0 for download mode
- A 3D printer or JLC 3D printing
Skills
- Through-hole soldering and assembly in three layers: charger and switch, PCB, servos
- VS Code with PlatformIO (Arduino framework) or the Arduino IDE; the wiki recommends C/C++, JavaScript, HTML, CSS and basic networking
- EasyEDA Pro schematic and PCB design (covered by the course)
Software
- PlatformIO project (nodemcuv2, Arduino framework) using ESPAsyncWebServer, U8g2, ArduinoJson and NTPClient
- Prebuilt firmware: 180° servo V1.0/V1.1 and a 360° servo build (firmware.bin plus spiffs.bin)
- Resource pack: EasyEDA Pro projects V1.2/V1.3, Gerbers, BOMs, a schematic PDF and the 95-page EDA-Robot electronics training guide