Im thinking of using this for building a DTMF control transceiver. The idea is to be able to poll and control relays and sensors via a Ham radio repeater.
You could have done a port read, "AND" with mask, and shift left if required to get input value. should be faster than single bit port reads and processing. Brings back memory's, we used to make field telephones which used DTMF for signalling between telephone and exchange. I've forgotten how many channels we used to get over a single pair of D10 wires. RF below 300kHz was all we had to get all the channels in.
@@amosba yeah when it comes to software, sometimes I do the equivalent of designing a PCB with three 10 K resistors in series instead of a single 30 K resistor, assuming I don’t need to spread the power dissipation across the three and there’s no other good reason to have done it!
We're not talking crazy speeds here. So I would rather use some digitalReads() and keep everything more readable en portable then to have to look up the ports and document it in the code.
@@tengelgeer yeah I did a little research and if we were to want to read in an entire port we would have to use chip specific things and bypass Arduino and we don’t really need to optimize like that for something like this project. And even if I was on the edge of needing to optimize, I think I have at least an extra 30 ms that I can play with because I only want the tones to play so fast and the hardware can detect them still going 30 ms faster so everything should be fine.
You should refactor lines 70 thru 101 into another for loop in DTMF_Generate ... and the function dtmf_decode could return an array element based on index recv_data instead of using that switch statment. Cool stuff! 😄👍
Yeah I just scrapped everything together at the last second to get it going, if I keep up on projects like this I will develop a bag of tricks in no time.
This is a great project and exactly what I have been looking for for my current project. But 1 question. Could someone point me in the direction of capturing (if Im using the right terminology) DTMF strings and executing a function once a series of numbers are received, such as, once a 4 digit code is received, a function is executed. Thanks
In the code here for a work in progress phone line simulator, I do that to wait for a phone number to be dialed github.com/GadgetReboot/misc_file_bin/tree/master/2022_11/Telephone_Central_Office_wip/rev3 It's a messy project with the relevant code split between 2 of those project files but near the top of the main sketch there's a phone number variable that holds the valid number to detect, then later in the sketch it keeps checking if a DTMF key has been pressed by calling a function that's in another misc functions file there. It will keep adding the new DTMF keys to a string until it matches the valid phone number and then can do something else.
Hi !! I bought two of these modules, but when connected VCC and GND, it makes a little fast flash of one led, and nothing else. What do I do ? thanks !
are you referring to having purchased Arduino Uno boards or MT8870 DTMF decoder boards? in either case if you just buy them and then connect power to them nothing is going to happen. You need to put software in the Arduino boards and for the DTMF decoder board you need to give it DTMF audio tones through the jack and the LEDs will show a binary representation of any tones detected.
Very good project! Could you consider reimplementing the encoder in software on a esp32 or STM32 using the Arduino? Would that interest you and others here? It would make a perfect phone interface.
@@GadgetReboot I won't mind helping. Timed delays on these that run rtos does not work, like it does on the stock atmega, due to non deterministic scheduling of threads. So for example, on the esp32 we would have to either use the rmt or the i2s dac
@@subhobroto Of course you don't need to use an RTOS, RTOS are ok for a lot of things but on microcontrollers is easier to keep to a single thread in my opinion. setting up DMA would release the core from a lot of the timings.
A little bit nerdy but very cool 😁
Thanks for sharing
Helpful video
Im thinking of using this for building a DTMF control transceiver. The idea is to be able to poll and control relays and sensors via a Ham radio repeater.
You could have done a port read, "AND" with mask, and shift left if required to get input value. should be faster than single bit port reads and processing.
Brings back memory's, we used to make field telephones which used DTMF for signalling between telephone and exchange. I've forgotten how many channels we used to get over a single pair of D10 wires. RF below 300kHz was all we had to get all the channels in.
@@amosba yeah when it comes to software, sometimes I do the equivalent of designing a PCB with three 10 K resistors in series instead of a single 30 K resistor, assuming I don’t need to spread the power dissipation across the three and there’s no other good reason to have done it!
We're not talking crazy speeds here. So I would rather use some digitalReads() and keep everything more readable en portable then to have to look up the ports and document it in the code.
@@tengelgeer yeah I did a little research and if we were to want to read in an entire port we would have to use chip specific things and bypass Arduino and we don’t really need to optimize like that for something like this project.
And even if I was on the edge of needing to optimize, I think I have at least an extra 30 ms that I can play with because I only want the tones to play so fast and the hardware can detect them still going 30 ms faster so everything should be fine.
You should refactor lines 70 thru 101 into another for loop in DTMF_Generate ... and the function dtmf_decode could return an array element based on index recv_data instead of using that switch statment. Cool stuff! 😄👍
Yeah I just scrapped everything together at the last second to get it going, if I keep up on projects like this I will develop a bag of tricks in no time.
Is this for WarGames 3 ?
So with 16 tones, we can use those tones to represent hex characters. We can transmit data, four bits per tone, with dtmf.
This is a great project and exactly what I have been looking for for my current project. But 1 question. Could someone point me in the direction of capturing (if Im using the right terminology) DTMF strings and executing a function once a series of numbers are received, such as, once a 4 digit code is received, a function is executed. Thanks
In the code here for a work in progress phone line simulator, I do that to wait for a phone number to be dialed
github.com/GadgetReboot/misc_file_bin/tree/master/2022_11/Telephone_Central_Office_wip/rev3
It's a messy project with the relevant code split between 2 of those project files but near the top of the main sketch there's a phone number variable that holds the valid number to detect, then later in the sketch it keeps checking if a DTMF key has been pressed by calling a function that's in another misc functions file there. It will keep adding the new DTMF keys to a string until it matches the valid phone number and then can do something else.
Hi !! I bought two of these modules, but when connected VCC and GND, it makes a little fast flash of one led, and nothing else. What do I do ? thanks !
Did you just power that module by itself or did you set up something to generate DTMF tones to play into it?
@@GadgetReboot Just positive and negative
are you referring to having purchased Arduino Uno boards or MT8870 DTMF decoder boards?
in either case if you just buy them and then connect power to them nothing is going to happen.
You need to put software in the Arduino boards and for the DTMF decoder board you need to give it DTMF audio tones through the jack and the LEDs will show a binary representation of any tones detected.
Where to download the synth.h zip library ?
github.com/dzlonline/the_synth
Very good project! Could you consider reimplementing the encoder in software on a esp32 or STM32 using the Arduino? Would that interest you and others here?
It would make a perfect phone interface.
It would be worth trying, I'll add it to a to-do list
@@GadgetReboot I won't mind helping. Timed delays on these that run rtos does not work, like it does on the stock atmega, due to non deterministic scheduling of threads. So for example, on the esp32 we would have to either use the rmt or the i2s dac
@@subhobroto Of course you don't need to use an RTOS, RTOS are ok for a lot of things but on microcontrollers is easier to keep to a single thread in my opinion. setting up DMA would release the core from a lot of the timings.