The computer brains I am quite familiar with now are Arduino, STM32, and Raspberry Pi.
They are all computers, but they sit at very different levels of capability. An Arduino is typically built around an 8-bit microcontroller. An STM32 is generally a 32-bit microcontroller. A Raspberry Pi, on the other hand, uses a 64-bit application processor that is much closer to the processor inside a desktop or laptop computer.
The difference is not simply that one has more bits than another. The architecture, clock speed, memory, peripherals, operating system, and way the processor connects to memory are all very different. But looking at these three devices is a useful way to understand how computer hardware scales from a tiny embedded controller to a general-purpose computer.
A typical Arduino Uno, for example, runs at around 16 MHz and has only a few kilobytes of RAM. Its microcontroller is designed to directly interact with the physical world. It can read a sensor, set a GPIO pin, generate a PWM signal, or control a motor, all with very little software overhead.
An STM32 can be much more powerful. Depending on the particular STM32 family, the CPU may run at tens or hundreds of megahertz and have tens or hundreds of kilobytes of RAM, with a 32-bit processor architecture. It is still fundamentally a microcontroller: the CPU, memory, timers, GPIO, ADCs, communication interfaces, and other peripherals are integrated into one chip.
Then there is the Raspberry Pi. A Raspberry Pi uses a 64-bit application processor running at roughly 1.5 GHz or higher, depending on the model. It can have gigabytes of RAM connected through a high-speed memory interface. More importantly, it normally runs a full operating system such as Linux.
This changes the programming model completely.
With an Arduino or STM32, I can write a program that starts running almost immediately after the microcontroller boots. The program can directly control hardware registers and peripherals. With a Raspberry Pi, I am working with a much larger software stack: boot firmware, a Linux kernel, device drivers, processes, virtual memory, filesystems, networking, and applications.
So I now think of these devices roughly like this:
Arduino ↓Small microcontroller ↓STM32 ↓More capable microcontroller ↓Raspberry Pi ↓Application processor + Linux ↓Desktop / laptop CPU
The interesting thing is that all of them are still built from the same fundamental idea I have been studying: transistors form logic gates, logic gates form larger circuits, and those circuits form a processor. The difference is mainly how much hardware and software has been built around that fundamental processor.
There are of course many other choices in the market. ESP32 is popular when Wi-Fi and Bluetooth are needed. Raspberry Pi Pico provides a very inexpensive microcontroller platform. Microchip makes the PIC family. Texas Instruments has many microcontroller and embedded processor families. Nordic Semiconductor’s nRF52 series is popular for Bluetooth and low-power applications. SiFive provides RISC-V processor technology, and Kendryte has chips aimed at embedded AI applications.
At the other end of the spectrum are the processors used in phones and PCs. Apple Silicon, Intel Core and Xeon, and AMD Ryzen are all examples of much more powerful application processors. These processors have multiple CPU cores, sophisticated caches, memory controllers, branch prediction, out-of-order execution, and many other hardware mechanisms that are unnecessary in a small Arduino.
For my own hobby projects, I don’t need to start at the high end. In fact, starting with a microcontroller is probably more useful because it lets me see the connection between software and physical hardware directly.
If I want simple, reliable, real-time control, a Raspberry Pi Pico or a basic Arduino is enough. I can read sensors, generate PWM signals, control a servo, and drive a motor through a motor driver. The processor can respond to hardware events with very predictable timing.
If I want the device to be connected and somewhat smarter, an ESP32 is a very attractive choice. It gives me a microcontroller with Wi-Fi and Bluetooth built in, so the device can communicate with my phone, send data to a web service, or provide a small web dashboard without needing a separate computer.
If I want computer vision, voice processing, or more serious AI, then I would move up to a Raspberry Pi. It can run Linux and normal Python programs, install OpenCV and other libraries, process camera images, communicate over a network, and run software that would be impractical on a small microcontroller.
For my own experiments, I think of the system as a small robot with four basic parts.
The first is the brain. An ESP32-S3 or Raspberry Pi Pico W would be a good starting point for a connected microcontroller project. If I want a full Linux computer, I would use a Raspberry Pi.
The second is sensing. An ultrasonic HC-SR04 or a VL53L0X time-of-flight sensor can tell the robot how far an object is. A six-axis MPU-6050 IMU can provide acceleration and angular-motion information. A DHT22 or BME280 can measure environmental conditions such as temperature and humidity. A PIR sensor can detect the presence of a moving person or object.
The third is communication with the human. A small SSD1306 I2C OLED display or a 1602 LCD can show information. A piezo buzzer can produce an alert, while an addressable WS2812B LED can communicate status through light.
The fourth is actuation. A micro servo such as an SG90 can provide controlled angular movement. DC gear motors can provide continuous motion for a small vehicle. But a microcontroller cannot normally drive a motor directly from one of its GPIO pins because the motor requires much more current than the pin can safely provide. A motor driver such as a TB6612FNG sits between the microcontroller and the motor.
For something like a light, pump, or other higher-power device, a relay module can act as an electrically controlled switch.
The rest of the setup is relatively simple: a solderless breadboard, jumper wires, and an appropriate external power supply. The external power supply is especially important for motors because I don’t want the motor current flowing through the small power path intended for the microcontroller.