Wednesday 26 March 2014

All Finished...

Not being able to charge the Nokia without dismantling the GPO phone to get to the back of it was a bit of a problem. I thought that perhaps I could put a USB on the back of the phone and somehow plug this into the back of the Nokia.

I ordered a USB to Nokia charger lead but it didn't work :(

Whilst I was trying this an obvious thing struck me - why not just chop the original Nokia charger cable in half, put the 2mm charger in the Nokia, have a socket in the back of the phone and put a 'plug' on the charger cable.



Anyway this all works and the project is complete!

Next version on its way.....


EDIT: I'm not happy with the monstrous battery underneath the phone, and I have found that when I use it I tend to turn it on, show people what it is capable of, they then lose interest as they're not geeky enough, I then turn the phone off. The longest I've had it powered on is about 1 hour. This is easily achievable with the 6AA batteries + voltage regulator which fit inside the GPO phone casing.

Tuesday 25 March 2014

Phone functionality

From the rotary dial you can do the following:

[1] Look at phone book entries
[2] See Nokia battery remaining
[3] Check 'timeup' of the RPi
[4] Program the phone book

All of this is done on the Raspberry Pi, the only thing the phone is used for is sending AT commands to to make calls, answer calls, end calls or check battery.

The phone book is stored in a properties file that is accessed from the main phone Python script.
To program it dial 4 to put it in program mode then enter the phone number to store, prefixed with the position you'd like it stored at.

e.g. 4123 will add the number 123 at position 4 in the phone book.

Dial 4
...enter index then number

Dial 1 to look at the phone book entries...

 To dial a phone book entry it's 1x, where x is the entry position of the number..

On/off switch...

The Pi doesn't like being suddenly disconnected from the power, this is a full Linux distro and therefore likes to be shutdown properly before being powered off.

If you dial a 6 on the phone, wait until it ring through, it will shut down the Pi. Now the power can be shut off by switching off the power.

On the back one connection if obviously the receiver, the other is used for the USB plug to the LiPo battery. Nice and neat!

Battery power...

Up to now I have been using 6AA 2000mAh rechargeable batteries to power the RPi, this gives an uptime of about 3.5 hours estimated current draw of 575mAh. Obviously not that good for a modern phone. I have now purchased a 12000mAh LiPo rechargeable "phone extender" type battery. Unfortunately this measures 10.5x10.5x2.5cm and won't fit in the phone casing, but should give (12000/575) 20 hours of operation.

On the LiPo there are 2 USB outputs - one 5.0V @ 2.1A for iPad type devices and one for phones. The Pi plugs directly into the 5v 2.1A  output and works a treat. The other output is 5.5V @ 1A and is labelled as being for phones - it even comes with a Nokia 2mm adapter. Great this can power and recharge both Pi and Nokia. Unfortunately, although the Nokia initially appeared to charge form the LiPo, it keeps displaying "Charger not supported" and stops charging. Not sure whether this is the 5.5V not being enough (the original Nokia charger outputs 7V) or something else.

I am going to fit a usb to Nokia charger then expose a USB socket on the side of the phone so at least the nokia can be charged without dismantling the whole thing. Having said that the Nokia standby seems to be about 5 days!

The battery won't fit in the case so I have decided to put it under the phone. I put 4 small plastic feet on the bottom so the phone now sits on the battery - not ideal but not much choice.


Using the orginal hand-set microphone and speaker...

Up to now I have used the Nokia hands free kit, plugged into the phone then concealed in the old phone handset, bit of a cheat!I then began to wonder if the original hand set mic/ear would work.

I purchased a 2.5mm ear/mic jack plug from ebay, soldered 4 wires to it - which was very fiddly (this is for a stereo connection which wont be needed) connected it to one of the other old handsets I had, plugged it into the Nokia and bingo! Made a call. The 40 year old speaker was deafeningly loud, which surprised me.

 Nokia hands-free cheat

