sekyHC / Hacking-dell-charger

Arduino code for hacking dell charger
23 stars 11 forks source link

Tried the code but couldn't get it working #1

Open JHoplite opened 7 years ago

JHoplite commented 7 years ago

I have a Dell Inspiron 1501 with a 65W charger that won't work. I tried your code on a Arduino Uno running at 16MHz and using pin10 to drive the centre conductor (ground of dell charger connected to gnd of Uno). No joy in getting it working. Is it a timing issue or how is the Arduino to be connected up to the circuit for it to run? Can you give us a few more details on the schematic for a Amega 328P using this code.

JHoplite commented 7 years ago

btw the charging light lights up when plugged in for a second or two which indicates that something is happening. The centre pin looks in good condition and nothing obvious wrong with power socket either. The message is that it doesn't recognise the charger or battery (which is long fully depleted).

ghost commented 7 years ago

problem is that the atmega should be powered on the same time laptop is plugged in.. i took power for it from charger connector. You need to adapt the code to check again for reset condition.. I haven't implemented that because i didn't have need for it.. It needs timer that looks if reset condition is active and then start again on begging of loop.. You can try it like that and do pull request

ghost commented 7 years ago

And it needs to be on when charger is plugged in.. If you power it from laptop usb it is too late already.. Motherboard has already determineted that charger is not valid. I have attiny in hole where battery was connected to all 3 pins from charger via 7805. That way attiny is powered on in same moment charger is plugged in

crabdancing commented 6 years ago

@JHoplite Here is seky2205's schematic from a closed issue. It uses a 7805 (generic 5v linear voltage regulator), along with a 10uF electrolytic capacitor (which I think is for smoothing).

The 5v output of the 7805 should work fine for powering almost any arduino-type thingy, so you should be able to adapt this to your use case.

Alternatively, maybe you could hook one of the input pins into the power connection, use a lab power supply (or generic 5v switched mode power supply), and common the grounds together? (In case you don't know, voltage is relative -- if the grounds aren't commoned, then circuits will usually fail to respond to data signals generated by an external power source, because there's nothing to 'anchor' the relative electric pressure.)

Let us know what results you get!

schematic

BAelectronics commented 6 years ago

I tried the code with Arduino Nano board but unfortunately did not work. I was scheming in the schematic above, but tried it with a pull-up resistor and it did not work. What could be the problem?

crabdancing commented 6 years ago

@BAelectronics

Did you try checking everything with a multimeter to make sure everything is powered properly? There should be 5v across the 7805's GND and vOUT. Also, you should try the blink sketch just to make sure that the arduino itself is workng.

If the arduino works, and is being powered correctly, then maybe the code doesn't work for your machine. (Or maybe there's a bug somewhere.) This is, in essence, just a replay attack built around code read by one person's logic analyzer. It's not a fully reverse engineered thingy.

You might want to try using this code instead, if you can get an ATTINY85 for it. You can get them on Ebay for just a few dollars, along with a dev kit that allows it to easily be programmed by USB. This is the route I'll probably go, since that code is general purpose -- letting you change exactly what you want to about how your charger appears to the motherboard. I've already compiled it successfully, but don't have the chip to test it on yet.

Edit: the ATTINY85 needs 3.3v, so you might want to get some appropriate regulators for it, if you go down this route. Putting a resistor in series with the regulator's input should make it super efficient. You should be able to use the 3.3v linear regulators in a TO-92 package, I think -- if you include the resistor in series to limit the current through them.

Edit: Disclaimer: I am not an electrical engineer. I'm just really really nerdy. If I'm wrong about anything someone please let me know. But I think a resistor in series with a simple linear regulator input makes sense, as opposed to using a heavier TO-220 package, if your load is small.

ghost commented 6 years ago

Yea as I have said you need to have power on arduino before you plug charger in laptop. So power it from charger or if you're prototyping just use external usb power (phone charger or power bank or something). Do not power it from laptop usb, arduino boots up too late that way

BAelectronics commented 6 years ago

@seky2205 @alxpettit

I checked the wiring and voltages. 7805 input 19.5V, output 5V. As shown in the figure above, it is wired, ie I do not power on USB, just as it is in the diagram. I tried to re-flash the code several times, no problem. After switching on, flash one time the LED. I tried the connection method in many ways. For the time being I can not get ATTINY85 and Atmel programmer, only I have Arduino Nano board.

ghost commented 6 years ago

It probably needs to handle reset little differently in code. I did not bother with that because it was working with me. If you guys do this just make the pull request. Basically it needs to check for reset all the time because it can happen anytime

vanquybn commented 6 years ago

Hello!, Would you please let me know how to make it as 180W ?

crabdancing commented 5 years ago

@vanquybn Maybe you should make a new issue on the issue tracker?

crabdancing commented 5 years ago

I'd like to know how as well.