Recently, the microcontroller enthusiast has been researching how to use light-emitting diodes (LEDs) to replace the dot timing method to optimize kinematics experiments. Initially, self-flashing LEDs were used, but due to the equal duration of the flashing and dimming, noticeable motion blur was produced.
To avoid motion blur, the enthusiast used the ESP32 development board to control the LED flashing, with a duty cycle of 2%. After testing, the results were very satisfactory.
The enthusiast built a series voltage divider circuit with a 220-ohm resistor and an LED on a breadboard, powered the series circuit using IO33 and GND, and wrote the source code under the guidance of Teacher Mei Xiaoxuan from Beijing Pingjie No. 1 High School to control the LED flashing.
void setup() {
pinMode(33, OUTPUT);
}
void loop() {
digitalWrite(33, HIGH);
delay(2);
digitalWrite(33, LOW);
delay(98);
}
After burning the control code onto the ESP32, the LED began to flash under the control of the ESP32, with a flashing period of 0.1 seconds.
With the phone fixed on a stand, the “light trail” mode was activated, indoor lights were turned off, and when the shutter was pressed, the breadboard was moved by hand, allowing the camera to automatically record the trajectory of the LED, achieving the same effect as the dot timing method.
If the ESP32 is powered by a battery box and the breadboard is fixed on a small cart, the variable speed motion of the cart can be studied, and the effect is expected to be excellent.
Thus, it can be seen that ultimately, the solution to the problem relies on technology.
| Maker Jiaozuo |
Henan Maker Jiaozuo is the WeChat public platform of the Jiaozuo City Maker Education Master Studio, focusing on maker education as the main research direction, sharing maker cases, explaining innovative methods, inspiring creative design, conducting scientific inquiries, organizing social surveys, guiding thesis writing, participating in maker competitions and patent applications, and discovering, cultivating, and achieving a batch of students with innovative potential.
HenanPublic Number: chuangkejiaozuo
HenanMaster Blog: http://blog.sina.com.cn/updays
Long press to recognize, follow, and share
– END –