Skip to the content
PCBKitNew board
2 layers57.6 × 40 mmMushak pcb, the printed circuit board in 3D

It is a Micromouse, maze solving bot.

Size
57.6 × 40 mm
Copper layers
2
Thickness
0.6 mm
Parts
117
Nets
128
Pads
406
Tracks, vias
1,131, 153
Pours
3
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
5 Jul 2022
Updated
15 Oct 2023

Overview

Mushak pcb is an open-source printed circuit board by gautam-dev-maker, from the gautam-dev-maker/mushak repository on GitHub, published under the MIT licence. It is a 2-layer board of 57.6 × 40 mm with 117 parts on 128 nets, routed with 1,131 tracks and 153 vias.

It is built around the AS5048B-HTSP, DRV8833PWPR and VL53L0CXV0DH/1, with the AMS1117-3.3, MPU-6500 and SFH 3015 FA among its other parts. Its parts include 37 capacitors, 29 resistors, 17 connectors, 7 ICs and 6 diodes. It belongs with the STM32 boards of this library.

Main components

7

README

README.md

About The Project

Mushak is a micromouse maze solving bot. The aim of this project is to make India's first and smallest half-size micromouse bot. "Mushak" in hindi means "Mouse".

This micromouse consist of a very small coreless motors (6 mm width and 10 mm length) and PCB as it's base . Since coreless motors doesn't provide enough torque for the movements of bot we used gear box to increase the torque.

Mushak is of size 45.7mm x 40.0 mm, which is smaller than similar micromouse using STM32F405RG. We boast of least area consuming micromouse made using STM32 LQFP64 package chips.

Table of Content

File Structure

text
.
├── Assets             # Documentation files screenshots, gifs, videos of results
├── firmware           # contains required code for controlling the bot
├── pcb_design         # PCB files made in  kicad 6
├── cad_design         # CAD files of mushak (micromouse)
├── LICENSE            # License for this project
└── README.md          # Contains documentation and information about this project

Further file structure of each folder is given in below sections.

PCB Design

The Mushak PCB design is made on the latest version of KiCAD 6.

Mushak is designed over STM32F405RG microcontroller accomodated with various sensors and drivers for the micromouse.

We designed the smallest micromouse that is based on STM32F405RG microcontroller

Major components used in the PCB include -

ComponentsDescription
STM32F405RGMicrocontroller
VL6180xToF sensor4
DRV8833Motor Driver
MPU6500IMU
SFH-4045NInfrared Emitter
SFH-3015-FAPhototransistor (Reciever)

IR sensors

  • The IR sensors include majorly two components, IR emitter which emits the Infrared light of a particular wavelength which is not visible with the human eye.

  • This light gets reflected back from the obstacle present in form of the robot to the photo transistor, when the Infrared light of this perticular wavelength enters the phototransistor device it allows the current to flow from the collector to the emmiter of device. This current flow creates a voltage drop across the resistor connected with the photo transistor and this voltage drop is read by th ADC of the microcontroller which varies as the intensity of light reflected changes. By this way we can determine how far is the obstacle from the robot.

  • For controlling the intensity of the transmitted light we used N-Channel Mosfet whose gate is controlled by PWM signal given by the microcontroller. By varying the PWM duty cycle we can control the intensity of the transmitted light from IR emmiter by which we can control the distance sensitivity.

  • Four Sensor pairs are being used in Mushak (Micromouse)

Placement of IR Sensors

Placing IR sensors pose a challenge, and required rigorous testing and brain storming.

As can be seen in the image above we have visualised 2 cell based maze and bot is placed in first cell.

  • IR1 (blue rays) is pointing to the left mid point of next cell.
  • IR2 (orange rays) is pointing to the left end of current cell.
  • IR3 (pink rays) is pointing to the right end of current cell.
  • IR4 (green rays) is pointing to the right end of current cell.

To move the bot in straight line along the diagonal maze pattern , we have considered point 1 and point 2. These two points are the edges of diagonal ends of above pattern . So if bot had to move diagonally we can check for readings at these two points and control the bot accordingly.


Power Distribution

  • Power to the control circuits is provided by 3V linear Regulator(LDO) which can provide upto 1A current. Power to the motor is directly given to the motor driver through battery.
  • Additional capacitors are added across outputs for filtering out the voltage. Voltage divider resistors are being used to monitor the battery voltage. Power indication LED has been provided in the PCB. The input voltage for the PCB is 3.7 voltage through a general LiPo battery.


