Skip to the content
PCBKitNew board
2 layers63 × 89.5 mmRobot, the printed circuit board in 3D

A KiCad PCB for an obstacle avoiding robot.

Size
63 × 89.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
71
Nets
118
Pads
304
Tracks, vias
510, 41
Pours
2
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
12 Sep 2024
Updated
4 Apr 2025

Overview

Robot is an open-source printed circuit board by sidstuff, from the sidstuff/robot repository on GitHub, published under the MIT licence. It is a 2-layer board of 63 × 89.5 mm with 71 parts on 118 nets, routed with 510 tracks and 41 vias.

It is built around the L293D, ADXL343BCC and LP5907MFX-2.8, with the MPU-6050, BSS138 and LTST-C235KGKRKT among its other parts. Its parts include 29 resistors, 12 capacitors, 11 connectors, 9 ICs and 4 transistors. It belongs with the robots and motor control boards and the NXP (LPC, Kinetis, i.MX RT) boards of this library.

Main components

6

README

README.md

Obstacle avoiding robot

A common type is the micromouse, a small robot which tries to solve a maze. I.e., it tries to reach the center of a maze made up of a 16×16 grid of cells, each 180 mm square with walls 50 mm high.

Usage

Clone the repo and open with KiCad.

Schematic

Schematic

Parts

While picking parts, ensure that the voltage/current/power ratings of componenets are not exceeded. Also, lithium cells have a nominal voltage of 3.7V (although it can go up to 4.2V when fully charged, and can be discharged until 3V), so their batteries are going to be multiples of the same.

Microcontroller – Teensy 4.0

https://www.pjrc.com/store/teensy40.html

The Teensy 4.0 is compatible with the Arduino software, smaller than the Nano, and more powerful than the Giga (2x the CoreMark score). It needs a 5V supply voltage, so we'll use a 3.7V Li-ion battery with A TPS61099x 5V boost converter.

Why not older models?

PJRC recommends use of Teensy 4.0 / 4.1 for new projects. We do not believe supply of chips for Teensy 3.x is likely to ever fully recover. These chips are made with 90 nm silicon process. Most of the world's semiconductor fabs are focusing on 45 nm or smaller, leaving limited supply for older chips. We anticipate the cost of these chips is likely to increase as the supply continues to dwindle.

www.pjrc.com/store/teensylc.html

Thus we use the 4.x series to future-proof our design. The 4.0 is the smaller model of the series and is sufficient for our project.

Motors – N20 gear motors, driven by the L293D

We will use the common N20 gear motor. To pick the specifications of the same, let's make use of this Drive Motor Sizing Tool

text
Total mass: 210g                 When picking components, we should keep the total weight at or below this.
Number of drive motors: 2        Each of the rear wheels will have a sepaarte motor, turning will be achieved by driving them at different speeds.
Radius of drive wheel: 32.5 mm   Use 65 mm RC wheels
Robot velocity: 1.35 m/s         Micromice can run at over three meters per second, depending on the maze design.
Maximum incline: 0 deg           A simple maze solving robot doesn't need to worry about performance climbing inclines.
Supply voltage: 12 V             12V is the highest available voltage for the N20. A higher voltage means less current/charge is required for the same power/energy output. 
Desired acceleration: 4 m/s2     Micromice can run with forward acceleration and braking well over 1g.
Total efficiency: 40%            N20 motors have a maximum efficiency of around 0.4
text
Angular Velocity: 396.86 rpm
Torque: 0.34786 kgf-cm
Total Power: 1.4175 W
Maximum current: 118.13 mA

The N20 motor rated for 12V 400RPM fulfils these requirements. It has a rated torque of 0.35 kg-cm. The recommendation for brushed DC motor operation is 25% or less of the stall current. The stall current for the above motor is 0.75 A, and the required current of 118.13 mA is less than 16% of it.

Make sure to buy the version with a motor encoder and its wires – it tells us how much the motor has rotated and thus the robot's speed as well as the distance travelled.

With these motors, we will use a pair of 65mm RC wheels.

On the L293D motor driver, there are two pins to control the direction of each motor as follows:

IN1IN2Spinning Direction
LOWLOWMotor OFF
HIGHLOWForward
LOWHIGHBackward
HIGHHIGHMotor OFF

The enable pin for each motor can be used to switch it on/off (as well as control the speed using PWM) so the LOW,LOW and HIGH,HIGH configurations are not needed. As for the remaining two, we can save two digital pins (one per motor) by using a logic inverter. Thus we use the Dual Schmitt-Trigger Inverter, but since we have a pin to spare, we end up using a digital pin for the inverter supply voltage (instead of the 3.3V pin) to simplify the connections.

