As part of the group assignment, we compared the programming workflows, tool-chains, and communication interfaces of several microcontroller families available in the lab. Full documentation — including side-by-side comparisons of Arduino, ESP32, and RP2040 — is on the group page:
This week, I helped Grade 2 students turn their handmade bridges into auto-lifting bridges by showing them what coding is, how programming drives a servo motor, what Arduino is, and how it works.
I was also explore what is ESP32 how powerful it is including spercifications,features power pins
1.Arduino workflow: I tested on the cirkit designer by adding the components and then make the simulation. The Servo library is included to control the Servo motor. The Servo is attached to pin D5. The setup() function initializes the Servo at 0 degrees. The loop() function gradually moves the Servo to 45 degrees and then back to 0 degrees, with a delay to control the speed of rotation.
What is Arduino? Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, The software, called the Arduino programming language, includes built-in syntax rules and a library of pre-written code that simplifies the process of creating a program. The board’s versatility allows it to be used in a wide range of applications, from simple projects to complex systems.
What is servo motor and what does it do? How Servo Motors work and how to control servos using Arduino.
servo motor is a special type of motor designed for precise control of angular position. It is an automatic device that uses a feedback system to correct its performance. Unlike a standard DC motor which just spins continuously, a servo motor can be commanded to move to a specific angle and hold that position against external forces.
2.What is ESP32? ESP32 is highly-integrated with in-built antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules.
ESP32 adds priceless functionality and versatility to your applications with minimal Printed Circuit Board (PCB) requirements. Hybrid Wi-Fi & Bluetooth Chip.
| Abbreviation | Full name | Chinese Definition | Pin(XIAO ESP32-C3) | 主要用途Applications |
|---|---|---|---|---|
| SDA | Serial Data Line | 串行数据线 | D4 (GPIO6) | I²C通信的数据线 |
| SCL | Serial Clock Line | 串行时钟线 | D5 (GPIO7) | I²C通信的时钟线 |
| MOSI | Master Out Slave In | 主出从入 | D10 (GPIO10) | SPI通信:主设备发送,从设备接收 |
| MISO | Master In Slave Out | 主入从出 | D9 (GPIO9) | SPI通信:主设备接收,从设备发送 |
| SCK | Serial Clock | 串行时钟 | D8 (GPIO8) | SPI通信的时钟线 |
| TX | Transmit | 发送 | D6 (GPIO21) | 串口(UART)数据发送 |
| RX | Receive | 接收 | D7 (GPIO20) | 串口(UART)数据接收 |
How it works:
SDA is the data line – it carries the actual data being transferred. SCL is the clock line – it synchronises the data transmission. MOSI (Master Out Slave In) – data sent from the master to the slave. MISO (Master In Slave Out) – data sent from the slave to the master. SCK (Serial Clock) – generated by the master to synchronise each bit. CS/SS (Chip Select / Slave Select) – an extra pin used to choose which slave the master wants to talk to (not listed in your original six, but essential for SPI). TX (Transmit) sends data out from the device. RX (Receive) listens for incoming data. To connect two devices, you must cross‑wire them: Device A TX → Device B RX Device A RX ← Device B TX Also connect GND to GND.This week, I worked on using Arduino to build an auto-lifting bridge and explored how to use the ESP32.
#include
Servo myServo; // Create a Servo object
void setup() {
myServo.attach(5); // Attach the Servo to pin D5
myServo.write(0); // Start at 0 degrees
delay(1000); // Wait for the servo to reach the position
}
void loop() {
// Rotate to 45 degrees slowly
for (int pos = 0; pos <= 45; pos++) {
myServo.write(pos); // Move to the position
delay(15); // Wait for the servo to reach the position
}
delay(1000); // Hold at 45 degrees for a second
// Return to 0 degrees slowly
for (int pos = 45; pos >= 0; pos--) {
myServo.write(pos); // Move to the position
delay(15); // Wait for the servo to reach the position
}
delay(1000); // Hold at 0 degrees for a second
}