⬆️ ⬇️

Vintage Android Phone

Introduction

Once I watched some old movie. The hero used the phone: picked up the phone, asked the operator to dial a friend’s number and began to talk. I really liked the simplicity with which the call was made, and the appearance of the phone. I decided to assemble such a phone myself. You pick up the phone, say who to call, the voice is recognized, the name is searched for in the address book, and a VoIP call is made.



In this post I will tell you about the details of the project: about an Android-based device, about the IOIO Board, about carving on wood and on plastic.

Result

To better understand why I made these or other decisions, you should first look at the result of the work:





')

Process of creation



Components


After a little research, I decided to use the following components:





Old phone as a device case. I was very attracted by the aesthetics of the old phone. I found a fairly cheap phone and case with a call on eBay.





Archos 28 as the "brain" of the device. I was attracted by the small price and availability of the main components: internal memory, Wi-Fi, microphone and sound output and 800Mhz processor.

The reader will ask: why not solve the problem with a microcontroller and a set of modules? It seemed to me cheaper and easier to use this phone: everything you need is already assembled on one board, plus the Android OS provides a good level of abstraction. The device should work around the clock, so that problems with power consumption does not arise.



IOIO Board to interact with the "iron". This thing connects to the device via USB and is recognized by the phone as “debug mode on”. There is a small API that allows you to read the line status (both digital and analog) from any Android program and generate a signal (digital and PWM) on the line.

The reader will ask: why not use Android ADK ? Alas, ADK support was added only in Android 2.3. My phone works on 2.2.



Iron, wood and plastic


First, I disassembled the telephone and cleaned it of the ancient dirt. The device was released in the late 1910s, so there was enough dirt there. I used warm soapy water solution for wood and WD-40 for metal. Here are the component parts:







The second step was the preparation of the Archos 28. Although this device was not intended for an amateur soldering iron, it was not very difficult to draw lines for the power button, microphone, headphones and Wi-Fi antenna. The holder of the tube of the ancient apparatus contained a simple mechanism that closes the line to the ground if the tube is removed. A little fuss, and here's the result:







The device Archos 28, alas, did not really fit into the old box. I had to use Dremel to cut a small chute for the phone, make holes for the wires and screw the lid on the hinges:







At some point I discovered that my desktop resembled the Table of the Time Traveler, who had just returned to his 19th century from our XXIth:







I really wanted to keep the original call. The bell device did not allow virtually any modification: the ancient electromagnets and the capacitor occupied almost the entire place in the housing. So I decided to make my call mechanism. The metal ball that strikes the bell was attached to a movable platform. The platform swayed back and forth from the movement of a small electric motor on the axis of which a small ellipse was attached. Probably, this is clearer on the diagram:







I used Inkscape to create a drawing. I must say that using Inkscape seemed to me a real flour. I hope that somewhere there are not very expensive counterparts.

When the drawing was ready, I used the Ponoko service to cut plastic parts. A couple of weeks, and the details come:







A bit of glue and these components will forever become a ring mechanism:







Chip assembly




The scheme turned out to be extremely simple: the phone was connected with a USB cable to the IOIO Board. The board itself was connected directly to the contact of the telephone stand (to know if the phone was hung up) and through TS1220-600T - with a motor (to call). Here is how it looked in the assembly:







You can imagine how it fit into the case:







It should be noted that when this design was placed in the frame, the quality of the Wi-Fi connection dropped dramatically. So I had to buy and solder an external Wi-Fi antenna. On the Archos 28, the UF.L port is very well labeled. Here is how the system looked in the case:







Here's how to get the wires out:







Software


Main components
CMU Sphinx is an open source project at Carnegie Melon University. The system consists of two parts: code and files with pronunciation and language model. The code is compiled into the library for android. The project site has a great example of using a voice recognizer.

Everyone has their own pronunciation. Fortunately, CMU Sphinx can be taught precisely his own. After reading 20 sentences and driving them through a certain program, you can significantly improve the quality of recognition. Moreover, a language model can be proposed to the discriminator. This is something like a contract where you promise to say only certain words and phrases. In my case, the main phrase was “call [name]”, where [name] is one of the elements of this list. The presence of such a model significantly improves the quality of recognition.

The reader will ask: why not Google Voice? He, alas, extremely poorly understands my pronunciation and terribly recognizes names.

The reader will ask: why not use a special chip? I have been thinking about this approach for a long time, I looked at Sensory solutions, but it was too expensive. That is, there are no less problems than with CMU Sphinx, the quality is comparable, and you have to pay money.



" No to the voice generator " - I came to this conclusion by trying several different products. In all, alas, the voice was very unnatural. Some kind of dead. I had to ask a living person to read all the possible phrases that the phone can tell me. Moreover, I asked to read each phrase several times. The program randomly selects a phrase option, thus creating a very strong illusion of a living person.



PJSIP is an open source implementation of the SIP stack. Roughly speaking, the open library VoIP. Everything is simple: you take, compile and use. I was greatly helped by the CSipSimple project in understanding the library API and embedding it correctly in my application.

The reader will ask: why not use Skype? I wanted it at first. And even subscribed to the Skype Developer Program. But, alas, the Skype Developer Program license agreement does not allow you to run their product on any device managed by the Android OS. When I learned this, and when I wrote this post, I cursed loudly in rather indecent words.

The reader will ask: why not use the stack built into Android? The answer is simple: SIP support was added only in Android 2.3. My device works on 2.2.



Work algorithm
When the phone is picked up:

  1. Wait a second
  2. Say "Number, please!"
  3. Start to recognize voice
  4. If the phrase “call [name]” is recognized, go on, otherwise say “Sorry, I didn't get that” and go to 3
  5. Say "Calling [name] ..."
  6. Start to recognize voice
  7. If the phrase “no” or “stop” is recognized go to 2, otherwise go on
  8. Dial the number
  9. Say "Call placed"
  10. Wait until the call ends
  11. Say "Call terminated"




When an incoming call is ringing, until either they pick up the phone, or they don’t end the call at that end, or it does not take 20 seconds. Ring according to the scheme: call - break - call.



Application format


It seemed to me the most natural thing to do a service that executes all the logic and a regular application that only shows the current status. The service starts either with the start of the device, or with the start of the application. Source code can be found in the project on Google Code .



Conclusion



The phone recognizes my voice quite well, it rings and even receives calls. I will be happy to answer any questions, listen to criticism and suggestions.

Source: https://habr.com/ru/post/126609/



All Articles