In my previous posts, I have discussed the basics of robotics, and how to choose the right sensors and actuators for your robot. In this post, I will discuss, how to choose the right brain for your robot.
1. The ‘Brain’ of the robot.
Just recollecting the concepts I have discussed in the last post about ‘Brain’ or the ‘Think’ section of the robot.
The ‘brain’ of the robot is connected with different sensors and actuators of the robot. The sensors are the input to the brain and the output of the robot is executed using actuators. The brain of the robot is responsible for reading the data from sensors, perform different computations on the sensor data, and make a decision based on the data. The decisions made by the robot brain can be executed using different actuators
So I hope you understand that the brain of the robot is some kind of computational device. You may be aware of different computation devices. In the upcoming section, we can see details of different computation devices, and see in which robot that you can use those devices.
A microcontroller is a microcomputer, integrated into a single chip that will have a microprocessor (C.P.U), RAM, ROM, etc. You can write a program in a microcontroller. The microcontroller will execute the program whenever the controller turns ON.
Here is an example of microcontroller from Atmel/Microchip.
Similar to your laptop/mobile specifications, the microcontroller also has specifications. We can discuss the above microcontroller specification after going through the important specifications of a microcontroller.
1.2 Specifications of a microcontroller
- Size of data bus: According to the data bus size of the microcontroller, the controllers are categorized as 8-bit, 16-bit, 32-bit, 64-bit, etc. For example, the CPU inside an 8-bit microcontroller can process 8-bit of data at a time. The more the data bus size, the better will be the precision.
- Maximum Clock Frequency: This is the maximum speed of the CPU inside the microcontroller. The more the speed value is, the better will be the controller. The unit of the speed of the controller is commonly mentioned using MegaHertz (MHz). Commonly, the speed of microcontrollers ranges from 8MHz – Up to 700MHz.
- Program Memory Size/Flash memory: This is the storage capacity of the microcontroller to store a program. If the controller is having more space, you can store big programs. Normally sizes of storage are expressed in KiloBytes. Normally, the range of flash memory is from 4k bytes to 2M byte.
- Size of RAM: This is the size of the RAM inside the microcontroller. The range of RAM size will be from 1k to 1M Bytes.
- Number of I/O pins: The pins in a microcontroller can be configured for different purposes. One of the main purposes of pins is to act as an Input/Output pin meaning the controller can detect whether the pin received a digital pulse (HIGH/LOW) or not. It can also act as output meaning you can set the voltage of the pin to LOW or HIGH. Normally we can use most of the pins of the microcontroller as I/O pins. If you go through the datasheet of each microcontroller, you can find this specification.
- Operating Voltage: Most of the microcontroller can only accept a range of voltage as a power supply. The voltage less or above the operating voltage can damage the controller.
- Interface type: These are the different communication protocols that you can use to interface the microcontroller to other peripherals. Some of the popular communication protocols are I2C, SPI, USART.
- Mounting Style: There are different ways of mounting microcontrollers in the PCB. The DIP and SMD are commonly available mounting packages. The DIP is a rectangular package mounted on a socket in the PCB whereas the SMD package can directly mount on PCB.
Let’s have a look at the specifications of two microcontrollers mentioned in Fig (b).
1.2.1 Specification of ATMega 328P & ATMega 32A-AU microcontroller
|Specification||ATMega 328-P DIP||ATMega 32A-AU|
|Size of data bus||8-bit||8-bit|
|Maximum Clock Frequency||20 MHz||16 MHz|
|Flash Memory||32 kB||32 kB|
|RAM||2 kB||2 kB|
|Number of I/O pins||23||32|
|Operating voltage||1.8 V to 5.5 V||2.7 V to 5.5 V|
|Interface type||I2C, SPI, USART||I2C, SPI, USART|
|Download Datasheet||ATMega 328-P DIP||ATmega 32A|
1.3 Popular microcontrollers and boards used in robot
There are many manufacturers of microcontrollers that are used for different applications. Let’s see some of the popular microcontrollers and microcontroller boards in robotics.
1.3.1 Atmel & Microchip Technology:
In 2016, the popular semiconductor company, Atmel being acquired by Microchip Technology. The AVR series microcontrollers from Atmel and PIC series microcontrollers from Microchip are commonly using for robotics applications. Some of the specific series from AVR and PIC used in robotics are given below.
220.127.116.11 Atmel: One of the famous microcontroller series from Atmel is the ATMega series. This series so popular because the ATMega chips used in famous open-source microcontroller boards called Arduino boards.
The Arduino Board
The Arduino boards are very popular in D.I.Y and Robotics community. The easiness of programming of Arduino boards is one of the reasons why developers prefer Arduino for their projects.
Here is one of the popular Arduino board called Arduino UNO with ATMega 328P-DIP chip on it. You can see the pinout of the board in the following image.
Learning about Arduino boards will be very helpful while building robots. You can easily prototype your robot using this board. I am mentioning some of the free tutorials videos from YouTube to learn about Arduino programming.
Here is a series of video tutorials for Arduino board programming.
18.104.22.168 Microchip: The PIC (Programmable Intelligent Computer) microcontrollers is a family of microcontrollers from the microchip. The most commonly used PIC series for robotics are the following.
This is a famous semiconductor company from Europe, Switzerland. The STM32 is a family of 32-bit microcontrollers from ST. These are used in robot prototypes and products.
The STM32 and STM8 are also used in robot prototyping. Here are famous microcontroller boards from STM used in robots.
The STM32 discovery boards come with different series of microcontrollers of stm32. Here is the datasheet of the STM32 discovery board and here is the datasheet of one of the NUCLEO boards called NUCLEO-F401RE.
Here are some introductory video of STM32 discovery and nucleo board
The STM32 board can program using famous programming IDEs like
- Keil® MDK-ARM(a)
- IAR™ EWARM(a)
- GCC-based IDEs including free SW4STM32 from AC6
- ARM® mbed Enabled™ online
The popularity of these microcontrollers is because of the easiness of programming. This can be programmed using a variant of BASIC language.
Here are the basic stamp controller breakout, kit, and propeller breakout board mainly for educational robotics.
The basic stamp can be programmed basic stamp editor.
1.3.6 Texas Instruments:
TI is another famous semiconductor manufacturing company from the USA, which is popular for Tiva C and MSP 430 series microcontrollers. These families of microcontrollers are used in the robotic products and robot prototyping.
Here are a popular evaluation kit of Tiva C and MSP430 series microcontrollers from TI.
Here is a Free course from edx to learn about the embedded systems using Tiva C Launchpad.
You can program the Tiva C and MSP 430 boards using following software
- Code Composer Studio (CCS) Integrated Development Environment (IDE) for TM4x ARM MCUs CCSTUDIO-TM4X IDEs, configuration, compilers & debuggers
- Flash Programmer, GUI and Command Line LMFLASHPROGRAMMER Programming tools
- Stellaris® ICDI Drivers STELLARIS_ICDI_DRIVERS Drivers & libraries
- TivaWare™ for C Series (Complete) SW-TM4C Software development kits (SDK)
- Tiva™ C Series LaunchPad Evaluation Board Software SW-EK-TM4C123GXL Code examples & demos
- Energia, A customized Arduino IDE for TI microcontroller boards
1.3.2 NXP Semiconductors:
NXP is an American dutch semiconductor manufacturer that is famous for the LPC series of microcontrollers. The LPC from NXP is a family of 32-bit microcontrollers. In robotics, LPC series microcontrollers are using products and prototypes. In Fig(d), from the Roomba PCB, you can find an LPC based controller. NXP is providing solutions for vacuum clean robots.
Here are some of the evaluation boards based on the LPC series from NXP: LPCXpresso boards.
Other than LPC series, here are two other MCU series from NXP
1.3.4 Renesas Electronics:
Renesas is a Japanese semiconductor manufacturer headquartered in Tokyo. They also provide solutions in robotics such as Sensing, Control, Drive, Functional safety, etc. They also provide support to robotics software frameworks such as ROS.
You can read more about robotic solutions from Renesas from this link. The RX72M 32-bit microcontroller from Renesas is used for industrial robotics.
Here are some of the popular series of microcontroller from Renesas