Lesson 6: Knob Light – The Art of Brightness at Your Fingertips, Mastering Stepless Dimming!

Welcome back to “Mind+ and ESP32: A Journey of AIoT Enlightenment for Kids”!

In Lesson 5, “Light-Controlled Lamp”, we created a smart streetlight that can sense the environment and automatically light up, giving hardware its first ability to “think”.

👉 To review Lesson 5, please click: “Light-Controlled Lamp: Creating a Streetlight that Can ‘Think’, Starting the Journey of Environmental Perception”

Lesson 6: Knob Light

From the simple “on and off” to the delicate “bright and dark”, this is a leap in intelligent control. In this lesson, we will say goodbye to the black-and-white world of switches and enter the exciting realm of analog control, creating a dimmable desk lamp where the brightness smoothly changes with the knob, truly achieving “light magic at your fingertips”.

Lesson 6: Knob Light - The Art of Brightness at Your Fingertips, Mastering Stepless Dimming!Lesson 6: Knob Light - The Art of Brightness at Your Fingertips, Mastering Stepless Dimming!Lesson 6: Knob Light - The Art of Brightness at Your Fingertips, Mastering Stepless Dimming!Lesson 6: Knob Light - The Art of Brightness at Your Fingertips, Mastering Stepless Dimming!

【Task Objective】

Use a rotary potentiometer and an LED light to create a knob dimmable desk lamp:

As you rotate the knob, the brightness of the LED light changes smoothly.

Rotate clockwise, the light gets brighter (or set the change direction as per task requirements).

【Core Knowledge Points】

Analog Input: Read the analog value of the rotary potentiometer (0-4095).

Analog Output (PWM): Learn the principle of Pulse Width Modulation (PWM) to control LED brightness.

Mapping: Master the “mapping” module to convert the input range of 0-4095 to a PWM output range of 0-1023.

Serial Printing: Monitor the value changes before and after mapping in real-time to gain a deeper understanding of the data conversion process.

【Extended Challenge】

Currently, the light gets brighter when rotated clockwise. How can you modify the program to achieve the effect of “the light getting brighter when rotated counterclockwise”?

Think about what other devices in life use similar “analog control” principles? (For example: volume knobs on speakers, speed control switches on fans, etc.)

【Next Lesson Preview】

Lesson 7: Noise Meter – Making Sound Visible, Creating an Environmental Noise Monitoring Device!

We will combine a sound sensor and a four-digit display to create a measuring device that can display the environmental noise decibel value in real-time, making the invisible sound visible!

【Course Overview Roadmap (7 Major Stages)】

Basic Perception · Exploring Smart Hardware (Lessons 1-10)

Comprehensive Creation · Becoming a Little Inventor (Lessons 11-20)

Internet of Everything · Opening the Door to Remote Control (Lessons 21-30)

Mobile Platform · Creating My IoT Car (Lessons 31-40)

Web Empowerment · Building a Dedicated Smart Control Center (Lessons 41-50)

AI Enlightenment · Giving Machines a “Wise Eye” (Lessons 51-60)

Scientific Innovation Practice · Exploring the Scientific World with Technology (Lessons 61-70)

More Courses: 👇

【Ant Innovation Space Course Material Directory】 Keywords: Arduino, Air Board, ESP32, Artificial Intelligence, Internet of Things, Mind+, etc.

Say goodbye to hardware switching and high costs! This set of “ESP32 + Mind+” innovation courses (70 lessons) takes students from zero to AIoT!【Course Recommendation】 “Silk Road Smart Travel: From Historical Codes to AI Programming” – A new STEAM innovation course that blends history and technology is now online! (Mind+ Air Board K10)【Course】 Amazing Mind+ (Scratch) and Arduino Interactive Course (20 exquisite PPTs)【Highly Recommended】 40 lessons of Arduino system courses (PPT + source code) released, easily mastering smart hardware teaching with Mind+!

Leave a Comment