The L293D will drop the motor supply voltage by ~2.6V, so we will use a 14.8V LiPo battery for the motors.

Gyroscope + accelerometer - MPU6050

The MPU6050 can measure the linear accceleration along, as well as the angular velocity about, the x, y, and z axes.

Accelerometer – ADXL345

The difference in the linear outputs of two accelerometers placed some distance apart can be used to calculate the rotation, so an additional accelerometer was included to see if it can be used to improve the accuracy of the calculated motion. But I have not built and implemented this yet, and the ADXL345 has been placed arbitrarily on the PCB design for now, so it can be removed from the design.

NOTE: Both the MPU6050 and the ADXL345 are I2C devices and thus we use 2.2k pull-up resistors on the SDA and SCL connections because the Teensy's internal pull-up resistors are too weak.

Distance sensors

Note that distance sensors have a dead zone or blanking distance of say, x cm, beginning from the face of the sensor and extending outward, within which it cannot measure distances. One can simply position the sensor x cm inwards on the robot if they wish to measure distances in that zone.

Front - Sharp GP2Y0A41SK0F

https://www.pololu.com/product/2464

The GP2Y0A41SK0F is an IR sensor with a range of 4 – 30 cm. Considering the size of the robot and its enclosings, this is a good range within which to detect obstacles so the robot can decide if and how much to speed up, slow down, or stop, and can do so in time. A simple calculation is that if the robot is moving at its maximum speed of 1.35 m/s and has a maximum acceleration (deceleration in this case) of 4 m/s2, it can come to a stop within a distance of v²/2a = 22.8 cm.

This sensor draws current in large, short bursts, which is why we should (and do) place a 10 µF capacitor or larger across the 5V supply and ground, close to the sensor.

The sensor will be stuck to the front of the robot and a 3-Pin Female JST-PH Cable with male pins will be used to connect it to 0.1" female pins on our PCB.

Sides – VL6180X

https://www.pololu.com/product/2489

The sides of the robot will approach closer to walls and obstacles than the front, so a shorter minimum range is required. The VL6180X is a time-of-flight ranging sensor with a range of 1 – 20 cm (or 60 cm with reduced resolution), which is sufficient. It uses 2.8V logic, so we use the LP5907MFX-2.8 linear voltage regulator to convert 3.3V to 2.8V.

It is an I2C device, and we use 10k pull-up resistors on the SDA and SCL connections. Its I2C address will reset to 0x29 when powered off and on again, so for simplicity, we let the two chips have identical addresses and instead connect them to different SDA/SCL pins on the microcontroller.

Each chip (with its associated componenets) will be on a separate board that will be stuck to the side of the robot, and connected to the main PCB via common 0.1" pins and jumper cables.

RG bicolor LEDs – LTST-C235KGKRKT

We use voltage dividers to supply a fraction of the two batteries' voltages to analog pins on the Teensy. Based on these, the microcontroller can make two corresponding bicolor LEDs display hues from green to yellow to red, to indicate the charge. An LED can blink red when the level is danngerously low, and blink green when its corresponding battery is done charging. The LED is rated for 20mA but the Teensy's pins have a limit of 10mA. The voltage supplied to the LED will always be 3.3V, the brightness will be controlled using PWM. The LED forward voltage is 2V. Thus the value of the current limiting resistor used should be at least (3.3−2)/0.01 = 130 ohms, so let's use a standard 150 ohm resistor.

Buzzer – AI-3035-TWT-3V-R

We can have the buzzer buzz at different frequencies and beep at different delays to notify us of various things. Its rating of 3V,9mA is within the limits of the Teensy pin. For every doubling of distance, the sound level reduces by 6dB, so its volume of 100dB@10cm means that our buzzer will have a nicely audible volume of 60dB 10m away.

TODO: Due to laziness, the PCB currently uses KiCad's standard 12x9.5mm buzzer footprint, which should be replaced with a custom but more accurate 30x20mm one – this means the PCB will be larger than it currently is.

Potentiometer – RK09K or similar

We'll use a 10k rotary potentiometer (vertical) with a knob to provide an analog voltage that indicates the speed at which we want the robot to move.

Switches

We need two switches. First, an SPST rocker switch connected (not on the PCB) to the 3.7V battery to just switch on the circuitry, perhaps to check the working status of the components, battery level, etc. Then a normally open SPST Push button switch, like the MEC 5GTH935, to signal that the robot should start moving. Normally the Teensy pin is pulled down to ground, but when the switch is pressed, it momentarily becomes HIGH, and upon receiving this signal, the microcontroller starts the robot's motion.

