Tinkercad Pid Control //free\\ -

Project: PID Temperature Control Simulation in Tinkercad

Goal: Build and simulate a simple PID-controlled temperature system in Tinkercad (Arduino + heater + temperature sensor) and demonstrate tuning and behavior (P, PI, PID).

Step 3: Simulate and Tune

This is where Tinkercad shines. Run the simulation and open the Serial Monitor. Change the setpoint pot—watch the motor struggle. tinkercad pid control

  • If ( K_p = 5, K_i = 0, K_d = 0 ): The motor will try to move toward the setpoint, but it will overshoot wildly and oscillate forever. There will be a permanent error (offset) when a load is applied.
  • Add integral (( K_i = 0.5 )): The steady-state error disappears, but now you may see "integral windup"—the motor overshoots, reverses, overshoots again. The system slowly settles.
  • Add derivative (( K_d = 0.8 )): The overshoot reduces dramatically. The motor moves quickly to the new position and stops with minimal ringing.

In Tinkercad, you can adjust the gains live by adding potentiometers to analog pins and reading them in the loop. This creates a real-time tuning interface—turn a knob and watch the response change instantly. If ( K_p = 5, K_i = 0,

Part 5: Advanced Modifications for Your Tinkercad PID

Once you have the basic temperature controller working, try these upgrades: In Tinkercad, you can adjust the gains live

Parts & wiring

  • Arduino Uno
  • NTC thermistor (10k) wired as a voltage divider to A0 (10k pull-down to ground)
  • N-channel MOSFET (e.g., IRLZ44) or NPN transistor to drive a heater (or a 5–12V lamp/LED strip) from a separate supply; MOSFET gate to Arduino digital PWM pin D5, source to GND, drain to negative of heater; heater positive to +9V supply.
  • 10k resistor from thermistor to +5V (voltage divider: +5V → 10k → A0 → thermistor → GND).
  • Small breadboard wiring and common grounds.

Code Modification

The PID output (0-255) goes directly to analogWrite(heaterPin, output). The setpoint is a fixed value (e.g., 400 from the thermistor divider, which corresponds to ~40°C).

Tuning insight: Thermal systems have large inertia. You will need a small ( K_p ), a very small ( K_i ) (to avoid windup), and possibly ( K_d = 0 ). Watch the Serial Plotter in Tinkercad to see the temperature rise smoothly to the setpoint without overshooting.