-
Assembled PCBs and wrote prototype firmware
01/16/2026 at 02:02 • 0 commentsI 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:- 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).
- 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).
- 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
01/11/2026 at 15:26 • 0 commentsI 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
01/11/2026 at 15:20 • 0 commentsUploaded my files to this site under the "Files" section
-
Testing the concept with Arduino
01/07/2026 at 00:49 • 0 commentsI 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.
![]()
Zachary Murtishi
The ATmega328P program works like this:
