Things I didn’t need to know but do now entry 548617

What I thought was going to be a quick fix turned into a project and now I know how Dell laptop PSUs work.   So if you enjoy complete overkill in what should have been a quick job then read on.

I have an old Dell D420 laptop which is primarily used for diagnosing car problems and occasionally to update arduino boards in the field.   The original battery was pretty dead when I got it so I bought an ebay replacement.   But due to my infrequent use that lasted about 3 years before it stopped charging.

A friend gave me a car laptop PSU which was not intended for a Dell but outputs 19V at 5A so would be perfect for the D420.   I got a Dell laptop plug from a dead mains PSU thanks to the nice IT people at work.

So, mate the Dell plug to the car PSU and all is good?   Nah!   That would be too easy!   Turns out the Dell PSUs have some sort of identification system and if you don’t have that you get this:

And if you go into the BIOS setup you see:


A quick bit of digging turns up some details on how the Dell PSU identification works.   Turns out they have a Dallas onewire EEPROM in the PSU which is connected to the centre pin.   Well I didn’t want to make any special PCBs as this is a freebie project so I had a look at Arduino.   As with most things someone on the internet has beaten me to it as the OneWireHub Library already has an example for faking a Dell PSU!

I have a handful of Digispark boards lying around and they are nice and small.   It has an ATTiny85 on the board as well as a 78M05 regulator so you can run them directly from voltages over 5V.

Digistump has its own addon to the Arduino IDE which allows you to program them directly.

So, load up the Dell example code, change the pin mapping to pin 0 and compile.   FAIL!   The main Arduino IDE uses GCC 4.9.1 for compiling Atmel AVR based projects.   The Digispark compiler is GCC 4.8.1 which has issues with using suffixes for user-defined literals.   This must have a workaround!

Find the file platform.txt under ‘packages\digistump\hardware\avr\1.6.7’ in your arduino IDE directory and change this line:

Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags}  -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"


Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -std=c++11 -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

The addition of -std=c++11 makes the compiler understand the suffixes for user-defined literals.   And away we go!   I selected the 90W option in the example code as this PSU is capable of 90W.

A quick 3D printed case (I should have done it in black but I like this purple and it was in the printer) and a little soldering and we get:

Hurrah!   How amazingly complex just to make a simple PSU mod for an old laptop.

A bit of superglue and all is finished.   What should have been 5 mins of soldering turned into a good hour of faf.   But now I know all the ins and outs of Dell laptop PSUs.