STM32F405RG (Microcontroller)

The below image shows the pinout of STM32F405RG that we will be using for this project :

Decoupling capacitors of 0.1uF are connected near the vdd pins of STM32. Additional external low and high frequency oscillators are added for precise timing.

  • HSE(High Speed External) clock - 25 Mhz
  • LSE(Low Speed External) clock - 32.769 Khz

Filter circuit is being used for filtering out the analog reference voltage. Additional Debug switches are being added for debugging purposes


DRV8833 (Motor Driver)

  • We have used H-bridge motor driver which can control two motors at the same time via PWM (pulse width modulation) from the STM32F405RG (microcontroller).

  • The motor driver can supply 1.5 Amps of current per motor which is enough to power up the coreless motors.

  • This motor driver keeps the controls terminals from the microcontrolller isolated from noise and high volatages of the motor power supply.


VL6180X (ToF Sensor)

  • We added a Time of Flight sensor in front of the robot to measure the distance of the obstacle in front from the robot.

  • This sensor measures the time taken by the light signal to get reflected from the obstacle and then measures the distace of the obstacle from the robot.

  • The sensor uses I2C protocol for communication with the microcontroller and send the distance values. It also has an additional feature of sensing the ambeint light which we can use to avoid the problems faced with IR sensors due to varing ambient light conditions.
  • Due to cost issues it is not feasible to replace IR sensors with VL6180x, else it could have been a replacement.

HC-08 (BLE Module)

  • We used a BLE(Bluetooth Low Energy) module to communicate to the robot. It is one of the most important modules that is being used in mushak, this bluetooth module will enable us to communicate with the robot and precisely tune it to solve the mazes, additionally it makes debugging easier for us making Mushak user friendly.

  • The module consumes very less power(since it works on BLE) and works on UART communication to talk with the microcontroller.

  • For attaching this module we have provided the JST connectors to connect this module externally when required.

AS5600 (Magnetic Encoder)

  • To measure the RPM and the distance that the robot has covered we needed a type of encoder feedback. For this we used AS5600 magnetic encoders to measure the amount of rotation of the robot wheel.

  • The magnetic encoders are mounted in an innovative way due to which no external mounts were required for their placement. Since magnets need to be right infront of the IC of AS5600 to get proper reading, we have taken extra care with mount size and shaft placement.

  • The sensor works on I2C communication protocol to provide the reading to the microcontroller.

MPU6500 (IMU)

  • This sensor gives the feedback of orientaion of the robot. This MEMS based chip has in-built Acclereometer and Gyroscope by which it can determine its orietation with respect to space.

  • This sensor works on SPI as well as I2C communication protocol but in our case to get the fastest data transfer, we used use SPI communcation.


Routing

  • Front Copper Layer:

  • Back Copper Layer:

  • Final Routing:

For routing of the control circuitry we used traces of 0.2mm width and for power connections we used 0.4mm width tracks to ensure fairly high current flow.

Solutions to some of the major problems faced while designing PCB

  1. Minimalising passive components is a really hard task. So to solve this I properly reffered the application notes and datasheet of stm32f405RG. Moreover the design is well tested on simulation platform.

  2. Efficient placement of components to reduce the size of the PCB. Innovative design to fix sensors and encoders in such a small space.

  1. Since IRs are sensitive to ambient light we required a mechanism to adjust the brighness of IR Emitter. So to do that we used a mosfet based circuit, so brightness can be controlled using PWM.

  2. It was a big challenge to place 90+ SMD and THT components on a small size PCB of just 45.7x40mm size.

CAD Design

CAD design consist of 3D modeling of Bot design.Before design can be made on PCB, we need to check if various other aspects of systems and mechanical design satisfy our requiements. So CAD design form a very important part of our project.

Part Descriptions

  • The bot contains a total of 6 main mechanical components which are as listed in the following table :
PartsDescription

Motors - This motor has
dimensions: Length x Dia. 12 x 6 mm and a shaft lenght of 6mm.
Motor_mount - This is the mount for the motors, which holds
the motor, shaft, gears, bearing and magnet.Because of less center-to-center distance between gears, after many iterations this mount was designed.
TOF_mount - This is the mount for TOF sensor, which is placed
in front. We have used VL6180x TOF sensor.
IR_mounts - These are the mounts for IR sensors placed
at specific angles. SFH-3015-FA and SFH-4045N sensors are phototransistors and IR emitters respectively.
Gears - The metal gears were extracted from mg90s servos having dimensions:
Driving gear:
        Teeth 9
        Pressure Angle - 20º
        ID - 0.5, OD - 2.14 mm
        Width 2.46 mm
