vdeconinck / qc3control Goto Github PK
View Code? Open in Web Editor NEWThis project forked from septillion-git/qc2control
Set the voltage of a Quick Charge 3.0 source via the Arduino.
This project forked from septillion-git/qc2control
Set the voltage of a Quick Charge 3.0 source via the Arduino.
Hi,
I tried running the same rig as u have mentioned,
Im not able to figure out why Its not working for me
what I know
Can u please help me out!!
Hi first of I just wanted to say this is awesome work! Your work on this project and you've opened the door to plenty of devs to use this in their project without having to reinvent the wheel for a reusable, LiPo PSU in their projects without relying on hobby alternatives!
I was wondering, is it possible to use this with a trinket 3.3V? It seems like your data signals are going between the desired 0 - 3.3V with your resistor configuration from your blog post and your diagram. The trinket has two GPIO pins directly connected to the usb D+/D- pins that go between 0 and 3.3 V. Would this be enough to operate this library without the resistor block instead? Worst case can't we find a way to use the fact that the resistance changes on the 0.6v handshake to 20K between the pins, while using the other pins after the startup sequence is complete?
Just an interesting observation: when I use the 2 pin configuration I can change the voltage on my Samsung fastcharger, but not on my Anker battery. But once I switch back to the legacy system I can use the Anker battery. Any ideas why? It says it's a QC3 compatible battery.
Thanks to all who helped make this awesome library.
I have been attempting to use the QC3 library - I may be misunderstanding the code but it appears to require the 3rd DMlow pin within the code? For example
if (_DmLoPin == 0) return QC_ERROR_QC2_ONLY;
QCControl.cpp lines 104, 127, 168
There are other references to this value including digitalWrites to it (the 3 dm...V() functions).
With this line in-place it never gets to the QC3 parts of the code. If I use the 2 arg constructor it sets it to zero (Line 19). I haven't yet attempted a 3 pin setup. (I was wondering if this was an older version of the code compared to your video and descriptions?).
Thanks for the work you've done on this I'm keen to fire it up! I have a QC3 source that apparently goes to 20V so I can test if that helps (I remember you mentioning that you didn't have hardware)
Sorry for posting in the wrong place, I can't do anything more as it is locked
Heyy,
Cool you forked QC2Controll for QC3! Lucky I saw it at Hackaday (since I can't read all articles anymore). I would have liked a message from you and I bed Hugatry as well ๐
But I do have some notes ๐
The abbreviation "PD" is a bit confusing. In combination with USB it's commenly used as USB Power Delivery.
I made the library on the notes of Hugatry. This included the resistors I picked. It's nice to see you found an error in it for QC3 chargers. But I do have to note, the resistors I picked where compatible with both 5V and 3,3V Arduino's. So that might be a good note to mention in the differences between QC2 and QC3. And try to make QC3Controll work with 3,3V Arduino's as well (new values or a 3,3V Arduino schematic).
Inline functions should be in .h
Macros (#define) are a relic from C. C++ has nicer and saver ways of doing it. In this case, static const.
Doubles are overkill, a float will do ;) Makes no difference on ATmega's but on 32-bit is does. Even a float is a bit of a hack because floats != decimal point. But I get why you would like it to make it simple and intuitive.
There was no need to break compatibility for setVoltage() ;) There is something called function overloading ๐
I personally think the voltage ramping is more annoying then useful. If I set a voltage I want to get there as quick as possible. Do the discrete voltages really need the 60ms of waiting?
And although not every charger goes to 20V, isn't it a bit much to make this a setting? ๐
0 is a valid pin on an Arduino. Although on a lot it's a UART pin, it's not very nice to exclude it.
When I upload this code, firstly my charger has nice 5v, and then it switches to 2,5V instead of 9V. I tested this with 2 chargers, it always happen.
Tested the sketch for Pro mini 5V, it is work and great.
But when I run on Pro mini 3.3v, it's just working with some QC2 power supply.
May I know the corresponding resistor values for Arduino Pro Mini 3.3v ?
Building for Teensy causes the compilation to fail, it is strict about compiler warnings.
The fix is easy enough. Delete "QC3Control::" from line 215 of QCControl.h.
- void QC3Control::switchToContinuousMode();
+ void switchToContinuousMode();
https://github.com/vdeconinck/QC3Control/blob/master/src/QC3Control.h#L215
As requested in issue #1, work has been done to support Quick Charge "Class B" chargers, to allow voltage outputs up to 20V.
The changes with that feature are now commited. All that is required to enable Class B mode is to call "begin(true);" at startup.
To test these changes, first delete the QC3Control fodler from your sketchbook's "libraries" folder, then download the zip using QC3Control's homepage button "Clone or download", and import it in the IDE using "Sketch > Include library >Add .ZIP library..."
A new example called "classBControl" has also been added.
Please report the results here...
Not sure why but I am unable to compile code if I try and call these functions in QC3Control.cpp (See below). They are defined without 'inline' in the .h signature and are public
QC3Control.cpp v.1.3.0
L234
inline double QC3Control::getVoltage(){
L238
inline unsigned int QC3Control::getMilliVoltage(){
When I hit verify or upload:
e.g. undefined reference to `QC3Control::getMilliVoltage()'
My workaround was to delete 'inline' from the cpp file and it compiles and runs. I'm using Arduino IDE 1.8.1 on Win10 x64. From what I gather 'inline' is a bit like a #define style macro? (pre-processed?) - any specific reason to use inline? (I didn't know it existed until reading about it for this). I thought perhaps you are using a different compiler / OS.
When I googled around I found a few results like this: https://forum.arduino.cc/index.php?topic=330924.0 - but this is from ~2015.
I want to make a 12v 2S lipo charger but I need QC 2.0 for the 12V. This is for a very compact audio amplifier and I'd like to make the footprint of the AVR as small as possible. For this i'd need to know how big does a simple program ocupy in the flash memory because I'm limited to 1KB (using sot23-6 Attiny10).
Thanks!
would it be possible to set the voltage directly with the serial command?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.