Picaxe Dtmf ?

manuka

Senior Member
DTMF via PICAXE ?

I've recently pondered a simple UHF signalling application that may suit PICAXEing, & the marvellous Nov. 2007 DTMF work of Michael Jeffery crossed my mind => http://www.picaxeforum.co.uk/showthread.php?t=8140&highlight=DTMF. Such hacked PICAXE approaches increasingly appeal, as traditional DTMF chips are often now both elusive & quite costly little blighters. Did anyone work this past PICAXE approach up, or nail any quirks?

DTMF of course is legendary for it's robustness, & although slow ("typing speed") will often get thru' in noisy links when all other approaches fail. I'm happy to test & co-ordinate PICAXE ideas (preferably 08M with a coin shop IR TV remote keypad encoder), as I'd like to produce at least a standard approach educationally. Stan
 
Last edited:

kevrus

New Member
I cosidered Michael 2727s code when using DTMF in a recent project, but DTMF chips are quite cheap over here in the UK, less than £1 each for the generator or the decoder, and seem to be readily available, so I used them instead.
 

manuka

Senior Member
Did that include the xtall, & which DTMF chips did you use? Aust/NZ DSE & Jaycar sell the likes of MC145436 & TCM5807 for ~Aust$9 (~GBP4) EACH, & are often out of stock... They're old chips of course, & doing it now via micro is part of the PICAXE approach appeal.
 
Last edited:

kevrus

New Member
I agree that using a micro is appealing. I used the DTMF decoder HT9170, the crystal and caps required were extra, but only cost me a few pence. As the project is controlled via the telephone, I had no requirement for the tone generator so cannot comment on that, but the available chip is an HT9200. Both chips made by Holtek.
 

moxhamj

New Member
Kevus, do you have a schematic for that? It sounds very interesting, especially since Futurlec sell the 9200 for 60c and the 9170 for 50c.
 

212

Senior Member
Lots of Picaxe projects can be done with something else, but please don't let that stop you! I'm really interested in this, and I'll surely put it to use. I would like to be able to use a Picaxe, or two, on the receive end also.
 

kevrus

New Member
I never actually done a diagram of my circuit, it went from breadboard to PCB...keep meaning to do one but haven't got around to it yet (and the project is currently bieng reworked to incorporate other functions and a graphic LCD, but I digress...)

Heres a link to the 9170 datasheet
http://www.rapidonline.com/netalogue/specs/82-4078e.pdf

I used application circuit no.1 on page 9, only change bieng to reduce the 100k down to 10k from the 0.1uF going into pin2.

From the DTMF i/p, I connected another cap and series resistor to an opto-isolator...this provided a pulse when the line is ringing for the picaxe to count and then answer via a relay. In the UK, connecting a 220R across the phone pair via this relay simulates the phone bieng off the hook and stops the ringing.
 

manuka

Senior Member
Good find- I know these HT9170 (Decoder) & HT9200 (Encoder)- both are late '90s era- but had never seen them at those low prices! Futurelec Australia is also handling them at well under an Aussie $1 too. Further more the 9200 "A" version is a temptingly small footprint DIP8, & looks (serial driven) PICAXEable. Generating suitable DTMF is often of course a greater need than decoding, as numerous systems have the latter inbuilt.

At such prices it seems tempting to forget PICAXE generating & just use them instead. Any other finds/experiences? Stan
 

Attachments

moxhamj

New Member
That is a great teaser schematic.

DTMF could be a great solution for a reliable radio link. Speed isn't always the major factor - reliability is important too. As a generic idea, start with register b0=10 in a picaxe => clock/data to dtmf transmitter => radio transmitter => radio receiver =>dtmf decoder => picaxe => b0=10.

Do you think that could be possible?
 

manuka

Senior Member
That's indeed pretty much what I've been considering! In my case it's related to the Oz/NZ "white elephant" Ch.22/23 UHF CB data channels. Their crazy "3 seconds an hour" ruling has so spooked everyone out that nothing much is available at all -as you no doubt know.
 

kevrus

New Member
One thing that may be worth noting, is that the outputs on the 9170 latch...if pin 5 (INH) is pulled low (done internally), pin 15(DV) goes high indicating a valid tone has been recieved. Pulling pin 10 (OE) high will output the code onto D0 to D3 which will then remain until another tone is recieved.