2 Pin Screw Terminals – Xinya XY308-2P 2.54MM

In total, we require five 2 pin screw terminals to connect various unterminated wires to the PCB.

Batteries

PartWeight (g)Voltage (V)Current (mA)
1 x Teensy 4.02.85100
2 x N201214.8118
2 x wheels31--
1 x L293D2.1524
1 x ADXL3450.033.30.04
1 x MPU60500.033.33.6
1 x GP2Y0A41SK0F3.5512
2 x VL6180X (with LP5907MFX)0.033.325
2 x (LTST-C235KGKRKT + 150ohm)0.043.38.67
1 x AI-3035-TWT-3V-R1239*
1 x RK09K4.53.30.33
1 x Rocker Switch1.40-
1 x 5GTH93533.30.7*
5 x XY308-2.540.50-

* – current flows rarely

Adding all the weights, we get 112g. For the batteries, let's pick the 3.7V 3.7Wh 1000mAh LiPo (20g) and the Orange 14.8V 360mAh 25C 4S LiPo (60g). This brings the weight up to 192g, but this is excluding the PCB material, wires, connectors, and small circuit elements. A PCB weighs a couple grams per square inch – see custompcb.com/faq.php – so the final weight should come out to around 210g.

The 14.8V Lipo is 25C, so can deliver a maximum current of 0.36Ah * 25h^(-1) = 9A, which is more than enough for our motors. They draw upto 2 * 118mA = 236 mA, so our battery will last 360mAh / 236 mA = 1.5h, if the robot was continuously running at full power, but in reality, will last longer.

The following diagram shows the flow of current from the 3.7V LiPo.

text
------------------------------------ 3.7V
               |
      301.2 mA (1114.5 mW)
               |
      ----------------------
      | TPS61099 (93% eff) |
      ----------------------
               |
---------------|-------------------- 5V
               |
      207.3 mA (1036.5 mW)
               |
      -------------------
      |                 |
      |              171.3 mA
      |                 |
 --------------  -------|------------------
 | 5V Devices |  |      |                 |
 --------------  |  ----------            |
      |          |  | Teensy |            |
      |          |  ----------            |
    36 mA        |   |      |             |
      |          |   |   ---|--- 3.3V     |
      |          | 100mA    |             |

The 3.7V LiPo has a max continuous discharge current of 1000 mA so it will be able to provide our required current of 301.2 mA. It is a 3.7 Wh battery, so it will last 3.7Wh/1114.5mW = 3.3h.

PCB

For a 1 oz copper thickness PCB, KiCad's default trace width of 0.200mm is sufficient for the amount of current in our circuit, and so are the default 0.6/0.3 mm vias. We must also make sure to maintain some clearance betweeen traces, to prevent crosstalk. The routing in our PCB is tight at places, which is why our ground plane is important in that it reduces crosstalk.

From Wikipedia:

When two traces run parallel, an electrical signal in one can be coupled into the other through electromagnetic induction by magnetic field lines from one linking the other; this is called crosstalk. When a ground plane layer is present underneath, it forms a transmission line with the trace. The oppositely-directed return currents flow through the ground plane directly beneath the trace. This confines most of the electromagnetic fields to the area near the trace and consequently reduces crosstalk.

Footprint
3D View

Parts

