Close
0%
0%

Heated Sock Controller

A project I put together to make a gift I received even more useful

Similar projects worth following
This project uses an ATmega328P and a bunch of other basic/promotional extended SMD components from JLCPCB to implement a basic PWM controller to manage the temperature of a heated sock. The device is powered from a wall wart or other DC supply, which is used to power the board's electronics and the heated sock itself.

4-layer PCB design manufactured and partially assembled by JLCPCB. PCB designed with KiCad 7.0. AVR C firmware developed with MPLAB X using avr-gcc and a PICkit 5. Device is designed to be powered with a 

main.c

C firmware for the ATmega328P microcontroller, compiled using avr-gcc with -O1 optimization.

- 3.01 kB - 01/16/2026 at 02:06

Download

sockmanufacturing.zip

Manufacturing files used to fabricate the PCB

Zip Archive - 200.00 kB - 01/11/2026 at 15:19

Download

Sock Controller Schematic.pdf

Electrical schematic for the PCB

Adobe Portable Document Format - 337.80 kB - 01/11/2026 at 15:19

Preview

  • 1 × ATmega328P-AU Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 2 × AO3401A Electronic Components / Misc. Electronic Components
  • 1 × BSS138 Discrete Semiconductors / Diode-Transistor Modules
  • 1 × PJ-031D Connectors and Accessories / Power Connectors
  • 1 × PJ-202A Connectors and Accessories / Power Entry Modules, Plugs and Sockets

View all 16 components

  • Assembled PCBs and wrote prototype firmware

    Zachary Murtishi01/16/2026 at 02:02 0 comments

    I assembled the through-hole components (potentiometer, jacks, and ISP programming header) onto the PCBs and was able to write a quick program to implement the core functionality I was aiming for. A 7.5V/3.2A wall wart supplies power to the module and the heated sock that plugs into it.

    The ATmega328P program works like this:

    1. On bootup, check the input voltage through J1 (barrel jack) and verify it is between 6V and 8V using the MCU ADC. This is to prevent overheating of the sock and verify that the voltage is sufficiently high to remain above the dropout voltage of the Holtek 3.3V linear regulator. If it detects an out-of-range voltage, the MCU lights an LED and ends the program in a while(1).
    2. In the MCU's ON mode, the potentiometer's position is read by the MCU using its ADC. The 10-bit ADC reading is shifted right by 2 to divide by 4 to normalize the 10-bit value to an 8-bit number so that it can be used directly with the ATmega328P PWM module on Timer0 (an 8-bit PWM generator). The PWM module will output a square wave with a duty cycle equal to the position of the potentiometer, driving an NMOS transistor which in turn drives a PMOS transistor to heat the sock. The heat level is indicated to the user by a three-level LED display: three LEDs on indicates high power, two medium power, and one low power (of course, this simply means PWM duty cycle >=66%, high, 66>PWM>=33% medium, PWM<=33% low).
    3. Pressing SW1 will put the MCU into OFF mode. This will switch off the PWM output by changing the output pin to an input and lighting an LED. Pressing SW1 again will put the MCU back into ON mode.

  • Received partially assembled PCBs

    Zachary Murtishi01/11/2026 at 15:26 0 comments

    I received the shipment of five partially-assembled PCBs from JLCPCB. It's a 4-layer design in a small footprint and I'm pleased with the manufacturing quality. The SMD components are all assembled, but the boards still require hand assembly of THT components (power jacks, potentiometer, and pin header). Preliminary bench testing shows that the reverse polarity protection and 3.3V linear regulator circuits function as designed. Once the final THT components are installed, I can start developing the firmware for the device

  • Uploaded schematic/manufacturing files

    Zachary Murtishi01/11/2026 at 15:20 0 comments

    Uploaded my files to this site under the "Files" section

  • Testing the concept with Arduino

    Zachary Murtishi01/07/2026 at 00:49 0 comments

    I tested the idea I had in mind using an Arduino Uno R3 feeding a ULN2003A with a PWM input to control the average power dissipated by the sock. I used a cheap switching power supply to source a 6.1V DC voltage to the sock and the USB-powered Arduino to generate the PWM inputs to the ULN2003 performing low-side switching on the sock. Why 6.1V? It won't lead to excessive current through the ULN2003A and lets me test the PWM control idea.

    I wrote a simple sketch to use parseInt() to set a variable-duty cycle waveform from a serial message from my PC i.e. sending 127 would set the PWM duty cycle to ~50%, sending 255 would set it to ~100%, and so on. I plugged my Saleae Logic 8 into the PWM output to verify that the duty cycle changed in response to my commands and used the switching supply's integrated ammeter to determine if the duty cycle would cut down on power draw.

    The socks can be modeled as a ~5 ohm power resistor, so a 6.1V voltage input would dissipate roughly ... 6.1V - 1V (Vce of ULN2003A) / 5 = 1.02A at maximum in this setup. I wired up 4 of the ULN2003A transistor arrays to be safe.

    Other than the high Vce (~1V) of the ULN2003A Darlington transistors reducing the current draw through the sock, it was a successful demonstration of the concept.

View all 4 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates