Basics: How Do I Choose a Microcontroller?

Where to Start

For a beginner, choosing the right microcontroller may seem like a daunting task, especially considering the range of products, specifications and potential applications. There are many different microcontroller boards available on the market: Arduino; BasicATOM; BasicX; Blueroomelectronics; POB Technology; Parallax. Pololu; Miscellaneous (Robotics Connection, New Micros, Rogue Robotics) and many more. Unless you plan to control your custom robot using a tether or controlled via R/C signals, you will need a microcontroller. Note that we use the term “microcontroller” to refer to a complete breakout board with onboard chip. When considering the right microcontroller, ask yourself the following questions:

Q: Which programming languages do I know, or which would I like to know?

The lowest cost microcontrollers are currently PICs (Programmable Interface Controllers), though are not necessarily the easiest to program or use. More user-friendly intermediate programs are available for microprocessors and are often written in C, Basic or other user-friendly variations and PCBs added to make PICs easier to use and interface with. If you do not have an idea which programming language you would like to learn, consider choosing a microcontroller with a large user community and existing free libraries.

Q: Do I want just the chip or a starter board?

Most companies sell both a microprocessor as well as a corresponding starter board. There are many advantages to a starter board: they usually include power regulation, easy computer connection (via USB or Serial), provide some protection against faulty wiring and have many useful connections (such as a solder-less breadboard). A chip alone will need extra components in order to be programmed and powered. Some add-on boards offer significant versatility: some come with motor controllers, sensor boards, LCD displays and more.

Q: What extra features are included on the microcontroller?

At a minimum, most microcontrollers are capable of digital input and output. Some (though not all) have built-in A/D converters which allow direct interface with analog devices. Another useful feature offered on some microcontrollers is a regulated voltage output pin (usually 5V); the Arduino microcontrollers offer both a 5V and 3.3V output pin.

Q: How many pins will I need?

The number of free pins decides how many different devices you can connect to the microcontroller. There are two basic pin types: digital input/output (I/O) and analog input/output (I/O). Other pin types include transmit/receive (Tx/Rx), Power and ground (GND). A beginner should consider allocating one pin to each function below:

  • on average, one digital pin per digital sensor*
  • one analog pin per analog sensor
  • one digital pin per motor (connected via a motor controller)*
  • one digital pin for Tx (transmitting data)
  • one digital pin for Rx (receiving data)
  • some sensors and motor controllers my require multiple pins, or allow you to operate several devices using only one pin.

Some microcontrollers do not have any analog I/O pins, so you must buy an additional analog to digital converter. A digital pin allows your microcontroller to communicate with other digital devices (as well as other microcontrollers) and must follow specific communication protocol as defined in the product’s user manual.

Digital example
:

The SSC-32 servo motor controller requires a digital signal with the following format: “#4P1250S200” which it interprets to be servo number 4 (the SSC-32 can control up to 32 different servos), pulse 1250 milliseconds and speed of 200. Any other format would not be accepted and the SSC-32 would do nothing.

Digital Communication

Analog example:

A potentiometer is an analog device – the reading, which is taken from the center pin, is proportional to the angular position of the shaft (and is also proportional to the input voltage). If a user connects the potentiometer to a 5V supply and turns the shaft, the output (which will be between 0 and 5V) will correspond to fully clockwise / fully counter clockwise positions (usually 0 to 300 degrees of rotation). The A/D converter interprets the voltage and converts it to a numeric value (For example, 0 remains 0, 2.5V becomes 512, 5V becomes 1024 or similar depending on the number of bits: 8, 10 or 12).

Analog to digital

 
This is a companion discussion topic for the original entry at https://community.robotshop.com/tutorials/show/basics-how-do-i-choose-a-microcontroller

Hi,
i am new to micro controllers.How do we can decide which micro controller will suite for my requirements.
for ex: i want to do led On/off by controlling micro controller in this case which micro controller do i need to use?
please help me.
if possible please suggest me some links or notes to understand micro controllers.

