Giter VIP home page Giter VIP logo

dell-charger-emulator's Introduction

dell-charger-emulator

Emulator of original Dell charger using ATTINY85

Power adapter for Dell laptops contains IC to determine adapter capabilities (watts, voltage, current). If you connect an unoriginal adapter, the laptop refuses to charge the battery. This project allows to use the cheap and small microcontroller ATTINY85 for emulating the answers of the original adapter to the requests of the laptop.

You can configure adapter settings in the file eeprom-data.hex. This file contains EEPROM data in Intel Hex format. Format of Dell charger identification shown below:

Offset Length Content Description
0 4 DELL Manufacturer identifier
4 4 00AC Adapter type
8 3 045 Watts (45W)
11 3 195 Tenths of a volt (19.5V)
14 3 023 Tenths of amps (2.3A)
17 23 CN0CDF577243865Q27F2A05 Serial number
40 2 0x3D 0x94 CRC-16/ARC (LSB first)

The description may not be entirely accurate. I'll be glad if you clarify.

You can use Python utility dell-charger-data-editor.py to easily change this values.

You must flash the EEPROM data together with the program code. Later you can only re-write EEPROM.

Warning: do not mask the weak power adapter to a more powerful one. This can lead to hardware damage.

Schematic

You need ATTINY25, ATTINY45 or ATTINY85 MCU (you may need to change compiler flags in Makefile) running at 8 MHz (the internal RC-oscillator is suitable, but if desired, you can use an external crystal - adjust the fuses accordingly). The Dell power adapter connector has three pins - GND, VOUT (19V) and ID. Connect the ID to the PB2 pin of the microcontroller. Also provide 3.3V power for MCU (you can use a simple linear regulator 78L33 to make the desired voltage from 19V).

Reading and writing EEPROM

You can read and write EEPROM using dell-charger-data-editor.py (see console menu of this utility).

You need connect OneWire bus to any USB-UART adapter using simple schematic with diode:

TXD --------|<|----*-------- ID
                   |
RXD ----------------

GND ------------------------ GND

Warning: USB-UART adapter should use 3.3V or 5V logic levels. 12V levels will damage EEPROM IC.

You can read by this utility both original EEPROM and emulated by AVR. You can write only emulated EEPROM.

dell-charger-emulator's People

Contributors

kivapple avatar

Stargazers

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

Watchers

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

dell-charger-emulator's Issues

No Thorough Hardware Instructions

It would be useful to see the wiring schematic you used for this project. Perhaps you could add it to README.md?

Edit: Also, I'm confused. Does this let us also program cheap Ebay knock offs to look like "genuine" Dell chargers? Your README.md instructs the user to connect to it to the "OneWire bus", but it's not exactly clear what that means. Some clear schematics of the use cases -- both when programming the chip, and when putting it into circuit, would be useful.

Edit 2: also, would this work on an 'duino? Lots more people have 'duinos, instead of Tiny85s lying around. I'd like to try this project before my Tiny85s and dev boards arrive.

Possibility of using "arduino as ISP" to program attiny85 instead of 1wire?

My current preferred setup for attiny programming consists of a board with an arduino programmed to function as a ISP, with a couple of additional components to prevent it from resetting to bootloader. The relevant wiring is essentially this. This is a very popular type of programmer I think, since a lot of people have and know where to get arduinos.

How would I use this project with my setup to program my attiny85?

Can I use this code in Arduino Uno?

Can I use this code and upload it into arduino? I have also same problem of the Dell charger.
and another question is that, if I use Digispark ATTINY85 then How Can I upload this complete code into Digispark ATTINY85?
mini-attiny85-usb-profile-600x315

I am using this Digispark attiny85 module and It can be programmed using Arduino IDE. Please help me that how can I program your code in this attiny85 module using Arduino IDE?

UART Schematic: Pullup needed?

Hi, not sure the schematic in its current form would work:

TXD --------|<|----*-------- ID
                   |
RXD ----------------

GND ------------------------ GND

Seems TXD is at least missing a pullup on the anode (assuming the diode polarity is correct), since when you want to send, you would drive the pin low and open/close the diode:

                        VCC 
                        _|_
                       |  |
                       |__|
                        |
TXD --------|<|----*----*--- ID
                   |
RXD ----------------

GND ------------------------ GND

Outdated python script

Hi
It looks like dell-charger-data-editor.py no longer works on ubuntu 20.04.

File "dell-charger-data-editor_backup.py", line 192
print('%02x ' % byte, end='', flush=True)
^
SyntaxError: invalid syntax

Would it be easy to fix it ?

eeprom-data.hex is a bit confusing to edit

So, eeprom-data.hex isn't a binary file. I was originally confused about this -- trying to open it in a hex editor and such, before I realized it was "meta-hex" -- ASCII values encoded in hexadecimal.

This seems confusing to edit, and none of my coding tools will actually interpret the hex data into ASCII in any panels, so I can see what it says easily. E.g., where the "DELL" tag is, etc.

Now, of course, I can do all this by hand, but it doesn't seem ideal. I'm weary of making a mistake, since I could theoretically fry a motherboard that way.

Is this ASCII-encoded *.hex file a standard format? If so, what tools can I use to edit it? (PLEASE let them be FOSS tools! ๐Ÿ˜)

If not, would it be worth considering having this be a normal binary file instead of ASCII-encoded?

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.