Week 1 :
Microcontroller Boards
Electronics and Controls
June 2025
1 Introduction
This document contains resources to learn about microcontroller boards. It is
recommended that this document be read sequentially for optimal understand-
ing.
2 Resources
2.1 Arduino Uno by Arduino
To complete the assignment on Tinkercad (details to follow), anyone attempt-
ing it must understand the Arduino Uno’s hardware and basic programming.
Although the rover does not use an Arduino Uno, this understanding serves as
a foundation for working with other microcontroller boards, as they all share
similar basic functionalities.
The videos at the following links will help you understand the types of pins
on the Arduino Uno and their functions. Although the video is long, it is well
worth the time and effort. Feel free to speed up the videos at your convenience
(2x recommended).
• What is Arduino? - Arduino Tutorial for Beginners 1, by Robotics Back-
end
• Arduino Uno - Pins Overview, by Robotics Backend
2.2 ESP32 by Espressif Systems
The microcontroller board we use currently on the rover is the ESP32. The
ESP32 offers more input and output pins than the Arduino Uno, with each pin
1
supporting additional functions. However, the core functions of the pins remain
the same—each pin on the ESP32 simply does more. Therefore, you won’t need
to learn much more to complete the ESP32-related assignments on Wokwi.
The website linked below provides all the essential information about the
ESP32 needed to complete the assignments—and more. Use it as your primary
reference, and be sure to correlate the pin numbers in the diagram with the
ESP32 board used on Wokwi. Tip: Pay close attention to the pinout images.
• The Ultimate Guide to the ESP32 Pinout, by StudioPieters
2.3 Programming on Arduino IDE
Regardless of which of the two microcontrollers you use, it is essential to know
how to program them to perform specific tasks. While the ESP32 can be
programmed using the ESP-IDF, its compatibility with Arduino programming
makes learning Arduino a more versatile option—especially since the assignment
involves using both microcontrollers.
You can refer to the links below, to learn how to program on Arduino IDE.
The text and videos cover similar content, so you can choose either one based on
your preference. You may also refer to the example codes provided on the site
under the Text section. (Note: Since you’ve learned C programming in your
first year, much of the content in these videos may seem basic. However, the
course is designed with the assumption that you’re starting from scratch—so
feel free to just skim through sections that seem familiar or ”easy”)
Text:
• Arduino Tutorial, by Tutorialspoint (read till I/O Funtions)
Videos:
• Arduino Control Flow, by SparkFun Electronics
• Arduino Programming Syntax, by SparkFun Electronics
• Arduino Data Types, Literals, and Variables — Adventures in Science, by
SparkFun Electronics
• Arduino Arithmetic Operators, by SparkFun Electronics
• Arduino Code: Conditional Statements, by SparkFun Electronics
• Arduino Programming: Logical Operators, by SparkFun Electronics
• Adventures in Science — Arduino Loops, by SparkFun Electronics
• Arduino MASTERCLASS — How to Use Arduino Libraries PART 7, by
Programming Electronics Academy
2
2.4 Serial Communication and the Serial Monitor
Serial communication is a protocol that enables data exchange between a micro-
controller board and connected peripherals. The serial monitor function in the
Arduino IDE—available in both Tinkercad and Wokwi simulations—enables
users to send input to and receive output from the microcontroller directly
through their computer. The link below explains the concept of serial commu-
nication and helps you become familiar with using the Serial Monitor.
• Tutorial 06 for Arduino: Serial Communication and Processing, by Jeremy
Blum (Skip the part on Processing)
• Serial, by Arduino Documentation (Knowing he functions might be help-
ful!)
2.5 I2C Protocol
The I2C protocol is another commonly used communication method between
a microcontroller and its connected peripherals. It also allows for establish-
ing communication between a master microcontroller and slave microcontroller.
Follow the link below to learn about the I2C protocol.
• Inter-Integrated Circuit (I2C) Protocol, by Nicholas Zambetti, Karl Söderby,
Jacob Hylén at Arduino Documentation
2.6 Wokwi and TinkerCad
We’ve mentioned Wokwi and Tinkercad earlier—but what exactly are they?
They’re online circuit simulators that let you design, code, and test microcontroller-
based projects virtually, without the need for physical hardware—making them
ideal for remote assignments you can even work on while on vacation!
Make sure you’re logged into Tinkercad and Wokwi, as this is required to at-
tempt the assignments. To get familiar with the concept of an online simulator,
start by going through Tinkercad’s in-built tutorials, linked below.
• Learning Center - Tinkercad, by Autodesk
3 Questions
3.1 Tinkercad
• Operation Mode LEDs: The rover has multiple tasks/missions to per-
form. Accordingly, we need a strip of RGB LEDs to indicate the mode in
which the rover is operating. Use 6 RGB LEDs (look it up!) arranged in a
circular manner on a breadboard, with each pattern of lights representing
a mode of operation. Take an integer as user input through the serial
monitor with each integer representing a mode - ’1’ for Science Assem-
bly Operation (Red and Green), ’2’ for Autonomous Operation (Green
3
and Blue), ’3’ for Delivery Tasks (Blue and Red) and ’4’ for Instrument
Maintenance Operation (All Red). If any other value is given as input,
assume that this was intentional and display ”Powering Off” on the serial
monitor and all the LEDs must be turned off. Control over the brightness
of the LEDs is also required. Take input via a potentiometer to control
the brightness, with the brightness updating every time an input is given
through the serial monitor.
• Binary to Octal converter using I2C protocol: Use 2 Arduino Uno
boards - one for input and the other for output. At the input, connect 3
slideswitches which are oriented such that if the switch is to the left, then
it passes 5V to the input pin and if oriented to the right, the switch passes
0V. A 5V input represents 1 while 0V represents 0. Therefore, the input
binary number ranges from 000 (0) to 111 (7). At the output Arduino
Uno, connect 8 LEDs such that if the input was - 000 the first LED glows,
001 the second LED glows,..., 111 the eighth LED glows. Note: Using
the Serial library with the Wire library might throw errors, so do not use
them together.
3.2 Wokwi
• Typing from Keypad to LCD Screen: You are making a text dis-
play. You need to take input from a keypad and display it on a LCD
16X2 using I2C protocol. Use the appropriate resources/libraries that
you would encounter when you go through the linked resources. These
are the constraints:
1. The input text can only be 16 characters long, displayed on the bot-
tom row of the LCD display. If the user tries to input more characters,
display an error message on the top row.
2. The text should be right aligned on the screen.
3. The hastag character should be used as the backspace button.
• Steering using stepper motors: We are developing a steering system
for a four-wheeled rover using a single joystick for input. Both the front
and rear wheel pairs are capable of steering (i.e., moving left and right
together). For enhanced maneuverability, we aim to independently control
the steering of the front and rear wheels. However, due to the constraint of
a single joystick, only one pair—either the front or rear—can be controlled
at a time. Design this system by using 4 stepper motors to replicate
wheels moving left and right, and a A4988 stepper motor driver for each
stepper motor. Use the analog joystick to control the wheel via signals to
the motor drivers. Important: 1. The analog joystick page has wrong
values given - replace 512 with 2048 and 1023 with 4095. 2. A step is a
low-high-low transition. 3. The attributes of an object can be modified by
editing the ‘[Link]‘ file. Don’t worry if the screen temporarily goes
4
blank—just complete your edits and everything will function correctly.
Use the ”arrows” attribute (as shown on the stepper motors page) to
represent the orientation of the wheels for better clarity. 4. Since you
will be configuring the joystick controls, you must clearly specify which
joystick movement corresponds to which type of motion. Do so by adding
comments before wherever the code starts.