For standard On/Off at low current, almost any microcontroller would work. We are not aware of any specific resources aside from this general tutorial which helps you select the ideal microcontroller. If you are new to programming, we suggest trying Arduino.

If you need to ask what microcontroller is best for you, odds are that it won’t matter. By the time you need high-level features, you’ll know what you need very well. For example, to make an audio synthesizer, you’ll quickly realize that having a large RAM can really help to store waveforms and extra channels take more speed. Some microcontrollers have audio-related features to counter these disadvantages.

As I say, if ‘which is best’ is your question, it’s very likely that they all are. If ‘which supports x, y, z and can run n operations per second’ is your question, it’s a lot easier to answer.

For a simple purpose of controlling a LED any micro controller is suitable for you.But if you are new to the field of micro controller I suggest you to take Arduino UNO. It is easy to learn and lot of examples and help can be found on Arduino Playground website

Hi - I am fairly new to MCU’s, although I have a quite a bit of experience with arduino.
Which microcontroller will be good to use with; Touch OLED+GYRO+IR LED and Receiver.
I will prefer one with pre-written libraries. I hope to use the MPU6050 as my gyro.
Thanks in advance.

@Nav An Arduino UNO Board could be a good choice. You can find a lot of sample codes, tutorials and libraries to help you get started. FYI, we offer this MPU6050 6 DOF Gyro Accelerometer IMU

Hi Coleman! I want to control a 6 DOF robotic arm, and also i have to do image processing to detect the objects, which microcontroller would be the best? what about rasberry pi 3 ? Will Arduino work for this as its processing speed is slow ?

@Sami For very simple objects, you can try the CMUCam (works with Arduino), otherwise you’ll need a full PC (Raspberry Pi 3 is fine) with a webcam and quite a lot of programming. An Arduino on its own is really unusable for video processing.

Task to perform:
I just want to detect objects of different lenghts lying on the table, pick them up and place at desired locations. For this I will need to find centroids and orientation of the objects, The camera will assign frame to each object which will specify its centroid and orientation, In this way i will get the location of the object, after that inverse kinematics will be solved to find the required joint angles to reach the detected object, those angles will be given to motors, The objects of different lengths has to be picked and placed in their respective boxes. The location of these boxes is predefined.

  1. Will Arduino work for above task properly?
  2. Is Arduino better or Rasberry Pi 3?
  3. Can I use C or C-based language for programming in Rasberry Pi 3?
    Note: I have Already used Arduino many times, It is easy for me to use. I have never used Rasberry Pi 3.

@Sami The CMUCam might be useful if you really want an Arduino (basic vision processing), otherwise you need at minimum a Raspberry Pi, if not a full PC for proper vision processing. Consider OpenCV.

What micro-controller would I use if I wanted to make a humanoid robot that mimicked what I do exactly how I do it?

@Night_Bird Unfortunately we cannot provide a step by step. The microcontroller does not need to be overly complex and just needs to receive the position commands for each motor. The more difficult part will be obtaining your body motions / positions. This can be done physically using a feedback system, or using something non-contact like a Microsoft. Kinect. A basic project: https://www.youtube.com/watch?v=F-5-ymKTiMU

hi ,
actually i am new in automation field that i would like to ask that i have problem to choose the motor for the six axis robot ARM , IF ITS POSSIBLE TO GIVE VALUABLE ADVICE FOR THIS THING HOPE ITS CAN BE BETTER KNOW.

@andy sarwade If you are considering creating an industrial robot, most use geared industrial servo motors; these operate at higher voltages, efficiencies and accuracy. They also tend to be quite expensive. If you only want professional (which normally cannot be operated 24/7), consider the Dynamixel Pro line: https://www.robotshop.com/en/dynamixel-smart-servo-motors.html

Hi, I want my robot to move around the house and when it detects an object stop and make a sound, which microcontroller should I use? Thank you.

@zubi You can use the Lynxmotion BotBoarduino Robot Controller. It has an on-board buzzer.

3 posts were split to a new topic: Microcontroller for Controlling Servos