Back to Weekly Assignments

Week 4: Embedded Programming

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

Workflow

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 servo motor and what does it do? How Servo Motors work and how to control servos using Arduino.

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.

This week, I worked on using Arduino to build an auto-lifting bridge and explored how to use the ESP32.

Useful links

Arduino Code Wiring Connections

                    #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
                        }
                

Gallery

Description of image Description of image
Handmade Bridge
This is an image of the handmade bridge,servo and Arduino,when the battery turn on, the briage will auto-lifting and drop down slowlly.

Video

Week 4 Auto-lift
Auto-lifting bridge demo with Arduino and servo motor.