Dell power supply emulation

The original idea for this came from hacking a dell power adaptor, which I found after taking my laptop to Australia and finding the USB-C PD to dell adaptor I took with me would power my laptop, but not charge it. I ordered some 3-wire cables on e-bay and resolved to try this at some point.

I'm now in the process of building a dock for my laptop, in which I've used one of the 3-wire cables. Before that can be any use, I've got to get this working.

There's a one wire library called OneWireHub which includes a sketch specifically for emulating a dell power supply. It's easily the best example, with a clear menu of power supplies to emulate. OneWireHub can be found in the Arduino library manager.

I was going to use a Digispark clone, but the OneWireHub library doesn't compile in the Aduino IDE (or in the eclipse arduino plugin for that matter). That's because they both use an older GCC version for the ATtiny85. I suspect there's no reason for that other than no-one has bothered to update it, but I can't be bothered either, so I decided to use an Arduino Nano instead. I had one already.

For some reason I decided to design a box to hold everything next. I wanted it to contain
 - the Arduino Nano V3
 - a DC jack
 - cable outlet matching the Dell 3 wire cable I have
 - a DC-DC converter, because 19.5V is too much for the regulator in the Nano V3
 - optional on/off switch (if it doesn't make it too big)

I think I'll just cut off the ICSP connector - to reduce the clearance.

Here's a mechanical drawing of an Arduino nano v3 to base an enclosure on:
From this page, which has a bunch of other useful Arduino mechanical drawings.

I've never quite finished the box design: I had to break some bits of the print off to get the electronics to fit, and haven't gone back and updated it.

Once I'd printed a case to hold everything, I started thinking about the electronics. Specifically, I don't have a linear regulator that tolerates 20V input, which is what I need to power the Arduino. I could use a switching regulator module, but I only need a tiny amount of current. It seems like a waste. I have lots of shunt regulators and transistors, so how about this:

I still have lots of shunt regulators and transistors. This has no over-current/short-circuit protection, but it's not likely to need it.

Turns out the through hole shunt regulator I have has a maximum input of 17V. I do also have a SOT-23 regulator that has a maximum input of 35V, but at this point I can't be bothered soldering it onto a breakout. I'll save this idea for another version.

Instead I just tried a buck-boost converter I had lying around. It died in a puff of white smoke, for no reason I've yet determined. Another little buck module adjusted to 7.5 volts connected to VIN on the Arduino did the trick, however.

I belatedly realised I needed a logic level converter, so I made that on a bit of strip-board with connectors for the Aduino nano. I must have bought lots of the connectors at some point.



Then I tried to upload the sketch to the Arduino. It wouldn't even register as a USB device on my laptop. Anyway, I got it to talk to a Raspberry Pi, which I then installed the latest Arduino environment on. Uploading still doesn't work:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x73
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x61
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x6d
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x70
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x6c
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x73
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x3d
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x20
An error occurred while uploading the sketch

Turns out I need to choose Processor/ATmega328P (Old bootloader), and then it works fine.

When I plug the result into my laptop, much to my surprise, the battery charges. Success!







Popular posts from this blog

3D Printer ramblings

Balance Bot V2

Robot arm