I made a tiny project on Arduino Leonardo that simulates mouse and keyboard. Its job is to control my Android device using USB connection. The duration of my project was a short 30 minute but after I learnt about PROGMEM, I managed to increase it to 10 hours! But soon I got some new obstacle. One of them is that my Android Phone can only survive 3 hours without external power. The first thing I wanna try is provide external power to my phone while controlling it. So I'm wondering how can I do it.
Here's how my project works(sorry that i don't know how to draw a formal diagram):
So I made a 18650 battery box that connect two "18650" in series, providing 7.4V of power and is connected to Leonardo's vin port for power input.
Then on the same board, I connected a LED light on pin8 to notify me when a progress is done.
After that, I attached a Type A to Micro B OTG to my phone, then connect Leonardo from its Micro B to the OTG's Type A using a usb connection.
Models:
Android: ASUS A007
Arduino: Leonardo with atmel32u4
Battery: ICR,18650
My first attempt is to use a USB hub that is connected to the phone so I can charge and use Arduino. But it turns out increased the mouse movement thus making it inaccurate. So does anyone know the other way?
You can’t charge from that connection and those batteries won’t have capacity to charge the phone .
Buy a 5v power pack and break out the USB cable so you can power the phone and Leonardo ( 5v pin) from the 5v leave the usb Tx/rx connections to talk to the phone.
Led should have a series resistor. Careful you don’t destroy the phone
Thanks for your reply. And don't worry about the phone ive almost killed it by attempting to hack the battery XD
Alright, i understood, so either the arduino or 18650 won't be able to supply the 5V power and I'll have to find some alternative so that I can break out the cable and provide 5v using it (the corresponding one you said was power bank), am I right?
Actually I don't really have to use a power bank. My Arduino is already near my phone chargers thus I can use it as the power source.
And I haven't done the research yet. Are you sure that leaving the white&green lines alone, break the original red(5V),black(GND) and connect them to power source will work? I can give it a try cuz i have backups, i'm just wondering if I should conduct some research.
As for the LED, it only connected with Arduino and is not connected to the phone. I think it already come with a resister inside since there's a weird block soldiered on it.
And hey... you've gave me a new idea. Why would I use 18650 batteries instead of a direct input from charger to Arduino's 5V owo
Bruh, hold on. I remembered. I wanted to use vin(9V) because i thought my 5v from the charger is unstable, I don't think I'm experienced enough to use it and i want protection. :v