Driven gear:
        Teeth 47
        Pressure Angle 20º
        ID - 1.5mm, OD - 9.55 mm
         Width 1.2 mm.
Center to center distance is 5.80mm and modulus 0.195
Bearings, shaft and Wheels - These are the passive components used.
Bearings x4 of dimensions: ID x OD 1.5 x 4 mm.
Shaft x2 of dimensions: Length x Dia. 15 x 1.5 mm.
Wheels with dimensions: ID x OD 1.5 x 12.5 mm.
A combination of 2 bearings is used to house the shaft for better stability and lesser Vibrations.

NOTE :

  • ID is abbreviation for Internal Diameter.
  • OD is abbreviation for Outer Diameter.

Issues Faced in Mechanical Designing

Designing Mount

  • Issue : The main issues faced in designing the Mount were As the Gears acquired were of a smaller diameter, there was an issue of interference between the bearing and the motor. As they were too close, it was impossible to 3D print a mount with the thickness less than 1mm.
  • Solution : The solution opted for this was to actually disalign the motor and the shaft to give room the bearing housing to be 3D printed. This enabled us to print a more stable base due to the stronger Shaft housing. Below images demonstrate how it was done.

Finalising and Meshing the gears

  • Issue : As there are a varieties of gears available. It was hard for us to choose the right combination and Built the Model and mounts around it.
  • Solution : We started with finalising the sizes and the gear ratios needed according to the available spaces. We then did the market research to find the gears closest to our needs and incorporated those models into the Design.

Firmware

The firmware for this project is written using STM32-HAL. STM32 HAL consist of bare-metal register address and light weight peripheral libraries giving programmer the full control. For running multiple tasks we are using FreeRTOS. We will be storing the maze in flash memory, since page size is 2 bytes, we need to access 2 bytes at a a time.

The firmware is required to interact with the following external sensors/peripherals:

  • SFH-4045N : Infrared Emitter for detecting walls.
  • SFH-3015-FA : Infrared Receiver to receive the emitted
  • AS5600-ASOT : Encoders to calculate the movements of wheel.
  • DRV8833 : Dual H-bridge Motor driver required to control motor.
  • MPU6500 : Gyroscope and Accelerometer sensor.
  • SMT-0440-S-R : buzzer to generate the victory sound.
  • VL6180x : Time of flight sensor to measure the distance between wall and bot.
  • HC-08 : Bluetooth module primarily used for logging. It uses 9600 baud rate for communication.

File Structure

text
.
├── Firmware                                # contains required code for controlling the bot
│    ├── Core                               # Contains developer code for sensors and other peripherals
│    │   ├── As5600                         # Driver Api for AS5600
│    │   │   ├── as5600.c                   # Source code for AS5600
│    │   │   └── as5600.h                   # Header file for AS5600
│    │   ├── Ble_logger                     # Bluetooth logger API using UART
│    │   │   ├── ble_logger.c               # Bluetooth logger source code
│    │   │   └── ble_logger.h               # Bluetooth logger header file
│    │   ├── Drv8833                        # Code for Motor Control
│    │   │   ├── drv8833.c                  # Source code for DRV8833
│    │   │   └── drv8833.h                  # Header files for DRV8833
│    │   ├── Inc                  
│    │   │   ├── FreeRTOSConfig.h           # FreeRTOS configuration file
│    │   │   ├── main.h                     # Main header file
│    │   │   ├── stm32f4xx_hal_conf.h       # STM32 HAL configuration file
│    │   │   └── stm32f4xx_it.h             # contains header of interrupt handlers
│    │   ├── Mpu6500
│    │   │   ├── mpu6500.c                  # Source code for MPU6500 Driver
│    │   │   └── mpu6500.h                  # Header file for MPU6500 Driver
│    │   ├── Peripheral                     
│    │   │   └── I2c                        # I2C API's handler
│    │   ├── Src
│    │   │   ├── freertos.c                 # FreeRTOS source code

Pinout of STM32F405RG

The below image shows the pinout of STM32F405RG that we will be using for this project :

