GithubHelp home page GithubHelp logo

spezifisch / t12pensolder Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 6.0 16.3 MB

A better firmware for "Pen Solder V3" soldering irons with USB-C using Hakko T12 tips

License: GNU Affero General Public License v3.0

CMake 0.01% C 87.55% C++ 12.44%
platformio soldering-iron ssd1306 stm32 t12

t12pensolder's Introduction

Pen Solder V3 (PSV3) replacement firmware

Cheap soldering iron reverse engineering and replacement firmware.

See also the write-up on my blog.

Note that while the product is advertised as a T12 soldering iron this is just the name of its ubiquitous soldering tip (Hakko T12). So I needed a more specific name for it and chose the label on its PCB: Pen Solder V3 or short: PSV3.

Replacement Firmware

Development WIP in ./firmware.

Current state (quite usable!):

  • soldering tip temperature PID controller code works (adapted from IronOS)
  • temperature measurement synced with off time of tip switching PWM
  • all buttons work
  • voltage measurement of soldering tip temperature and VBUS (from USB-PD) work
  • display output works (it's connected to non-hardware-I2C pins, so we're bitbanging with U8g2 with custom STM32 optimizations for around 170kHz I2C clock speed)
  • standby after 60s without activity (partly implemented, just turns tip off at the moment)
  • no cold junction compensation (not available on this board)
  • no settings storage
  • resource usage: around 30/32kB flash, 1.4/4kB RAM (we're splurging a bit by including an additional font and Arduino libs)
  • supported boards: V3, V7

"Pen Solder V3" Description

Its name is: Portable T12 Electric Soldering Iron PD 65W DC 72W.

Tracing the board layout:

Which leads to this Reverse Engineered Schematic (click for PDF):

"Pen Solder V7"

To compile for V7 boards open ./firmware/platformio.ini and change the following line:

-D PENSOLDER_V=3

to

-D PENSOLDER_V=7

Thanks to @Gobracket for finding the needed change in the display's setup!

Flashing

Some test pads are labeled on the board: VSS, CLK, DAT, VDD:

Connect them to GND, SWCLK, and SWDIO from your STLink adapter respectively. Do not connect VDD. It's cleaner to supply the board in a more stable manner using an USB-C supply instead.

You can then build and flash my firmware from within VSCode using PlatformIO (just press Build/Upload).

Dumping Stock Firmware

Before flashing a custom image you should backup the stock firmware!

I used the Debian 12 package of st-tools for this:

st-flash --hot-plug read t12-f0.bin 0x8000000 32768

Hardware Details

Label on case: T12

PCB:

PEN-SOLDER V3 2023-02-02

MCU: CHIPSEA F030F6P6

$ st-info --probe 
Found 1 stlink programmers
  version:    V2J34S7
  serial:     ...
  flash:      32768 (pagesize: 1024)
  sram:       8192
  chipid:     0x0440
  descr:      F0xx

Big P-MOSFET: NCE30P30K

Small N-MOSFET driver: 72K

OpAmp: 8331CGn04

Zener: W3

SMPS: XL1509-3.3E1

USB: CH224K

"STM"32F030 Pinout

  • 1: BOOT0 -> 10k to GND
  • 4: NRST -> filtered VDD
  • 6: PA0 -> not connected here, but optionally a non-populated part could connect it to some kind of SMD part (white square with 4 pads)
  • 7: PA1 -> ADC: VIN measurement of 1/11*VBUS
  • 8: PA2 -> ADC: Temperature measurement of soldering tip's thermocouple (through amplifier)
  • 9: PA3 -> Heating enable for soldering tip
  • 10: PA4 -> Button "Minus (-)", high active (10k pull-down to GND, button pulls to VDD)
  • 11: PA5 -> Button "Plus (+)", high active
  • 12: PA6 -> I2C SCL to display (4k7 to VDD)
  • 13: PA7 -> I2C SDA to display (4k7 to VDD)
  • 14: PB1 -> Button "Set", high active
  • 17: PA9 -> looks like it's not connected to anything, used in stock firmware for display reset
  • 19: PA13/SWDIO -> SWD header/pads
  • 20: PA14/SWCLK -> SWD header/pads

CH224K USB-PD Control

CFG1,2,3 pins are not connected to anything. Floating CFG1 means it will request VBUS=20V from USB power supply. That's a bit concerning given that this means the P-MOSFET gets U_GS=20V (or more) and that's already its U_GSmax.

Too bad those pins aren't connected to the uC or we could switch to a lower USB voltage.

OpAmp

  • Used as non-inverting amplifier, 221x gain
  • Input connected to T12 soldering tip pin A (the last ring), (tip pin B (the ring between A and Earth) is connected to GND)
  • Zener diode clamps input to 3.3V max.
  • Input range should be 14.9 mV max. assuming the output is 3.3V max.

t12pensolder's People

Contributors

spezifisch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

t12pensolder's Issues

PEN-SOLDER V7 possibly not compatible.

I ordered a same style solder pen off of aliexpress and the board says v7 instead of v3 upon flashing the firmware it shows way less info than intended on the oled screen.
20240121_193527

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.