1 of 20

Unit 3 - Oscillation

Lab 3D: Driven Oscillations

UCLA Physics Department

1

University of California, Los Angeles

Department of Physics and Astronomy

​

Physics 4AL

Fall 2026

​

2 of 20

Outline of Lab 3D

  • 3D In-Lab
    • Driven oscillations overview
    • Components of the forced oscillation setup
    • Drive the ESP32 setup at various frequencies and record amplitudes
  • Reminders!
    • Final project proposal is due this Wednesday, November 4th. No late submissions will be accepted. The proposal must follow this template.
    • Unit 3 report is due Sunday, November 22nd. We will have your unit 2 reports graded soon to give everyone feedback.

​

​

​

​

UCLA Physics Department

3 of 20

Driven Oscillations

UCLA Physics Department

3

4 of 20

Driven oscillations

  • A simple harmonic system undergoes driven oscillations when we apply a periodic driving force

​

​

​

  • The force puts energy into the system at a specific frequency

​

Settling amplitude vs frequency plot (x-axis: the ratio of driving frequency to the natural frequency)

​

Amplitude vs time plot

5 of 20

Driven Oscillations

  • Driving frequency = its natural frequency is called resonance

​

  • During resonance the system will oscillate at large amplitudes compared to the amplitude of the driving system

​

  • At frequencies higher and lower than resonance, the amplitude drops

​

  • Notice that it takes about a minute for the system to reach a “settling amplitude”

6 of 20

Driven Oscillations Near Resonance

  • When the driving frequency is very close to the resonant frequency, the system will still oscillate near the driving frequency

​

  • However, the amplitude of these oscillations will change slowly in a sinusoidal pattern with time

​

  • We want to find the maximum amplitude of these oscillations as a function of the driving frequency

max. amplitude = (16 cm - 14 cm) / 2 = 1 cm

7 of 20

Driven Oscillations Objective

  • An external driver will add a periodic force to the circuit.
  • Use the desktop to control the frequency of the driver
  • The forces on the mass
    • Force of spring
    • Damping force from air resistance
    • External periodic force
  • Use your ESP32 to measure your system’s position with respect to time.
    • The amplitude of the resulting oscillatory data is your system’s amplitude for that particular driving frequency.

8 of 20

Calculating the resonance frequency

  • You are using a new spring for this lab. The spring constant is k = 3.4 N/m
  • Calculate what you expect your natural frequency should be using:

​

​

​

  • Since we assume this system has no damping, we can assume that the natural frequency and resonant frequency are identical:

​

  • The system will resonate when we drive it at its resonant frequency, or:

​

​

​

​

​

​

​

​

​

9 of 20

Experimental Setup

UCLA Physics Department

9

10 of 20

Setup - ESP32

  • Only one board needed
  • Wire up the ultrasonic sensor + accelerometer
  • Use this Arduino code (from 2D)
    • This is the ONLY code you need to upload. It handles both bluetooth and the ultrasonic sensor simultaneously.
  • Insert your setup into the provided frame
  • Make sure your frame has 4 total cutouts on the top and bottom walls

SCL 22

SDA 21

11 of 20

Setup - Air Track

  • Angle the air track using the wooden block provided
  • Orient the long edge of the block such that the air track is lifted as high as possible under the single leg
  • Attach the ESP32 + Frame to the air track cart
  • DO NOT move the velcro-strapped block on the air track.
  • Place the cart on the tall end of the air track
  • Turn on the air source to maximum power
  • Adjust the back legs to make sure the air track is balanced
  • Clear any wires out from under the track
  • Tape a large reflective surface to the velcro-strapped block for best results

12 of 20

Setup - Mechanical driver

  • The mechanical driver will apply the periodic driving force to our system
  • Fasten the driver to the ring stand so its alligator clip is just above the air track
  • Clip the spring to your air track with the alligator clips
  • Plug the driver into the interface as shown here

13 of 20

Setup - PASCO Interface

  • The PASCO interface sends a signal to drive the mechanical driver
  • We can use it to monitor the performance of the driver, measuring the output current and voltage
  • Open the Capstone file “4AL_Unit3D_Oscillations.cap” on your desktop
  • Here you can adjust the driving frequency of your driver
    • Do not go past 1 Hz!
    • Remember your units are Hz, not rad/s!
  • Do not change the voltage amplitude setting. Going above 1.9 V will damage the driver

​

​

Driving Amplitude too high – Output signal appears as a sinusoid with truncated peaks!

​

​

Driving amplitude is good! Sinusoid reaches clear peak

14 of 20

Balancing the ESP32

  • The ESP32 setup is both heavy and imbalanced, making it difficult to get a smooth oscillation without friction.
  • Too much friction will damp out the oscillation before it can resonate!
  • To fix this, we must make sure the ESP32 is perfectly balanced
  • First, before attaching the frame to the air cart, balance the battery on the top of the frame on your desk
  • When you’re happy with the balance, you can add it to the air cart

The ESP32 is imbalanced in the frame! It won’t stand up straight on a flat surface

​

​

​

​

​

​

​

By placing the battery on the top and on the opposite side of the ESP32 module, the frame is now balanced!

15 of 20

Balancing the ESP32

  • The ESP32 also must be toward the center of the cart!

Too Far Forward

Just right!

Too Far Backward

16 of 20

Data Collection

UCLA Physics Department

16

17 of 20

Running the driver with PASCO

  1. Select “Signal Generator”

2) Enter your desired driving frequency 3

3) When you’re ready, press “record” to turn on the mechanical driver 3

*Leave the Waveform, Amplitude, and Voltage Limit Settings untouched*

4) After collecting ~1 minute of data on your ESP32, export it to a .txt file, press “stop”, and then “Delete last run”3

18 of 20

Data Collection

  • Collect 5 datasets in total
    • 1 dataset around your theoretical resonance frequency
    • 1 dataset ~0.01 Hz below your driving frequency
    • 1 dataset ~0.03 Hz below your driving frequency
    • 1 dataset ~0.01 Hz above the driving frequency
    • 1 dataset ~0.03 Hz above the driving frequency
  • Each dataset should be around ~2 minute in length
    • This ensures you adequately capture the settling amplitude

​

19 of 20

Data Collection - Amplitude vs. Frequency

  • Record: The settling amplitudes and driving frequencies above and below the natural frequency
  • Record data for >= 2 driving frequencies on either side of resonance for >= 5 total data points (2 per side + 1 for resonance)
  • Scatter plot - Settling amplitude vs. frequency
  • The x-axis of this scatter plot is the ratio of driving frequency to the natural frequency.

20 of 20

Post-Lab Requirements for lab 3D

  • Plot 1: Your ultrasonic sensor distance vs. time at or near to the resonant frequency of your system.
  • State the resonant angular frequency of your system
  • Make sure to collect at least 5 data points, 1 at resonance, then go 10, and 20 ms above and below resonance.

​

  • Plot 2: A scatter plot of settling amplitude vs. the ratio between the driving frequency and the natural frequency of the system. This should include >= 5 data points (>= 2 below resonance, >= 2 above resonance, 1 at resonance). Use both plt.scatter and plt.plot to generate this plot