OURphone - an Open-Source Linux Smartphone
by EvanRobinson in Circuits > Mobile
11297 Views, 119 Favorites, 0 Comments
OURphone - an Open-Source Linux Smartphone
![IMG_1453.JPG](/proxy/?url=https://content.instructables.com/FB4/5JZ8/LH4USHDX/FB45JZ8LH4USHDX.jpg&filename=IMG_1453.JPG)
![IMG_1454.JPG](/proxy/?url=https://content.instructables.com/F7R/SI8R/LH4USHIM/F7RSI8RLH4USHIM.jpg&filename=IMG_1454.JPG)
![IMG_1463.JPG](/proxy/?url=https://content.instructables.com/FM5/PQ3R/LH4USHJD/FM5PQ3RLH4USHJD.jpg&filename=IMG_1463.JPG)
![IMG_20230501_111658.jpg](/proxy/?url=https://content.instructables.com/FA6/M41X/LH4USHJJ/FA6M41XLH4USHJJ.jpg&filename=IMG_20230501_111658.jpg)
![IMG_1455.JPG](/proxy/?url=https://content.instructables.com/FKR/SZTP/LH4USHJB/FKRSZTPLH4USHJB.jpg&filename=IMG_1455.JPG)
![IMG_1460.JPG](/proxy/?url=https://content.instructables.com/FS5/O7EX/LH4USHJF/FS5O7EXLH4USHJF.jpg&filename=IMG_1460.JPG)
![IMG_1458.JPG](/proxy/?url=https://content.instructables.com/FX6/GB41/LH4USHJI/FX6GB41LH4USHJI.jpg&filename=IMG_1458.JPG)
![IMG_1461.JPG](/proxy/?url=https://content.instructables.com/FBN/I9G1/LH4USHJE/FBNI9G1LH4USHJE.jpg&filename=IMG_1461.JPG)
![IMG_20230501_111903.jpg](/proxy/?url=https://content.instructables.com/F7Y/IYYE/LH4USHJK/F7YIYYELH4USHJK.jpg&filename=IMG_20230501_111903.jpg)
![IMG_20230501_112025.jpg](/proxy/?url=https://content.instructables.com/FXT/NRY1/LH4USHJL/FXTNRY1LH4USHJL.jpg&filename=IMG_20230501_112025.jpg)
![IMG_20230501_112237.jpg](/proxy/?url=https://content.instructables.com/F7M/1B6F/LH4USHJM/F7M1B6FLH4USHJM.jpg&filename=IMG_20230501_112237.jpg)
![IMG_20230501_112252.jpg](/proxy/?url=https://content.instructables.com/FQA/WY0B/LH4USHJN/FQAWY0BLH4USHJN.jpg&filename=IMG_20230501_112252.jpg)
![IMG_20230501_113514.jpg](/proxy/?url=https://content.instructables.com/FID/U46K/LH4USHJO/FIDU46KLH4USHJO.jpg&filename=IMG_20230501_113514.jpg)
![IMG_20230501_115911.jpg](/proxy/?url=https://content.instructables.com/FMS/UGQ0/LH4USHJP/FMSUGQ0LH4USHJP.jpg&filename=IMG_20230501_115911.jpg)
![IMG_20230501_115537.jpg](/proxy/?url=https://content.instructables.com/FZV/8ECS/LH4USHJS/FZV8ECSLH4USHJS.jpg&filename=IMG_20230501_115537.jpg)
![IMG_20230501_115055.jpg](/proxy/?url=https://content.instructables.com/FNO/1X7J/LH4USHJT/FNO1X7JLH4USHJT.jpg&filename=IMG_20230501_115055.jpg)
![IMG_20230501_114557.jpg](/proxy/?url=https://content.instructables.com/F1U/1ULN/LH4USHJU/F1U1ULNLH4USHJU.jpg&filename=IMG_20230501_114557.jpg)
![IMG_20230501_114113.jpg](/proxy/?url=https://content.instructables.com/FWK/2EYM/LH4USHJX/FWK2EYMLH4USHJX.jpg&filename=IMG_20230501_114113.jpg)
![IMG_20230501_112331.jpg](/proxy/?url=https://content.instructables.com/FMN/GJB5/LH4USHJY/FMNGJB5LH4USHJY.jpg&filename=IMG_20230501_112331.jpg)
![IMG_20230501_112932.jpg](/proxy/?url=https://content.instructables.com/F49/OF9R/LH4USHK1/F49OF9RLH4USHK1.jpg&filename=IMG_20230501_112932.jpg)
Mission
I want people to have more control over their most personal smart devices, so I created an Open-source, Upgradeable, Repairable Smartphone, that's completely Big Tech free. It's not theirs - it's O.U.R.S.
Introducing OURphone - a phone that any hobbyist with reasonable skill can replicate, improve on, share and enjoy. I hope you will copy my design and make it your own.
Please see my GitHub for the latest set of code and plans: https://github.com/evanman83/OURS-project/
The instructions below are copied from there. If you build an OURphone, please share your version on GitHub and contribute to the ongoing evolution of this concept.
Phone specs
- 4G LTE internet
- Call, SMS, Contacts book (contains a SIM7600 with sim card)
- Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
- 1 GB RAM
- Running Raspbian - a Debian Linux OS with installable app store
- Can run Facebook, WhatsApp, YouTube etc in browser
- 4 inch 480 x 800 colour touch screen
- 5MP colour camera
- GPS (in browser)
- Wifi
- Bluetooth audio
- 1 watt onboard audio speaker
- 3 USB ports
- "Convergent": HDMI port to plug in external monitor, USB to plug in keyboard and mouse
- Screen lock switch
- 9cm x 16cm x 3cm
- 5 hours battery life
- Big Tech free / optional - privacy achieved!
How it works
The Raspberry Pi provides the basic functions of a computer, now made portable by the two 3.6v batteries, down-converted to 5.1V DC. Telephony (calls and SMS) is made possibly via the Waveshare 4G HAT with a normal mobile network SIM card contained therein. The Pi communicates with the 4G HAT via ordinary AT commands. The startup.sh script runs the configuration necessary to activate a 4G mobile internet connection. The phone.py app provides a UI for dialling and calling, sending, receiving and replying to SMS, adding and removing records from a simple Address Book. The built-in microphone and speaker allow normal voice calls.
Supplies
- Waveshare SIM7600G-H 4G HAT (B) for Raspberry Pi
- Raspberry Pi 3 Model B
- Waveshare 4 inch 480x800 HDMI IPS LCD touch screen display HAT
- Lithium-ion battery 3.7V 3500mAh 18650 (x 2)
- HKD Raspberry Pi camera mod 5MP
- HKD DC/DC Buck Module 0.8-20V 2A converter
- Slide switch SPDT (screen lock switch)
- Slide switch DPDT (main power switch)
- Micro USB Lithium 18650 battery charger 1A
- HKD GSM antenna on IPEX 13 connector
- Mini condensor microphone
- 0.86inch 1W 8Ohm speaker
- HKD PAM8403 audio amplifier
- Miniature 5V relay
- 10uF electrolytic capacitor
- 10K potentiometer
- 3.5mm audio plug 4 pole (male TRRS)
- 3.5mm audio plug 3 pole (male stereo)
- Micro USB 5P plug in white housing R/A – rewireable (x 2)
- Battery holder for 18650 (x 2)
The total cost to build in April 2023 was ZAR3,639, approximately USD198 or EUR180.
Rough Assembly and Testing
![IMG_20230125_102156.jpg](/proxy/?url=https://content.instructables.com/F0W/CY5X/LH4UT1JA/F0WCY5XLH4UT1JA.jpg&filename=IMG_20230125_102156.jpg)
![schematic.jpg](/proxy/?url=https://content.instructables.com/FDD/7IAH/LH4USRCO/FDD7IAHLH4USRCO.jpg&filename=schematic.jpg)
Buy all the parts listed above. Connect them based on the schematic attached here.
Start by connecting the below basic components using available cables and plugs. You don't need to solder / engineer anything at this point:
- Raspberry Pi
- 4G HAT + GSM and GPS antennas
- Raspberry Pi power supply
- Waveshare touchscreen
- Raspberry Pi camera (optional)
- Headphones with built-in mic
- Some USB cables
- Operational mobile phone SIM card with airtime and data
Follow the instructions listed in setup_commands.txt to ready the Raspberry Pi.
Part of that process will involve copying the files below into the Raspberry Pi home directory:
- startup.sh (auto-start script to turn on internet) Copy the file startup.txt and rename as startup.sh
- phone.py (the app that actually enables calls, SMS, Contacts, diagnostics, photos, GPS, etc)
- location-provider.py (presents stored GPS coordinates at a URL for web-based location providers)
- ringtone.wav (your phone's ringtone - replace as you wish!)
- mobile-keyboard.xml (a custom keyboard based on the match keyboard software)
This should be enough to get the phone app working, the OS working, test internet, phone calls, SMS, GPS, camera, music playing, internet browsing, Bluetooth, Wifi.
Making It Small
![IMG_20230429_123637.jpg](/proxy/?url=https://content.instructables.com/FAW/0WFA/LH4UT3XU/FAW0WFALH4UT3XU.jpg&filename=IMG_20230429_123637.jpg)
![IMG_20230429_123650.jpg](/proxy/?url=https://content.instructables.com/F0N/X9IQ/LH4UT3XP/F0NX9IQLH4UT3XP.jpg&filename=IMG_20230429_123650.jpg)
![IMG_20230215_225042.jpg](/proxy/?url=https://content.instructables.com/FTQ/R990/LH4UT3XW/FTQR990LH4UT3XW.jpg&filename=IMG_20230215_225042.jpg)
![IMG_20230215_224848.jpg](/proxy/?url=https://content.instructables.com/FF4/J05Z/LH4UT3XX/FF4J05ZLH4UT3XX.jpg&filename=IMG_20230215_224848.jpg)
![IMG_20230218_202118.jpg](/proxy/?url=https://content.instructables.com/FI8/RG7C/LH4UT3XV/FI8RG7CLH4UT3XV.jpg&filename=IMG_20230218_202118.jpg)
![IMG_20230215_224147.jpg](/proxy/?url=https://content.instructables.com/FDA/8I3L/LH4UT3XY/FDA8I3LLH4UT3XY.jpg&filename=IMG_20230215_224147.jpg)
![IMG_20230429_123734.jpg](/proxy/?url=https://content.instructables.com/FCI/YEE7/LH4UT3XJ/FCIYEE7LH4UT3XJ.jpg&filename=IMG_20230429_123734.jpg)
Most of the challenge of this project was making it small. Mobile phone manufacturers have devoted decades to ensuring their supply chain provides custom parts which snap together into super elegant designs that don't waste even a cubic millimeter of space. We don't have that advantage unfortunately, but there is still a lot that we can do to make this design compact.
USB and audio plugs
There are many USB and audio plugs being used in the project. These are too big to allow packaging the phone's components into the wooden phone cover (box) designed for it. To make these smaller, I used thin wire to make new cables, with custom plugs on either end. I made the plugs by using radically stripped down versions of the male plugs, taking off extra plastic housing, grinding off unnecessary bits and even bending some parts at right angles. Then I soldered on new leads and covered it with hot glue so that they are robust enough to force into tight spaces.
To save even more space I soldered USB connections directly to the back side of the Raspberry Pi. This was the plug going into the 4G HAT. If we had used a standard USB cable this would have taken up far too much space.
Fitting in the Waveshare 4G HAT board
This is a challenge because the 4G HAT sits in between the touch screen and the Raspberry Pi itself - a very tight space. Expect much swearing to get this right :) I used a combination of a Dremel tool (small rotary grinder) and miniature steel cutters to painstakingly cut off the large USB ports and the two thick metal pins. These proved useless for carrying USB data, so I couldn't use them anyway - only the micro USB port seemed to work (despite many messages to their Customer Support).
Be EXTREMELY careful removing these big items because it is very easy to cause significant physical destruction by lifting a track off the PCB, and then your module (the most expensive part of the build) is dead and unusable :( Only attempt if you have a surgeon's hand and a Zen Master's patience.
Once these items are removed and the whole device is now thinner, I hot glued the GSM and GPS antenna plugs and wires in place so they are not so fragile, and wrapped the whole thing in insulation tape.
Reducing the antennas
The GSM antenna provided is too big. So I purchased a PCB GSM antenna and soldered that onto the cable instead. It works ok, but signal is never 100%, only good-ish. The maximum I have seen is 87% strength.
The GPS antenna is also too big. So I crushed it slowly in a clamp and used a screwdriver to prise off the plastic casing, which takes up a lot of space. This revealed a much smaller GSM antenna chip, a hard metal square. I soldered this onto the cable instead and replaced the male-female adapter plug with just one little neat cable.
Making the Phone Case
![IMG_20230215_173732.jpg](/proxy/?url=https://content.instructables.com/FF4/GCBG/LH4UT83V/FF4GCBGLH4UT83V.jpg&filename=IMG_20230215_173732.jpg)
![IMG_20230215_213625.jpg](/proxy/?url=https://content.instructables.com/FS8/7G9B/LH4UT83W/FS87G9BLH4UT83W.jpg&filename=IMG_20230215_213625.jpg)
I needed to design a custom case to hold the components, yet I wanted to keep costs low, so I opted to use laser cut MDF board instead of 3D printing with plastic. The material and cuts cost me about ZAR120 ~ USD6.50.
Send the file laser-cut-cover.dxf to your nearest laser cutting service and ask them to cut it from 3mm MDF. You could use any material you like, as long as it is 3mm. If you want to use a thinner material then you will need to adjust the design because the parts fit together at 90 degrees.
One aspect of this design that I overlooked was heat management. The Raspberry Pi and Waveshare devices use a lot of power and create a lot of heat. Using a metal cover would help, as well as placing the Waveshare chip up against the cover like a heatsink of sorts.
Downloads
Tying It All Together
![IMG_20230217_234640.jpg](/proxy/?url=https://content.instructables.com/F3L/0XIL/LH4UTBWS/F3L0XILLH4UTBWS.jpg&filename=IMG_20230217_234640.jpg)
![IMG_20230429_123708.jpg](/proxy/?url=https://content.instructables.com/FML/99HT/LH4UTBWM/FML99HTLH4UTBWM.jpg&filename=IMG_20230429_123708.jpg)
![IMG_20230429_123617.jpg](/proxy/?url=https://content.instructables.com/FJ1/0A0J/LH4UTBWP/FJ10A0JLH4UTBWP.jpg&filename=IMG_20230429_123617.jpg)
![IMG_20230429_123553.jpg](/proxy/?url=https://content.instructables.com/FNI/QIAB/LH4UTBWQ/FNIQIABLH4UTBWQ.jpg&filename=IMG_20230429_123553.jpg)
![IMG_20230429_130914.jpg](/proxy/?url=https://content.instructables.com/F3P/7MCU/LH4UTBWL/F3P7MCULH4UTBWL.jpg&filename=IMG_20230429_130914.jpg)
![IMG_20230311_210201.jpg](/proxy/?url=https://content.instructables.com/FZB/27YL/LH4UTBWR/FZB27YLLH4UTBWR.jpg&filename=IMG_20230311_210201.jpg)
![IMG_20230430_202821.jpg](/proxy/?url=https://content.instructables.com/FS2/GVPK/LH4UTBWK/FS2GVPKLH4UTBWK.jpg&filename=IMG_20230430_202821.jpg)
This is best described with pictures, but the main steps are:
- Make new male plugs for the micro USB and male 3.5mm TRRS / stereo plugs (as described above).
- Solder all the wires for the charger, power switch and power supply. Set the DC/DC converter to 5.1 VDC. Charge the batteries up for the first time, with the power switch in OFF / charging mode. Test whether the system can boot up and connect to the web - outbound calls and internet use a lot of current / make current spikes.
- Solder in the audio amp, speaker and volume knob. Play a test mp3 (I downloaded the RhythymBox app) and see how loud it plays over the speaker.
- Solder in the relay and screen lock switch. When the phone app is running, switching the screen lock switch should turn off the LCD screen and disable the touch controls. When a phone call begins, the relay should switch off the default Raspberry Pi audio and instead connect the phone call audio to the loudspeaker.
- Connect all the batteries, wires and plugs and test: Internet, phone call, SMS, GPS, music playing. There is a lot of guidance for troubleshooting in the file setup_commands.txt (provided above).
- Insert the 4G HAT between the touchscreen and Raspberry Pi, with audio and power cables pointing out the bottom right hand corner of the screen (facing the screen).
- Fold the camera ribbon cable under the 4G HAT and over and under the batteries - stick the camera in place with Prestick putty. (this system was annoying because every time I needed to remove the electronics from the cover I had to unwrap the camera - rather implement some kind of snap plug for the ribbon cable to make this easier)
- Stick the speaker with putty over the top right-hand grill (9 holes).
- Place the GPS antenna next to the top left-hand grill (9 holes). GSM antenna can go down the left-hand side of the cover.
- Start glueing the case together, starting from the bottom upwards, finishing with the front cover.
Conclusion and Improvements
This project was delicious fun to build, but with an equal amount of frustration and struggle. The parts I struggled with most were the audio circuit design (I didn't know how to reduce the crackling), making robust USB and audio connectors that were small enough, and getting the power supply working. I learned a lot about not using cheap Croc-clip connectors :D Debugging the internet connection was also a lot of fiddling.
The result is a phone that actually does a whole lot of things. It is free from the influence of Big Tech in all but the chip manufacturing - there is no need for sign-ons, logins, tracking, adverts, privacy notices, terms and conditions etc. It's a simple phone that does what you need it to do.
That being said, the phone can do with a lot of improvement - and that's where you come in! Here are the things I think you should work on in your version:
- Use a faster Raspberry Pi with more RAM, or a completely different single board computer (SBC), or the RPi 4 compute module (small)
- Use a capacitative touch screen, not resistive touch
- A bigger screen would be nice, taking up the full size of the device
- Eliminate audio whining / cracking which sounds like occasional extra-terrestrial signals from space (I think this is an RPi 3 problem, or the audio amp / power supply needs isolation of some kind)
- Customise Raspbian so the UI is more usable by finger (perhaps flash another OS like Ubuntu Touch or Firefox OS)
- Use shielded cables for audio carrying wires
- Add a microphone / USB audio card to enable audio on the video recordings
- Connect phone call audio into Bluetooth (not just device audio)
- Add an audio jack
- Improve the main Phone python app so it's less 1990s Nokia
- Detect and display remaining battery life
- Get the internet connection to be more robust, sometimes it doesn't load on boot
- Make it less like a brick
If you don't want to add those features, you can always add:
- A burning CO2 laser
- Eardrum-shattering bass speakers
- A spectrometer
- A terrifying AI chip
The options are endless :) Enjoy the build, and please share your version at my GitHub page!