The old hand set wired up to the Nokia jack plug.
Check this reference!
http://www.samhallas.co.uk/collection/bits_hs3.htm
This brown hand-set is form the 70s, the cream phone I have used is from the 80s, one of the differences being that the internal microphone is different. When I connected the 80s handset the Nokia would not recognise as a "hands-free" kit which it needs to in order to work. So I swapped the mic from the older phone to the newer one and it worked fine. So either the new version of the mic is faulty or there is something about the older mic that is recognised by the Nokia. I will take some impedance measurements, or look on Wikipedia and see if I can find out.

Thursday 20 March 2014

RPi Phone schematic

This is the schematic for the Pi Phone. Note the use of the 3.3V and 5V, apparently you have to be careful not to cross the beams or you can blow stuff up.

Note also that I have chosen the simplest (i.e. cheapest) LCD display, they are available in all colours. These are not the ones that can handle a serial connection, these are £20 each, the ones I bought were £3.

I produced the above schematic using TinyCAD and very well supported and simple to use piece of software - only available for Windows though. I also used VCAD - not for this simple circuit, but for the ringer that I built some time ago - which will transform the "net" exported from TinyCAD to a Veroboard design.

1) When using TinyCAD make sure you are using the components from the VeeCAD libraries
2) In TinyCAD: Special -> Create PCB Net List, export as Protel.
3) For the extra components you'll have to create a component in VeeCAD

Saturday 15 March 2014

Massive progress....

I have been using the Raspberry Pi with the GPIO & Python to read the pulse dials from the phone, this is fairly straight forward (it's strange that when something doesn't involve "C" it becomes straight forward!!!).

I decided that the phone should have a display, this is a 16x2 line LCD, powered from the RPi. All of the dialling logic is handled by the RPi + Python, the phone is simply receiving an ATD modem command with the dialled number.

Likewise for an incoming call the ringing is detected by listening for the incoming call command then answered when the BT phone is picked up. I should have mentioned at this point that the two actions that are read from the phone are the rotary dial and the on/off hook switch. Much of the logic is exactly the same as the PIC version,which goes something like this:

makeCall(number):
  write("ATD"+number+";\r\n)

endCall():
  closeSerial()

answerCall():
  while(1):
    openComms()
    write("ATA\r\n")

inCall():
  while(1):
    if(OnHook):
      endCall()

waitingForCall():
  while(1)
    val=readSerial()
    if (val == "R"):
      return 1

getNumberGPIO():
  while(1):
    if(pulseDetected):
      # throw away first pulse as this is the anti-clockwise dial
      num=num+1
    if(pause > 0.5):
      numStr=NumStr+str(num)
      num=0
 
while(1):
  if (offHook):
    num=getNumber()
    makeCall(num)
    inCall()
  if (onHook)
    answer=waitForCall()
    if(answer == 1)
      inc=answerCall()
      if(inc == 1)
        inCall()




I have discovered a new toy....a crimper for making connectors, the kind you fit to jumpers. Anyway this makes prototyping a lot quicker, once you've made the wires, and my production hardware also uses these jumpers.

The downside to the jumpers is that they use a bit more space, the obvious alternative is to just solder directly to the  veroboard.

On to the phone, I have, unfortunately, had to remove the ringer solenoids and the bells because I broke my ringer circuit AND there isn't room in the phone for the PRi and the Nokia and the ringer circuit. One of the biggest space consumers is the USB cables. I am awaiting for some 90deg ones to arrive from China.

The RPi circuit design

As you can probably see this is as expected. Only joking, I will post the circuit diagrams when I have drawn them up, basically it's a couple of pull-down resistors, one for the pulse detection of the rotary dial, and one for the on/off hook.

I have put the two circuits - each consisting of 2 resistors, on a small piece of veroboard, along with the 10K pot for the LCD display.

Fitting the LCD display, tastefully, to the BT phone casing.





 
I used a pair of dividers, like a pair of compasses for drawing a circle but with 2 spikes, to measure the overlap of the underside of the LCD display. Once marked with the dividers, I then drilled through with a 0.5mm drill bit then used a Stanley Knife to cut the rectangle out.

Ringing

Having had to remove the solenoids and bells from the phone I am using a Nokia ring tone that sounds like a.....phone!! Works fairly well and sounds reasonably authentic.