PCB designers today often utilize SMD components to minimize the physical size of the circuit board. The industry standard of soldering SMD components is through reflow soldering using a reflow oven. Hobbyists, however, often perform SMT soldering using a hot air gun, a hot plate, a soldering iron, or combination thereof due to cost. Reflow ovens on the market currently range from $300 CAD up to $1500 CAD, not including necessary modifications. Since reflow soldering is the most time-efficient, reliable, and safest method of SMT soldering, a Nucleo-L476RG PID reflow oven controller was designed to transform any low-cost, convectional toaster oven into a full-fledged reflow oven.
For individual module descriptions, please view the wiki.
- Clone this repository using
git clone https://github.com/timbitss/reflow-oven-controller.git
. - Install and open an STM32CubeIDE instance.
- Import the project to the current workspace by selecting File->General->Existing Projects into Workspace.
- Build the project. If no build errors exist, flash the project using the run command.
- Create a virtual environment in the project repository.
- Install the necessary packages in the new virtual environment by entering
python3 -m pip install -r requirements.txt
for Unix/macOS users orpy -m pip install -r requirements.txt
for Windows users. - Create two folders in the root directory, one for CSV files and the other for temperature plots, and update the
csv_path
andplot_path
variables in plot_temp.py to match their respective path.
Component | Qty |
---|---|
>1000 W Convection Oven1 | 1 |
Male-Female Jumper Wires | 7 |
K-Type Thermocouple | 1 |
SparkFun Thermocouple Breakout | 1 |
STM32 Nucleo-L476RG Board | 1 |
IoT Power Relay | 1 |
1 It is recommended to purchase a used toaster oven to save on costs.
Thermocouple Breakout | Nucleo-L476RG |
---|---|
GND | GND |
VCC | 3V3 |
SCK | PB10 |
SO | PC2 |
CS | PC4 |
K-Type Thermocouple | Thermocouple Breakout |
---|---|
Chromel (yellow) | + |
Alumel (red) | - |
IoT Relay | Nucleo-L476RG |
---|---|
+ | PA6 (PWM Output) |
- | GND |
Test runs should be performed before using the oven for reflow soldering. The aim is to achieve an oven temperature profile that closely matches a standard leaded or lead-free solder profile, depending on the user's application. An example of a reasonably-tuned reflow profile is shown below (P = 225, I = 0, D = 500, Tau = 1):
The PID tuning process is outlined below:
- Power the Nucleo board using a USB connected to a PC or laptop.
- Place the 'hot' end of the thermocouple inside the oven.
- Turn the oven temperature knob to its maximum bake temperature.
- Run the real-time plotting script, plot_temp.py, and let the reflow process complete.
- Tune one or more PID parameters based on the system's response using the
reflow set
CLI command (see Reflow Commands). - Repeat steps 3 and 4 until a reasonable reflow thermal profile is achieved.
Once the PID tuning process is complete, the oven is ready for reflow applications. The user should keep a record of the final PID settings, as they must be manually inputted again if the Nucleo board resets or powers off.
Users may access the CLI using a serial terminal with the serial line configured for 115200 baud rate, 8 data bits, 1 stop bit, and no parity.
To toggle logging on and off, press the Tab key.
To see the commands that are available, enter help
or ?
.
To get help on a specific command within a module, enter <module> <command> help
or <module> <command> ?
. E.g. entering log set help
produces the following message:
To view performance measures related to the UART module, enter uart pm
.
To clear performance measures related to the UART module, enter uart pm clear
.
To display log levels at the global and module scope, enter log status
.
To set a module's log level, enter log set <module tag> <level>
.
- Acceptable log levels are OFF, ERROR, WARNING, INFO, DEBUG, VERBOSE.
- This command accepts a wildcard (*) for the
<module tag>
argument.
To view relevant information about the reflow oven controller, enter reflow status
.
To start the reflow process, enter reflow start
.
- The oven temperature must be less than the reach temperature of the cooldown phase to start the reflow process, otherwise an error message is shown.
To stop the reflow process and turn PWM off at any point in time, enter reflow stop
.
To set one or more PID parameters (Kp, Ki, Kd, Tau), enter reflow set <param> <value> [param2 value2 ...]
.
- Note: PID parameters adjusted using the
reflow set
command are not saved in flash memory and are overwritten to their default values upon reset.
Safety must be a priority when using this project. Please do not leave the reflow oven unattended during the reflow process. In addition, the following safety measures are included within the software:
- The reflow process starts only when the thermocouple reads a valid temperature below the cooldown temperature (default value = 35°C).
- If the controller reads an invalid temperature at any point in the reflow process, the process shuts down and the relay is turned off.
- Users can manually turn off the reflow process by entering
reflow stop
from a serial terminal (see Reflow Commands). - The real-time plotter, plot_temp.py, will automatically transmit
reflow stop
to stop the reflow process when either the data can not be parsed or the user closes the animation window.
- Prof. Dave Marples and Timothy Woo for inspiring me with their open-source reflow controller projects (Leater and Reflowduino).
- Philip Salmony for his digital PID implementation.
- Gene Schroeder for his series on bare-metal programming.
- Dr. Miro Samek for his active object and state machine tutorials.