Overclocking a [Raspberry Pi](https://www.ampheo.com/c/raspberry-pi/raspberry-pi-boards) can boost performance, but it must be done carefully to avoid overheating, instability, or hardware damage. Here’s how to overclock it safely and effectively: ![raspberry-pi-5-overclocking](https://hackmd.io/_uploads/Hy5dBXWSxg.png) **Important Notes Before You Begin** * Overclocking voids warranty (on some models, like [Pi 4](https://www.ampheo.com/search/Pi%204)) * Use cooling: heatsink, fan, or active cooling is highly recommended * Back up your SD card before making changes **1. Determine Your Raspberry Pi Model** ![企业微信截图_20250701165650](https://hackmd.io/_uploads/HyxHk77ZBex.png) **2. Edit the config.txt File** 1. Open terminal: ``` bash sudo nano /boot/config.txt ``` 2. Scroll to the end and add or modify the following: **Example for [Raspberry Pi 4](https://www.ampheoelec.de/search/Raspberry%20Pi%204):** ``` ini over_voltage=6 # Up to 6 (raises CPU voltage) arm_freq=2000 # CPU speed in MHz gpu_freq=600 # Optional: GPU frequency ``` Higher over_voltage = more heat and power. Max safe is usually 6. Start small, then test stability. 3. Save and exit (Ctrl+X, then Y, then Enter) 4. Reboot: ``` bash sudo reboot ``` **3. Monitor Temperature and Performance** Check CPU temperature: ``` bash vcgencmd measure_temp ``` Monitor frequency and throttle status: ``` bash vcgencmd get_config arm_freq vcgencmd get_throttled ``` **4. Stress Test Stability** Install stress test tools: ``` bash sudo apt install stress stress --cpu 4 --timeout 60 ``` Watch for: * Thermal throttling (CPU slows to cool down) * Crashes or freezes **5. Add Cooling if Needed** * Attach a heatsink * Add a fan (5V or PWM-controlled) * Use a case with airflow **When NOT to Overclock** * You’re running 24/7 tasks (e.g., server, NAS) * You're using passively cooled setups * Power supply is unstable (< 5V / 2.5A) **Tip: Use raspi-config (for Pi 3 and earlier)** ``` bash sudo raspi-config ``` * Navigate to Overclock (only visible on supported models) * Choose a preset (e.g., Medium, High) **Sample Config for Raspberry Pi 3:** ``` ini arm_freq=1400 core_freq=500 sdram_freq=500 over_voltage=4 ```