71
QtyValueFootprintReferences
1010kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR3, R4, R18, R19, R20, R21, R22, R23, R24, R25
50.1uFCapacitor_SMD:C_0402_1005MetricC3, C5, C8, C11, C12
510uFCapacitor_SMD:C_0805_2012MetricC1, C2, C6, C9, C10
52.2kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR1, R5, R6, R7, R10
4150Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR11, R12, R13, R14
447kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR26, R27, R28, R29
4BSS138Package_TO_SOT_SMD:SOT-23Q1, Q2, Q3, Q4
34.7kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR2, R15, R17
2Conn_01x04_PinConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_HorizontalJ10, J11
2Conn_01x04_SocketConnector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ8, J9
2LTST-C235KGKRKTLED_SMD:LED_LiteOn_LTST-C235KGKRKTD1, D2
2VL6180Xtof:VL6180XU8, U9
110kPotentiometer_THT:Potentiometer_Alps_RK09K_Single_VerticalRV1
110nFCapacitor_SMD:C_0201_0603MetricC4
11MResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR8
12.2nFCapacitor_SMD:C_0201_0603MetricC7
12.2uHInductor_SMD:L_1008_2520MetricL1
122kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR16
1249kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR9
1ADXL343Package_LGA:LGA-14_3x5mm_P0.8mm_LayoutBorder1x6yU1
1BuzzerBuzzer_Beeper:Buzzer_12x9.5RM7.6BZ1
1Conn_01x03_SocketConnector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_VerticalJ1
1Connect 3.7V Li-ionTerminalBlock:TerminalBlock_Xinya_XY308-2.54-2P_1x02_P2.54mm_HorizontalJ2
1Connect Motor 1TerminalBlock:TerminalBlock_Xinya_XY308-2.54-2P_1x02_P2.54mm_HorizontalJ6
1Connect Motor 2TerminalBlock:TerminalBlock_Xinya_XY308-2.54-2P_1x02_P2.54mm_HorizontalJ7
1Encoders 1TerminalBlock:TerminalBlock_Xinya_XY308-2.54-2P_1x02_P2.54mm_HorizontalJ3
1Encoders 2TerminalBlock:TerminalBlock_Xinya_XY308-2.54-2P_1x02_P2.54mm_HorizontalJ4
1Inverter_Schmitt_DualPackage_TO_SOT_SMD:SOT-363_SC-70-6U5
1L293DPackage_DIP:DIP-16_W7.62mmU6
1LP5907MFX-2.8Package_TO_SOT_SMD:SOT-23-5U7
1MPU-6050Sensor_Motion:InvenSense_QFN-24_4x4mm_P0.5mmU4
1SW_PushButton_Switch_THT:SW_MEC_5GTH9SW1
1TPS610997DRVPackage_SON:WSON-6-1EP_2x2mm_P0.65mm_EP1x1.6mmU2
1Teensy4.0teensy:Teensy40_SMTU3
1XT30PB-M connector for 14.8V LiPoConnector_AMASS:AMASS_XT30UPB-M_1x02_P5.0mm_VerticalJ5

Questions

How big is the Robot PCB?

It measures 63 × 89.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Robot use?

71 parts, built around the L293D, ADXL343BCC, LP5907MFX-2.8 and MPU-6050. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Robot KiCad files?

From the sidstuff/robot repository on GitHub, at the commit this page was made from: the board is robot.kicad_pcb and its schematic robot.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Robot design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 4 layers131 × 89.5 mmMecha pico mcb, the printed circuit board in 3D

    Mecha pico mcb

    wubneh/MCTR260-pico-firmware

    Raspberry Pi Pico W robot controller firmware for MCTR 260 Mechatronics Design. Dual-core BLE architecture with mecanum drive, stepper/DC motor support, and configurable motion profiles.

    85 parts1MIT
  • 4 layers81.2 × 81.2 mmView base, the printed circuit board in 3D

    View base

    SeedLabs-it/smartknob-hardware

    PCB and CAD files for smartknob devkit

    259 parts47
  • 6 layers32 × 32 mmBoard latest, the printed circuit board in 3D

    Board latest

    dennisss/dacha

    Monorepo for awesome tools/projects/libraries

    69 parts397Apache-2.0
  • 2 layers28 × 45 mmNosepokeV1.0, the printed circuit board in 3D

    NosepokeV1.0

    danieltith/Neuroscience

    Code and hardware files related to my PhD thesis: "Mapping associations between early life adversity and alcohol use disorder through human epidemiology and rat neurobiology".

    29 parts
  • 4 layers62.8 × 61.7 mmCf mp3-player, the printed circuit board in 3D

    Cf mp3-player

    will127534/cf-mp3-player

    A simple MP3/WAV/FLAC player using CF card

    119 parts16MIT
  • 2 layers59.3 × 24.5 mmAnchor, the printed circuit board in 3D

    Anchor

    WaltTeb/BareTag_Tool_Tracker

    PDR draft of SDP final report

    35 parts3
  • 4 layers99.5 × 56.5 mmEKG licenta, the printed circuit board in 3D

    EKG licenta

    AlexMirt2/EKG-signal-acquisition-and-processing-system

    The diploma project focuses on designing and implementing an ECG signal acquisition and processing system. It includes smart devices capable of transmitting data to the cloud.

    107 parts
  • 2 layers100.5 × 144.5 mmSp-1, the printed circuit board in 3D

    Sp-1

    guthmanny/feahi_rp2350

    Soran SP-1 sampler firmware (RP2350 + ESP32-C6) and CBI-40 hardware

    296 parts