Dear everyone,
I have to make an engineering project which is a portable solar phone charger. One thing I need to do in it is to somehow charge the phone (android) from the battery (which is charged by solar panels) and simultaneously send data about the battery level to the phone through the same usb connection.
Can I use arduino for it? If so, how? I know that usb has separate lines for data and power but I don’t know how to send or receive any data.
Thank you for your time, I just don’t have much experience with electronics (not even a year at college), and I must somehow do all this stuff.
The easy part is connecting +5V to the B+ wire of the USB cable. The harder part is to get data from the Arduino to the app you are writing for the Android phone.
This search should help: arduino to android phone "USB OTG" - Google Search
Pardon me for being pedantic but... I have never heard of a phone that doesn't have its own battery state indicator, on why on earth do you need to make another? It sounds like re-inventing the wheel.
Nick_Pyner:
Pardon me for being pedantic but... I have never heard of a phone that doesn't have its own battery state indicator, on why on earth do you need to make another? It sounds like re-inventing the wheel.
I suspect he want's to track the state of the solar panels and the battery in the solar charger.
Umm OK(!)
I still wonder why one would want to do that. If charging the phone merited this importance, it would be turned off. If it is essential to see data on the phone rather than on the charger, perhaps some more sensible method of sending the data might be in order. There's my bias showing, but at least that might justify using an Arduino.
Thank you John Wasser, the latter is exactly what I'm inetrested in. But unfortunately your link isn't working for me...
And Nick Pyner, what do you think would be a more sensible method of sending the data? The real reason why I'm doing it is because my techer told me that otherwise my project would be too simple and that some software element is required...
Why not an LCD display and a coulomb counter? That way you could monitor flow from solar panel to (I presume) external battery, and then monitor flow from external battery to internal battery?
That will tell you how much energy is going where, and you can do all sorts of calculations with that.
OR
Write an ap for the phone, that acts as a counter?
You don't need an arduino for the second one though.
One of the two (phone or Arduino) must be able to act as USB host to make this work - I believe there are both phones and Arduinos that can do this, but you really have to make sure you have on of such models.
ardruiner:
And Nick Pyner, what do you think
IF, as I now understand it, your intention is to measure external activities - solar charger and battery thereto - WHILE you use that to charge the phone battery, AND the phone's existing charging indication is, as I would expect, entirely adequate for that purpose, you might consider:
-
Arduino monitors the solar collectors and the storage battery. Plenty of precedent for that, and it is entirely practical as well.
-
Storage battery charges phone, Arduino is not involved - no need.
-
Arduino regularly reports solar activity and battery condition to phone via bluetooth. I would suggest you use God's gift to the Arduino world, Bluetooth Graphics Terminal. The vital considerations here are:
a. There is no need to have a USB host facility on the phone, which may be rather comforting, as not all phones have that.
b. Even if your phone does have USB host you would be excused from coming up with a phone app as well as an Arduino programme.
c. There is no need to confine yourself to a rather pointless exercise in phone battery charging, you would be able to monitor the thing that really counts, the solar-charged storage battery. This could be at any time, not dependant on the need to charge the phone, and without any need to physically connect the phone, thereby actually doing something that is not only useful, but may be of value in the future.
ardruiner:
Thank you John Wasser, the latter is exactly what I'm inetrested in. But unfortunately your link isn't working for me...
I have fixed the link. Sorry about that.
Thank you Nick, Bluetooth is a good idea. I just didn’t want to add another module for it, but it would probably be easier.
John, thank you for the link
ardruiner:
but it would probably be easier.
I think you are dead right, and it will cost you about $3.50. The other way may have cost you a new phone. You might find the following background notes useful.
http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino