Here’s my latest DIY project, a smartphone based on a Raspberry Pi. It’s called – wait for it – the PiPhone. It makes use an Adafruit touchscreen interface and a Sim900 GSM/GPRS module to make phone calls. It’s more of a proof of concept to see what could be done with a relatively small form factor with off-the-shelf (cheap) components. I don’t expect everyone to be rushing out to build this one, but I had great fun in doing it, as it builds quite nicely on my previous projects, especially the Lapse Pi, a touchscreen time-lapse controller, and uses most of the same hardware.
What makes this different from the Timelapse controller is the addition of a a SIM900 GSM module, which is connected via UART to the Raspberry Pi. Also, I got myself a LiPo battery that would fit nicely between the TFT screen and the Raspberry Pi, so it could be used standalone, without any wires hanging off it whatsoever. Here’s the finished PiPhone.
Also shown in the above pic is the touchscreen interface I developed for the purpose of this project. It’s a numeric keypad, with a display of the number to dial at the top, and a phone icon at the bottom to make or hang up the call.
Here’s a demo of the PiPhone in action.
And do please subscribe to my channel, I regularly put up other cool projects! 🙂
Once we turn the unit over, we can see the main communications module, which is a Sim900 GSM/GPRS module. This allow us to send standard AT commands to it to make calls, hang up, send texts, data etc. Overall a very clever module. Towards the bottom of the white PCB, you can see the SIM Card, which allows the module to associate with my local GSM network, and it’s using a regular prepaid SIM card, bought in my local phone store for €10. Below the GSM module, you can see the on.off switch and a DC-DC converter, which converts the 3.7volts from the LiPoly battery to 5volts needed by everything else. The DC-DC converter is from eBay from a UK seller. It was more expensive than I’d like to have paid, but It was the last piece of the puzzle, and I didn’t want to wait the typical 3 weeks from China. The following image gives a better view of the LiPo battery. It’s from Adafruit (http://www.adafruit.com/products/328), which fits nicely between the TFT and the Pi. The only problem with this setup is heat. It gets a bit warm around the CPU if you leave the unit switched on for several minutes, as there’s very little air circulation. With a small fan circulating the air around it, I was able to leave it on for extended periods during development, and it was cool to the touch. Also, the 6 pin header on the GSM module sticks out a bit, so I though about de-soldering the header and soldering the wires directly onto the PCB. That would prevent the connector sticking out so much, and would sit better when placed on a flat surface. And the other side view, showing the foam-core board seperating the GSM module from the Raspberry Pi. I chose a nice thich piece to ensure no electrical connections between them. Oh, and a couple of well placed cable-ties was all that was needed to hold everything together. 🙂 And one last pic showing the Adafruit TFT on top. I presented this to my local FAbLab the night before the publication of this blog article, and one question from the audience stood out: “Do you have to pay for credit?”. That certainly made me think, and we had a good giggle at that. Yes, you still have to pay for credit in the usual way, purchase a SIM card from a local service provider. This is not going to get you free calls! Nice try though! 🙂 Costs:
- Raspberry Pi Model B – $40
- PiTFT Touchscreen 320×240 – $35
- 2500mAh LiPo battery – $15
- SIM900 GSM/GPRS module – $48
- DC-DC boost converter 3.3V – 5V 1A – $10
- Cables, connectors, switch, etc. – $10
- Total: $158
As you can see from the cost of the components, you’d be FAR better off going into your local phone store and picking up a normal smartphone, but hey, where’s the fun in that. I got a great kick out of the first phone call I made with this thing. And it wont’s stay in one piece for long, I’ll be using those parts for other projects very soon!
Software Code is available on GitHub. All the instructions are there, and links on what to do to install the PiTFT, etc.
–update Nov 2016 — Touch Screen Issue Solution–
I’ve had a few reports of the touchscreen not working. Thanks to DongHyun Lee from Malasya that found a solution in his case, which was down to the version of PyGame provided with Rasbian Jessie. Later versions of SDL (pygame) such as 2.x or 1.2.15-10 have some serious incompatibilities with touchscreens in a pygame app. So he downgraded to version 1.2. When I wrote this article, I was using Raspbian Wheezy, whereas users now are probably using Raspbian Jessie.
Have a look at the following page: https://learn.adafruit.
Circuits None. 🙂 It’s all made from off the shelf components.
About the Author: By day I’m a senior software engineer. In my spare time, I take pictures, and play with gadgets and technology.
Google Plus: https://plus.google.com/u/0/103494825025710742625/posts
Twitter: https://twitter.com/climberhunt @climberhunt
Be sure to check out my other Raspberry Pi related articles, and if you like, you can subscribe by entering your email address at the top right of the page. 🙂 Code is now available at https://github.com/climberhunt/PiPhone Note: There’s now a guide on learn.adafruit.com with new diagrams and information on building your own PiPhone: https://learn.adafruit.com/piphone-a-raspberry-pi-based-cellphone
Other Related Posts:
236 thoughts on “PiPhone – A Raspberry Pi based Smartphone”
Wonderful project! How’s the battery life?
I haven’t tested it, Jeffery, I’d imagine it would be only a couple of hours.
what wires did you use
If you turn off the hardware you’re not using, and put the CPU to sleep a lot, whenever nothing needs calculating for that particular millisecond, you could get days I should think, on standby. It’s what ordinary phones do.
You could wake up, say, every quarter-second to check the touch screen, if you can’t get it on an interrupt. Microcontrollers often have lots of power-saving features. A phone spends nearly all it’s time waiting for input from the user, or data from the network.
That’s the key to battery life in portable products: Be switched off 99% of the time. There’s probably a lot on the web about using Raspis on batteries, and squeezing out the most currrent. The GSM / GPRS module might also have power saving options.
Do you have a tutorial for setting up that kind of 99%-off standby mode? I’d like to use it in my Raspberry Pi project.
I put a Pi inside an iPod shell, and I use it as a pocket-sized USB host.
Instead of a boost converter I used a PCB from a power bank, so I can easily recharge it from microUSB. (Version 1 was pickpocketed on Hainan Airlines from Brussels to Beijing. I now made version 2, but I can’t post photos, because it’s a prototype Pi motherboard I acquired last year while working for the Pi manufacturer, Egoman, in China). Email me if you have questions ;-).
I want to add an LCD to my new iPod Video-sized model, but there’s no space inside the case for my Nokia 3310 screen.
In the current form though, powering up is slow, and a sleep mode would be perfect. Let me know if you’ve got a good tutorial for that!
Have you researched sleep modes on the Raspberry Pi at all? I’d be really interested to see what’s out there.It would be really useful for the PiPhone. Currently it’s on full all the time.
Actually a cursory look round tells me the Pi has NO power-saving hardware. It’s either up and running, or off!
Is a discussion mentioning underclocking the main chip, which reduces power but not much. That page links to
Which mentions replacing the Pi’s linear regulator with a more efficient one. The first page I mention, says it’s the network chip that takes most of the power, and it’s possible to remove that, as described in another link from the first link I gave.
So in this case, the chip just wasn’t designed for battery operation. It’s a shame cos many ARM-based chips have lots of power-management functions, just not this one.
It’s a shame. Still, there’s plenty of other ARM-based dev boards out there, with Linux support and with power-management. Perhaps one of those would be a decent replacement for the Pi, if you wanted to make a more practical phone. Which would of course be very very cool! Texas Instruments do a few dev boards, very cheap, for their MSP series ARM controllers.
Probably a bit more work than I originally imagined, in getting power management down. There’s no fundamental electronic reason why it can’t be done, just the Pi is the wrong choice of brains. 8-bit Atmel chips would also drive the phone-module well enough, but of course you’d miss out on most of the power for applications, and the existing software base.
Oh, also might mention, that the Model A Pi doesn’t have the network chip included like the Model B, so that would draw less current to start with. There’s also some other bits and pieces missing, which all helps.
In which language did you code it?
Thank you, nice project
Hi, It’s all done in Python. I’ll be publishing the code next week.
Python… hmm…Amazing, and i thought python cant do stuff like that, you made my mind go “How stupid of me”.
Do upload the code. I would like to see it.
Best Regards and wishes for your future projects 🙂
Python already did stuff like that and even more. There was (somewhere around 2008-9 AFAIR) complete, functioning phone software for Openmoko Neo Freerunner called PyNeo which had its UI and services written almost exclusively in Python. Later, the freesmartphone.org had its first reference implementation of API done in Python, together with example GUI for it called Zhone. SHR distribution uses some Python apps for it’s core utils here and there.
Actually, there’s nothing special about Python here, you can rewrite all of this stuff into almost any other programming language. For instance, there’s also a phone UI for FSO written in Emacs Lisp, called fso-el. With proper platform, only your imagination sets the limits.
right. you say ´functioning´ – my friend phil hands supported the openmoko by buying one. unfortunately the team who were employed on that project bit off more than they could chew, and used completely the wrong technology. what they should have done is what david has done: release a development phone that was capable of receiving and making phone calls, and perhaps sending and receiving sms messages. they could have done this by installing X11 and making an appropriate ´skin´ for the xgnokii application, or they could have installed gphone and they would have reached an all-important milestone of having phone calls and sms within only a few days of effort.
instead they chose to develop an entire runtime environment, using the god-forsaken system known as d-bus. they created so many notifications in this system – without communicating properly within the team – that not only were notifications often completely lost, but also they had notifications which sent more d-bus notifications which in some cases went recursive and overloaded the system in unrecoverable ways except a power-cycle.
… but the worst thing was that due to all this context-switching, the processor was unable to cope. in general, ARM processors are not hardware-optimised for multi-processing, they are optimised for low power. so in the ARM9 for example if you context switch the *ENTIRE* 1st level cache is thrown away!
so when a phone call came in, the sheer quantity of d-bus messaging was so great that the phone CPU on the OpenMoko was too busy to handle the screen and even the keyboard responses from X11. which, as anyone familiar with X11 will know, is *also* a client-server architecture meaning that there is yet *another* set of context-switching to contend with.
the upshot was that you literally could not answer a phone call within a reasonable amount of time.
basically although i am a huge fan of python it *is* necessary to take into consideration that it is an interpreted language with a speed *between* 1% and 99% that of c *depending on circumstances*, so whenever considering using it for real-time purposes on resource-constrained devices you had better keep it really *really* simple.
I can relate to what you described, but over last five years that I’ve been using my Freerunner (and I still do it even today!) the situation was changing many times for the better. While Freerunner is still an overwhelmingly underpowered piece of hardware, also due to poor hw choices like Glamo (thankfully we now have more modern projects like GTA04 and Neo900), in the end it turned out that it was manageable to provide a nicely working environment out of very powerful and flexible building blocks. And my inner hacker that enjoys playing with phone source code, maybe even just to beat the boredom in tram and using on screen keyboard, is really thankful for it 😛
yes. the GTA04 by dr schaller with the 1 ghz OMAP is definitely enough, even to cope with the mess that is d-bus. it was just such a pity that they spent so much money on the GTA01 to *not* get it right… at the time
so what do it do to make it? in my pi’s command line do i type this:
git clone https://github.com/climberhunt/PiPhone.git
or do i need to copy and paste the python file on to the pi?
please reply soon!
p.s congratulations on the awesome build
Once you do the ‘git clone’ on your Raspberry Pi, you’ll end up with a PiPhone directory. If you ‘cd’ into that directory, you’ll see the piphone.py script which is the script that runs the GUI.
showing my daughter: you didn’t take a call…
essential for the promo ~:”
I didn’t see any mention of a microphone or speaker.?
Watch the video… 😉
Ever heard of http://www.amazon.com?
shows LOADS of smartphones < 158$ without a contract…
What do you think you are you doing, Zed? Cause you’re doing it wrong.
LOL at zed!!! AHAHAHAHAHAHAH!!!!
I’d like to see where you can get a smartphone for under $158 that doesn’t have a contract (i.e. where you pay back the cost of the phone over time).
That was my thought. In Canada, I checked Koodo for prepaid phones, there’s an LG-A341 for $100, but it is hardly a smartphone.
Ever heard of http://www.amazon.com?
shows LOADS of smartphones < 158$ without a contract…
yes… but the neat thing here is that unlike any off-the-shelf prepaid phones you can easily customise the software to create an any-level-of-intelligence-of-your-choice phone. personally i would create a dumb-phone with it 🙂 phone calls. sms. nothing else!
@Tom West: I paid $42 for an Alcatel Onetouch Evolve on Amazon a few months ago. It’s locked to T-Mobile, but until I activate it, there’s no additional cost, and even then the cost would be just the standard monthly access prices anyone pays. I imagine it’s a loss leader for T-Mobile, but little did they know that I do my own development and I’ll use it for its processing, display, and WiFi in an embedded project and I’ll never activate it. Mwaahahahaha.
I’ll believe it when I see it.
Great project, read about it on Hacker News:
Yes, please post your source code on GitHub – would be awesome. Playing around with the AT commands of the GRPS modem is fun 🙂 [I built a GRPS cell phone using an Arduino UNO]
About the “DC-DC boost converter 3.3V – 5V 1A”, could one use one with less Ampere like this too: https://www.sparkfun.com/products/8290 or https://www.sparkfun.com/products/10255
the RPI needs needs 700mA and best is to use 1A or more … so if you use Arduino, perhaps it could work . (i believe it requires even less juice ?)
Well, not really. A device with proper power management, for instance, Openmoko Neo Freerunner, takes around 2mA while suspended and around 200mA during active usage, buuuuut… power consumption from the modem is generally low, but it can spike for a short time to even around 2A, for instance when connecting to BTS with very weak signal. 1A is probably enough to make it work most of the time, but make it less and you’re asking for trouble. That’s why you usually want to connect the modem directly to the power supply.
Amazing project! I would love to do this build. I’ll check back here for more like it :)keep building cool stuff. Also the heat, I imagine that’s coming primarily from the battery? (you may have mentioned that) if you repositioned the battery and screen to go above the board you might be able to case fit it and it shouldn’t be much larger than your average smart phones. Just a thought, love the project 🙂
Awesome project! It might be neat to turn it into a hotspot…
I was going to try to do this so it is cool that some one else thought of the same thing and actually did it and made it work. Now I can use your work as a base to work from if I ever get around to actually do it 🙂 Thank you.
That is amazing. You did an excellent job on this, I love it.
Please do share the code! 🙂 Would love to make this!
For better software, you can try freesmartphone.org middleware (with Zhone, SHR or Aurora as its GUI), QtMoko or maybe PyNeo. It’s all free software and given that your module uses basic AT commandset, it should more or less work out of box on your “device” and instantly give you full telephony, messaging and networking support.
Very nice thing!
Is it possible to change the IMEI of GSM module? It would be good feature in the contemporary world, where a danger often comes from the state…
No, and IMEI changing in order to achieve anonymity is pointless anyway, especially when using a module that’s rarely used otherwise (think about ‘modem fingerprinting’, not even mentioning behavioral analysis etc…)
For the best you can get from the phone regarding openness and anonymity, take a look at Neo900 – http://neo900.org
Please ..price for to you send a model for me to Brasil : )
Do it yourself! It’s just a project that’s like taken straight from basic engineering class, just like thousands of students do every semester to pass. Put few things together and you’re ready to go! It will be even easier for you, as you have a guide posted above 😉
but the programming of the phone for it to work even though I have to make this ?
It’s easy to write some basic software by yourself, just like the author of this post did. If you don’t want to, there is a lot of ready software to make any GNU/Linux based device (with a proper modem of course) functioning as a phone – like FSO, SHR etc. I have mentioned it already in some other comment.
And honestly, if you’re not interested in programming for a device like that, you definitely don’t want it. It has basically no practical value besides of learning. If it did, you would see more people talking to their homemade phones on the street, because it’s not hard to do, especially when platforms like Arduino or Raspberry Pi are that popular.
I have the concept of electronics and can ride it very easy but I do not know any programming language: (
Put themę Android and IT will be great!
Why did not you use a Model A Raspberry Pi ?
It would drain less battery as you don’t need Ethernet port I think.
I have about 5 B’s but no A’s 😉
Can’t you disable the Ethernet hardware if you don’t want to use it? It’s connected via USB, and USB has power management from the host-side. Just a matter of software / drivers. MIGHT be as simple as sending some bytes to the right address, depends on the OS it runs.
The difference would be neglectable.
What is the website for the github code?
I saw the link on Slashdot. I just wanted to add that, yes, I would also love to see your Python code. No need to fix it up first; the Many Eyes can spritz it up as the market dictates. Actually as a security professional, I would be delighted to review from an appsec perspective and propose some strengthening.
This is so much more exciting to me than Android ever was… honestly.
Great!!! I would love to see faces of police officers when you take this phone to make a call on the airport 🙂
Goody! build your own government tracking anklet…
TOT Innovationสนใจต่อยอดนวัตกรรมกล้องนิรภัยรีโมทระยะไกล โครงการฝากบ้านไว้กับตำรวจ สนใจติดต่อกลับที่ 081 3633910 THANK YOU
TOT Innovationสนใจต่อยอดนวัตกรรมกล้องนิรภัยรีโมทระยะไกล โครงการฝากบ้านไว้กับตำรวจ สนใจติดต่อกลับที่ 081 3633910 THANK YOU SO MUCH
This is amazing… maybe i should use it to replace my hard bricked samsung..
Also.. what Os is it using? im guessing Raspbian?
The cool thing about this phone is its impossible to hard-brick!
I have another question… Can you make a tutorial video?
and Where can I find the Cables and switches?(Or what exactly are they)
I made the cables. The switch can probably be recycled from old equipment, or purchased from your friendly local electronics store. 🙂
I would like to ask where are the 2 leads, Tx and Rx on the GSM module connecting to?
There are 4 wires used on the GSM module, Gnd, +5v, Tx and Rx, which connect to Gnd, +5v, Rx and Tx on the Raspberry Pi GPIO header.
AMAZING PROJECT!!!!! Congrats!!! 🙂
Btw, your project is famous now!!! WWWOOWWW!!
I was thinking about possibility to create really simple but reliable phone for visually impaired users so the phone would have simple hi-contrast UI with full voice output for all menu functions, calls and SMS – both reading received ones and also during writing.
There are various solutions for smartphones but it is mostly not simple and the voice output is not as reliable. Many visually impaired would appreciate even something like Nokia 3310 but with full voice support 🙂 This could be a nice start for such projects.
thanks for sharing
i suppose the same can be done using chan_dongle and using any of the supported huawei 3g modems..
great idea though..
Awesome project! I really would like to build it myself.
Share the code 😉
When Are You Going To Post The Code?
Just posted. https://github.com/climberhunt/PiPhone
You’ve made a cell phone, how much doing would it require to make a cell repeater, and have a closed cell network that could be implemented on the cheap? Even one repeater could service a house? and several, a neighborhood? Maybe it would require different hardware. Just thinking out loud.
Forgive me for saying this but isnt this just a knockoff of the arduino one thats been out ages? If i remember rightly there was a. Lotmore functionality on it to, wats next, slap a 7.5″ lcd and call it a PiPad or Pindle?
Would Make a great alarm unit for the LAB and also good for bushwalking 🙂
Hi my friend, It’s good this for your project?
Hi I’m a Korean student, and i’m a senior in Pukyong national university.
I’ve seen article about Piphone, and I got interest about it. So I’m going to try make it by myself. But there is problem, which we are using different method from most of countries, which are CDMA, WCDMA. If I use SIM900 GPRS/GSM module that you used in blog, I’ll meet problem that I can’t make a call because of different frequency. There isn’t CDMA/WCDMA module in online shop. I wonder there is shop where I can buy CDMA/WCDMA module for Piphone. And if I change module is it possible I can use your cording and same stuffs such as battery, converter? I’m crazy about Pi-phone now and I want to make it and with this chance, I hope to know about Raspberry Pi.
From the description of the SIM900 module: “SIM5215 The SIM5215 series is a Multi-Band WCDMA/GSM/GPRS/EDGE module solution which supports WCDMA 384kbps for data transfer.”
There’s now a guide on how you can build your very own PiPhone on https://learn.adafruit.com/piphone-a-raspberry-pi-based-cellphone
Comments are closed.