Each year millions of old smartphones are either tossed as e-waste or are condemned to lie unloved in dusty drawers, despite the hardware in them usually being still perfectly fine. Reusing these little computers for another purpose once the phone’s manufacturer drops support is made hard by a range of hardware and software (driver) issues. One possible way to do so is suggested by [Doctor Volt] in a video where a Samsung Galaxy S4 is combined with a USB-connected FT232R board to add external GPIO.
The idea is pretty simple: the serial adapter is recognized by the existing Android OS and within the standard Android development environment this module can be used. Within this demonstrator it’s merely used to blink some LEDs and react to inputs, but it shows how to reuse one of these phones in a non-destructive manner. Even better is that the phone’s existing sensors and cameras can still be used as normal in this way, too, which opens a whole range of (cheap) DIY projects that can be programmed either in Java/Kotlin or in C or C++ via the Native Development Kit.
The only wrinkle is that while the phone is connected like this, charging is not possible. For the S4 it’s easy to solve as it has a removable battery, so an external power input was wired in with a dummy battery-sized bit of perfboard. With modern phones without removable batteries simultaneous USB/audio dongle and charging usage via the USB-C connector is claimed to be possible, but this is something to check beforehand.
I really wish there were a nice looking, flush wall mount with a bezel for some of these older devices. They would make great HA control panels, and would even have enough processor to run a SLM voice assistant, or at least provide the audio interface for a LLM.
That was the kind of application I was really hoping for when Samsung announced their now-defunct upcycling program years ago.
You could always have a panel 3D printed…
Sounds to me like a plausible excuse for getting a 3D printer. :-)
It’s not that hard to cut a few strips of wood and glue them together to make a simple picture frame.
Even if you don’t have the materials or woodworking tools, go to the local market and buy a bamboo clipboard, then rip it into suitable strips with a knife. This is literally kids’ arts and crafts level stuff – and people are instantly jumping to use a 3D printer to make objects that look like cheap plastic crud.
i made a (crappy) wall mount for my nexus 7 tablet and used it as an alarmclock for several years until it became too slow to be used as an alarmclock. it would take multiple whole seconds to acknowledge the ‘swipe right’ to turn off the alarm. tens of seconds to access the clock app UI if you wanted to change your alarms. unfathomable.
then i made a (crappy) wall mount for my moto x and used it as an alarmclock for several more years and its battery ballooned so i replaced it and then the new battery ballooned and obliterated some of the ribbon cables as it did so.
i’m back to my 1990 sony dream machine. i’m a little discouraged by wall mount android. but i did get years out of those on the wall, in addition to the regular service life of the device.
That’s the other thing needed is a way to limit the battery charge to a specific percent less than 100%. Phones aren’t made to be plugged in all the time…
Charge to 4.1v. Simple current limited, fixed voltage output regulator.
I remember having a pre-Android phone that ran when plugged in without battery, I just don’t remember which one…
Pretty sure some of the early Samsungs would work without battery but that makes ‘power went off’ an actual reason instead of an excuse for why you overslept
My S20+ can limit charging to like 80% I think natively.
Sometimes android devices need a factory reset. Maybe it’s accumulated random bit flips over the years, but I’ve experienced this many times, and a reset clears it up every time. Like the old Windows advice, every few years, format and reinstall.
The Nexus 7 was notoriously bad. Resetting isn’t going to help it.
The first generation Nexus 7 was a bloody disaster. Mine was unusable inside 18 months. The eMMC chips basically died almost immediately, no fault of the OS or anything. I’m pissed off Asus got away with releasing a second generation that was fixed instead of having to recall all of the first gen ones.
Or even, using Termux, Proot, Debian, Ollama and phi-3, your own offline LLM itself!
Have done, really cool. Also pretty slow.
OTG cables with power exist.
No battery dummy required.
Now your I/O device has battery backup, too.
They are inexpensive on Amazon etc and often advertised for use with fire stick or other streaming devices.
Definitely works.
You can also get with Ethernet and POE for even better solutions.
R
“Java/Kotlin or in C or C++ via the Native Development Kit”
Wondering if you could make a python micromamba environment (with its own C libs) on those old phones.
nice and simple battery solution
when i needed to do gpio from a phone, i used a pic12 with the world’s simplest demodulator… diode to R / C to NPN. my android app produced uh a binary amplitude-shift keying modulated tone. just like a 1kHz carrier wave that was gated on/off at about 250Hz (4 cycles per bit), or something in that vein. obviously extremely limited but it was sufficient for that hack.
if i had to do it again, i’d probably use an rp2040 pico with usb otg. really, i still love pic12 but the pile of chips and programmers has experienced some rot. if i’m buying new stuff, it’s hard to jump back into the ICSP struggle — prying a chip out of a socket, fighting against other uses of the programming pins, booting windows to run icprog (???) — when having a USB programming connection is so cheap these days.
hah i do resent the need to hold down the little button on the pico while plugging it in in order to force it into firmware mode. but man that’s a lot easier than anything that came before in my life!
Hehe, I was about to write something like this too. Some phones don’t have USB OTG, like the iPhones. But specifically the old iPhones with the 30-pin dock connector, have audio in and out on the connector. You could quite easily implement an FSK protocol to talk to peripherals.
With the new iPhones it’s harder, they don’t have analog in and out anymore, lightning is all digital and you need an Apple-provided chip to authenticate your peripheral, or the iPhone will immediately ban it.
You could actually still go the ‘acoustic coupler’ way, using a phone’s speaker and microphone. But I guess the screeching sounds would annoy anyone, including yourself, within a few seconds.
Maybe you could modulate data on top of an audio stream. E.g. use modulated Amiga mod music to transfer data, so you can listen to Amiga mods when controlling your peripheral. ;)
But ok. Realistically? We live in 2024. Just buy an ESP32 for a few dollars and use Bluetooth Serial Port Profile or BLE.
Or WiFi, why not? Those old phones all support WiFi. You can put your whole app in the ESP32 as a web-based application and use your old phone’s web browser to control your peripheral. As long as you only use basic HTML, any old browser on any old phone is going to work.
And then you also have the connector free for charging.
This. Any old phone can connect to an ESP32 or even ESP8266 configured in ap mode. Make a shortcut on the phone’s browser to 192.168.4.1, and bam. I do this regularly with an old Galaxy S5 that doesn’t have phone network service any more for various troubleshooting and minor control purposes. Actually makes it worth keeping the old S5 in fresh batteries since the back pops off for easily replacing them.
Does it automatically re-connect on error, and what about security?
I was thinking that, though it is nice to see a hard wire method, thanks to this author, nice basic example. I think he did this because it removes the complexity of Bluetooth and WIFI. But then with wifi or BLE you can still have the charge plugged in and just send a packet to some tiny wifi or BLE with a microcontroller and could greatly expand I/O. I like projects like this, cause it reduces Ewaste.
At that point just drop the phone altogether, since you have a fully capable and real-time MCU.
My fav use for an old ´droid is Octoprint : just slap in on a 3D printer, and use an OTG cable to the printer with derivated power !
Since all phones have a touchscreen, camera, Wifi it is quite ideal. Just need a custom 3D printer holder for it.
You might even want to tap into the 3D printer mainboard power connector to put a simple DC/DC supply with 5V out to power the old Android phone.
It´s here: https://github.com/feelfreelinux/octo4a
Yup, I was going to suggest that. Has anyone used a phone in place of a raspberry pi for Klipper?
The cameras in these binned phones seem like a gold mine to me. I hate that I purchase big clunky and not very good ip cameras, while that bin of old cell phones on the shelf has amazing tiny cameras in every one. I can convert the entire phone into a pretty good ip camera via an app, but would love to see the an approachable path to extricating those tiny high res cameras for application as ip cameras for use in other places. ( with some form of programmable controller of course)
I reuse my old phones as security cameras with the Alfred Camera app.
I would also like to do the opposite: use the smartphone as a sensor platform for an Arduino or RPi project.
Alfred “free” is now nerfed and a usable version is $40/year. Sigh another good app goes commercial.
Oh no, developers of useful software want to get paid instead of listening to user whining for free, who could have thought.
The problem with cell phones is the proprietary and poorly documented hardware. If you had access to a dozen identical old phones it might be worth the effort but building a whole project around a single 10 year old phone is a fools journey. The best you can do is turn it into a webcam (they can all do that). But you can also use an ESP32-CAM with lower resolution but tons of tutorials and documentation.
This uses a serial connection. And all of the sensors etc. are standardized though Android SDKs (including the serial connection).
“With modern phones without removable batteries simultaneous USB/audio dongle and charging usage via the USB-C connector is claimed to be possible, but this is something to check beforehand.”
I’m reasonably sure this would work. I have tested plugging a usb c hub into my galaxy s 22 so I can use DeX on an external monitor and have a physical keyboard and mouse and still charge it.
I remember a cheap tablet I got, I wanted a serial terminal to monitor GRBL commands on laser machine, so I opnened and put some wires to the debug serial port, installed an app to mimic the console and I was ready to interface the machine, no adapter needed.
If you have a defective phone lying around, you can also just rip the display off and use some GPIOs there:
https://hackaday.com/2023/04/27/using-an-old-smartphone-in-place-of-a-raspberry-pi/#comment-6636795
So like a homebrew version of the IOIO ?
Or the rural version; EIEIO?
“With modern phones without removable batteries simultaneous USB/audio dongle and charging usage via the USB-C connector is claimed to be possible, but this is something to check beforehand.”
Most phones of todays and last five to seven years, use USB-C with USB PD for charging. PD – Power delivery, makes it possible for a device to be set to be USB host while charging. All Samsung Galaxy since S9, probably also the S8, support this. I use this feature every day.
To make it work, one can either buy a powered USB hub with HDMI and/or Ethernet connector, but they cost a few tens of dollars, or one could buy a simple and cheap USB C splitter cable with PD support from eBay or Ali Express.
The handling of usb devices is wonderfully simple to program in Android apps, and there are several GitHub libraries for handling a variety of different USB RS232 chips.
A product like this should work: https://www.ebay.com/itm/166349961415?mkcid=16&mkevt=1&mkrid=711-127632-2357-0&ssspo=cvpnyidpsvc&sssrc=4429486&ssuid=zgvpWGsuTTm&var=&widget_ver=artemis&media=COPY
Just make sure the adapter or splitter cable specifies data (as usb host) while simultaneously charging.
For integration like this, USB 2 data rates (480 megabits pr sec) are sufficient, and most USB serial adapters usually support just 12 megabits pr sec anyways.
Great hack if you had a couple of reasonably similar phones lying around where you could apply the same battery hack but to create apps you have to get into Android and it’s whole dev environment.. maybe it’s pretty simple but these days like everything else it’s ballooned out of all proportion since I last looked at it..
Another simple cheap solution to UI and gpio might be the “cheap yellow display” or “CYD”.. based on a decent enough display and esp32.. comes with a few GPIOs but to expand or do anything useful it really needs to talk to something else.. but that’s the whole point of it..
How Intel’s OpenBot Wants to Make Robots Out of Smartphones
https://spectrum.ieee.org/intel-openbot-robots-smartphones
OpenBot: Turning Smartphones into Robots
https://www.youtube.com/watch?v=qc8hFLyWDOM
Given my experience with old cheap phones when they weren’t old, but OTG support was new, I found wiring power up to the otg adapter would charge most OTG compatible devices, as well as provide extra power for devices connected to the adapter. Worth testing out if you need the battery for whatever reason.
A good start. But I’d rather be directed to a blog or a whole website, rather than a video.