Communication Buses

  • I2C (Inter-Integrated Circuit) : We use two encoders(AS5600),so we needed to use two different I2C bus. Vl6180x (ToF) sensor also uses I2C bus communication, so overall 3 I2C bus communication is used.
  • SPI (serial peripheral interface) : MPU6500 supports both I2C as well as SPI, but since SPI offers faster communication , we decided to go with it.
  • UART (Universal Asynchronous Receiver/Transmitter): HC-08 bluetooth module , which will be used for logging functions on UART transmission protocol.

ADC

  • SFH-3015-FA (IR receiver) gives analog signals, so it requires ADC module to read the readings. So we require 4 ADC channels for reading IR sensors
  • To measure voltage level of battery one ADC channel will be required

So overall 5 ADC channels are required.

PWM

  • DRV8833 (Dual H-bridge Motor Driver) requires 4 PWM channel.
  • To control the brightness of 4 SFH-4045N (IR emitter) we need 4 more PWM channels
  • To generate noise in the buzzer we will need 1 more PWM channel.

So in overall we will require 9 PWM channels.

GPIO

  • 2 GPIOs are required for 2 LEDs
  • 1 GPIOs are required for 1 Button

so In overall 3 GPIO pins are used for getting input and output.

How To Use The Firmware

Install gcc-arm-none-eabi compiler tool suite

  • For Linux

text
sudo apt-get update
sudo apt-get install -y gcc-arm-none-eabi
  • For MacOS

text
brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc

Install ST-Link Toolchain

  • ST-Link toolchain is required for flashing on STM32 chip.

  • For Linux

text
sudo apt-get update
sudo apt-get -y install stlink-tools
  • For MacOS

text
brew install stlink

Build the source code

  • Clone the reponsitory and change the directory to firmware

text
git clone https://github.com/gautam-dev-maker/mushak.git
cd mushak/firmware
  • Build using make tool

text
make -j4  # based on no. of logical cores available in your system

Flash on the STM32 device

text
make flash  # Currently only st-link support is added

Resources

Acknowledgements

  • SRA VJTI for providing us with required resources and support.
  • Ryotaro Onuki for helping with all the designs and technical aspect of micromouse. His willingness to share his experience and answering our question has led to the start of the project.

License

The License Used for this Project.

Parts

117
QtyValueFootprintReferences
140.1uFCapacitor_SMD:C_0402_1005MetricC3, C4, C5, C7, C9, C10, C14, C16, C24, C30, C32, C33, C40, C41
114.7kResistor_SMD:R_0402_1005MetricR2, R3, R5, R8, R9, R10, R14, R15, R25, R32, R33
1010kResistor_SMD:R_0402_1005MetricR6, R11, R13, R16, R17, R18, R19, R20, R22, R26
61uFCapacitor_SMD:C_0603_1608MetricC6, C12, C19, C34, C37, C38
510uFCapacitor_SMD:C_0603_1608MetricC8, C18, C22, C23, C28
5DMN3065LW-7Package_TO_SOT_SMD:SOT-323_SC-70Q1, Q2, Q3, Q4, Q5
4100Resistor_SMD:R_0603_1608MetricR7, R12, R23, R24
4SFH_3015_FASFH_3015_FA:XDCR_SFH_3015_FAA1, A2, A3, A4
4SFH_4045NSFH_4045N:LED_SFH_4045ND2, D3, D4, D5
30.01uFCapacitor_SMD:C_0402_1005MetricC17, C26, C31
32.2uFCapacitor_SMD:C_0603_1608MetricC1, C2, C27
3IR_1mushak_mount_footprint:IR_SLAVE_V_04J6, J7, J9
212pFCapacitor_SMD:C_0402_1005MetricC20, C21
220pFCapacitor_SMD:C_0402_1005MetricC11, C15
2220Resistor_SMD:R_0603_1608MetricR4, R21
2AS5048B-HTSPAS5048B-HTSP:SOP65P640X120-14NU2, U7
2LEDLED_SMD:LED_0402_1005MetricD1, D6
2SW_PushTL1015AF160QG:SW_TL1015AF160QGSW1, SW2
2motormushak_mount_footprint:motorM1, M2
110Resistor_SMD:R_0603_1608MetricR1
1120RInductor_SMD:L_0805_2012MetricFB1
1150Resistor_SMD:R_0402_1005MetricR31
122uFCapacitor_SMD:C_0603_1608MetricC13
125MhzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
132.769kHzABS07-32:XTAL_ABS07-32.768KHZ-TY2
14.7uFCapacitor_SMD:C_0603_1608MetricC29
1AMS1117-3.3AMS1117-3:SOT229P700X180-4NU1
1AS5600_1mushak_mount_footprint:STAND_HOST_04J11
1AS5600_2mushak_mount_footprint:STAND_HOST_04J13
1AS5600_Leftmushak_mount_footprint:STAND_SLAVE_04J4
1AS5600_Rightmushak_mount_footprint:STAND_SLAVE_04J5
1BLE_ConnConnector_JST:JST_SH_BM04B-SRSS-TB_1x04-1MP_P1.00mm_VerticalJ3
1BuzzerSMT-0440-T-R:XDCR_SMT-0440-T-RBZ1
1Conn_01x02_FemaleConnector_JST:JST_EH_B2B-EH-A_1x02_P2.50mm_VerticalJ2
1Conn_01x04_MaleConnector_JST:JST_SH_BM04B-SRSS-TB_1x04-1MP_P1.00mm_VerticalJ1
1DRV8833PWPRDRV8833PWPR:IC_DRV8833PWPRU3
1IR_1mushak_mount_footprint:IR_HOST_V_04J10
1IR_2mushak_mount_footprint:IR_HOST_V_04J12
1IR_2mushak_mount_footprint:IR_SLAVE_V_04J8
1IR_3mushak_mount_footprint:IR_HOST_V_04J14
1IR_4mushak_mount_footprint:IR_HOST_V_04J16
1LOGOmushak_mount_footprint:vjti_logoG***
1LOGOmushak_mount_footprint:mooshak_smallG***
1LOGOmushak_mount_footprint:SRA_logoG***
1LOGOmushak_mount_footprint:mooshakG***
1MPU-6500MPU-6500:QFN40P300X300X95-25NU5
1STM32F405RGTxPackage_QFP:LQFP-64_10x10mm_P0.5mmU6
1ToFmushak_mount_footprint:STAND_SLAVE_04J17
1ToFmushak_mount_footprint:STAND_HOST_04J15
1VL53L0CXV0DH/1VL53L0CXV0DH_1:XDCR_VL53L0CXV0DH_1U4