In my project, when the 'line' is answered, I just monitor pin 15(DV) until it goes high, (could be done with an interrupt) after which I make pin 10(OE) high, and then I have plenty of time to read and action the coded outputs.
 

kevrus

New Member
Here's a link to the project and the full project code...

http://www.picaxeforum.co.uk/showthread.php?t=11716

Breaking down the code to whats relevant for the 9170...

Code:
symbol DV=pin4
symbol OE=output7


sub_routine_name:

do
if DV=0 then loop			'loops until next DTMF signal is recieved and 'DV' pin goes high
end if

do
if DV=1 then loop			'loops until DTMF 'DV' pin goes low and O/P code has latched
end if
high OE				'turn on DTMF code o/p pins 
pause 5				'slight delay to allow DTMF outout to settle
let b0=pins & %0001111		'read first decoded tone and store in b0, masks high nibble
pause 5				'slight delay before turning off DTMF chip pin O/Pto make sure outputs are read 
debug b0				'show contents of b0
low OE				'turn off DTMF code o/p pins
pause 200				'200mS delay before allowing new DTMF tone to be recognised
return				'back to the rest of your code
Worth noting that the pauses may not be necessary, I included them to ensure no errors. (note to myself, might be worth trying without)

I haven't used pin6 (PWDN) as my project runs from the mains, but may be useful for battery powered circuits.

Usual disclaimer with all my code...it could be improved.
 

Hooter

Senior Member
As a matter of interest, would it work if used through the VIOP output of an ADSL router - assuming one had VOIP.
Would the DTMF tones be affected in any way.
The router may give the level of isolation required.
Hooter
 

moxhamj

New Member
That is an interesting suggestion, hooter. Use voice over internet/skype etc as a modem or dtmf system. I think it would work. dtmf is very noise tolerant. If you can hear speech then dtmf would work. You might not even need a physical connection to the PC. I'm thinking of a small microphone/amp next to the pc speakers, and a small speaker next to a microphone plugged into the back of a PC. Just need to keep them apart so you don't get howlround, but you need to do that anyway with skype etc.

Kevrus, that code looks great. It seems you may be our resident dtmf expert!

I think I can hear the sounds from across the Tasman of manuka getting out his breadboard...
 

Hooter

Senior Member
My router has a socket for an additional VIOP phone. Kevrus's unit could possibly be able to directly connect to this point removing the need for any audio type connection and still be legit - maybe.
Hooter
 

moxhamj

New Member
I think it ought to be legit, as you are not connecting to the POTS directly if you connect something into a VOIP socket. There will still be the isolation transformer in the router. But there might be some issues with impedence matching. Some interesting circuits and discussion here http://vital.pri.ee/PSTN/ This talks about putting a standard telephone on a VOIP socket. Standard telephones have keys that produce dtmf tones when pushed, and there is mention of adjusting capacitor values so short tones get through.

And talking directly to a PC - the dtmf transmitter might be able to go straight into a PC soundcard's line in socket, maybe via a volume pot. Some tweaking might be involved there. And soundcard out might be able to go directly into a dtmf chip.

Any dtmf circuit might benefit from having both microphone and line in inputs, and speaker plus line out outputs. Those are pretty standard circuits.

But for proof of concept, picaxe to picaxe comms via dtmf/radio would be a great demonstration.
 
Last edited:

manuka

Senior Member
Breadboard already in action- I've been sidetracked by an attempt on single 08M DTMF using background PWM for the 2nd "tone". The supercheap Holtek offerings make it hardly worthwhile now. Stan
 

premelec

Senior Member
BTW when I looked into it a few years ago the maximum DTMF speed [for common equipment] was about 11Hz and had apparently been determined by Radio Shack rather than some standards body.... so you could probably send 10 char/sec with commercial decoder chips... quite useful for many uses...
 

nickwest

Member
Manuka, did you have any luck sourcing an HT9200 "A" chip? Its 8pin footprint and serial inputs sound perfect but I've only been able to find the parallel version. I'm in .au but have had a good look via google without much luck.
 

manuka

Senior Member
Futurelec (both Aus. & USA) have them at trivial prices, although of course DTMF chips are in run out mode. This really is all the more reason why a PICAXE approach may have some longer term mileage- encoding speed is not really an issue at just a few ch/sec of course.
 
Top