Lesson 1: Introduction to Programming and Microcontrollers

Lesson 1: Foundational Concepts – Circuits and Coding 101

Introduction


Welcome to Lesson 1 of Circuits and Coding 101! This course is designed to teach you programming and electronics from the ground up—even if you’ve never done it before. By the end of this month, you'll have a strong foundation in coding and microcontrollers.


What You'll Learn Today

  • The basics of programming and how computers understand code
  • What microcontrollers are and how they work
  • The key components in your kit
  • How to set up your development environment
  • Writing and uploading your first Arduino program


What is Programming?

Definition: Programming is the process of writing instructions for a computer or microcontroller to follow. Think of it like giving step-by-step directions to a machine.


How Computers Understand Code:

  • Code is written in human-readable languages, but computers only understand binary (1s and 0s).
  • compiler translates your code into machine-readable instructions.
  • The Arduino IDE uses a compiler to convert your code into something your microcontroller can execute.


Real-World Examples of Programming:

  • Smartphone apps
  • Smart home devices
  • Coffee machines and car navigation systems


Understanding Microcontrollers

microcontroller is a small computer on a single chip that can control various devices. This course will use:

✔ Arduino Uno – A great beginner-friendly microcontroller

✔ ESP32 – A powerful board with Wi-Fi capabilities

✔ Raspberry Pi Pico – A flexible microcontroller for embedded systems


Applications of Microcontrollers:

  • Robotics
  • Smart homes
  • Wearable technology


Exploring Your Kit Components

Here are a few key components you’ll work with:

  • Arduino Uno – The main microcontroller for this lesson
  • Breadboard – Used for prototyping circuits without soldering
  • LEDs – Help visualize the output of our programs


Setting Up Your Development Environment

  1. Install the Arduino IDE – Download it from arduino.cc
  2. Connect Your Arduino Uno – Use the provided USB cable to connect it to your computer
  3. Select the Correct Board & Port – Check the settings in the Arduino IDE


Writing Your First Program: Blink Sketch

An Arduino sketch has two main sections:

  • setup() – Runs once to initialize settings
  • loop() – Runs continuously to execute the program

Follow these steps:

  1. Open the Blink Example in the Arduino IDE.
  2. Upload it to your Arduino board.
  3. Watch the built-in LED blink on and off!


Testing Your First Circuit

Now, let’s connect an external LED to your Arduino:

  • Longer leg (anode) → Resistor → Digital pin on the Arduino
  • Shorter leg (cathode) → Ground (GND)
  • After wiring it, upload the Blink sketch again and watch your LED flash!

Circuit Diagram