Questions

How big is the Mushak pcb PCB?

It measures 57.6 × 40 mm and has 2 copper layers, 0.6 mm thick.

What parts does the Mushak pcb use?

117 parts, built around the AS5048B-HTSP, DRV8833PWPR, VL53L0CXV0DH/1 and AMS1117-3.3. 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 Mushak pcb KiCad files?

From the gautam-dev-maker/mushak repository on GitHub, at the commit this page was made from: the board is pcb_design/mushak_pcb.kicad_pcb and its schematic pcb_design/AS5048_left.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Mushak pcb 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

  • 2 layers40.5 × 38.8 mmKERISE, the printed circuit board in 3D

    KERISE

    kerikun11/micromouse-kerise-v5

    MicroMouse KERISE v5

    91 parts15
  • 2 layers40 × 44 mmKERISE, the printed circuit board in 3D

    KERISE

    kerikun11/micromouse-kerise-v4

    MicroMouse KERISE v4

    105 parts11
  • 4 layers99.2 × 98.9 mmMicromouse kicad, the printed circuit board in 3D

    Micromouse kicad

    tadzio8425/Micromouse

    Micromouse developed by the IEEE Robotics and Automation Society chapter of the Universidad de Los Andes, Bogotá (2023-2024).

    102 partsMIT
  • 2 layers13.5 × 15.7 mmMagnetic Encoder, the printed circuit board in 3D

    Magnetic Encoder

    P1nkman9/High_DoF_Robotics_End-Effector_for_Industrial_Application

    UCL_Final_Year_Project

    6 parts
  • 2 layers31 × 28 mmAs5048b, the printed circuit board in 3D

    As5048b

    matthieuvigne/MiAM_robotics

    Generic repo for robotic projects with the former MiAM Eurobot team !

    16 parts5GPL-3.0
  • 2 layers42.5 × 50 mmL0004-Photogate, the printed circuit board in 3D

    L0004-Photogate

    cacost12/SDR-Photogate-PCB

    Current PCB Revision: 1.0 PCB Part Number: L0004

    15 parts1
  • 2 layers32 × 61.5 mmFM3 mainboard, the printed circuit board in 3D

    FM3 mainboard

    asterics/FLipMouse

    The repository for FLipMouse (Finger and LipMouse)

    54 parts44
  • 2 layers81 × 55 mmFABI schematic, the printed circuit board in 3D

    FABI schematic

    asterics/FABI

    The repository for FABI (Flexible Assistive Button Interface)

    80 parts22