It is a quarter past six on an October evening, and the street lamps along a Dhaka road come on, one after another. Nobody walks down the road flipping switches, and no clerk watches the clock. On each pole a small box has looked at the sky, decided that it is dusk, and closed a switch. Inside that box is a chip no bigger than a postage stamp, and it is a whole computer: a processor, a program, a little memory, and pins that touch the real world.
The same kind of chip sits inside your prepaid electricity meter, your rice cooker, the remote of your TV and the ABS system of a bus. Exams ask about it in a very practical way. Design an automatic street light. Which signal does a gas sensor send to the microcontroller? Explain the difference between a microprocessor and a microcontroller. What is SPI? This chapter answers each of them, step by step, from the chip upwards.
By the end you'll be able to say what is on a microcontroller chip and why one chip can replace a whole board of 8085 parts. You'll work out the TH0 and TL0 values that make an 8051 timer count 5 ms, and the baud-rate reload for its serial port. You'll read an Arduino's analog pin as a voltage, set a PWM duty cycle, and compare UART, SPI, I2C and CAN with real numbers. And you'll design the two classic exam projects, a gas-leak alarm and an automatic street light, with block diagram, connections, working logic and code that was actually compiled and run.
We go in seven parts: the idea of a microcontroller, what its pins and peripherals can do, the 8051, the AVR chip on the Arduino, the serial buses that connect chips, the two projects with their sensors and actuators, and last how to choose a chip and what is new as of November 2026.