Maker Pro
Maker Pro

university project help plzzz

hfboueri

May 14, 2012
4
Joined
May 14, 2012
Messages
4
i need to turn on a led using any tone
they told me i need a pic16f877a and cm8870pI to convert ac signal to binary
is there any circuit about such subject here
sorry for asking such question but am new here
 

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
Hey, welcome to the forum. Never be sorry for asking a question.

There are actually a couple current threads about turning on a citcuit (LED or other device) using audio. One is about sound activated LEDs and the other is about turning on a switch with an electrical audio signal. (no sound, just signal.) I'll try and find a link to the threads. Both are on-going conversations.

What is your tone? Sound from a speaker? Or, an electrical tone signal?
--tim
 

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
Here is one thread. The poster is activating a device from the audio output jack of an MP3 player. There are different methods discussed like relays and transistors. It is a audio signal rather than audible sound that is used.
https://www.electronicspoint.com/activate-tiny-relay-headphone-jack-please-help-t247362.html

Here is the other. My mistake... This is also triggered by an audio signal, not triggered by sound itself.
https://www.electronicspoint.com/led-light-box-troubleshoot-t247751.html
She (the original poster) was following an instructable to make lights lite up along with the music from an audio output. They found a better way to do it than the Instructable proposed.

I no nothing about such things, but I found both to be very educational. You should check them out.

Also, go ahead and describe your project in detail.

--tim

Also, I don't think you need a PIC or any microcontroller for this, but maybe that is another way.
 
Last edited:

hfboueri

May 14, 2012
4
Joined
May 14, 2012
Messages
4
i want to play the sound on my htc phone (polyphonic music)
The cm8870pi changes AC signal to binary
The pic takes that signal compares it with something if true
then turn on a led
i want to put a led and a motor and use 2 different tunes
one turns the led on... the other for the motor
hope u got what i want
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
i need to turn on a led using any tone
they told me i need a pic16f877a and cm8870pI to convert ac signal to binary
is there any circuit about such subject here
sorry for asking such question but am new here

Who's "they"? Is this a class assignment?

EDIT: Duh, it's in your title.
 
Last edited:

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
The cm8870pI is a DTMF (Dual Tone Modulated Frequency) decoder. It's not intended to decode music or voice frequencies. A DTMF Encoder is what your phone uses to dial numbers and a DTMF Decoder what the Tel co. uses to decode them.
http://www.datasheetcatalog.org/datasheet/calmicro/CM8870.pdf

Edit: You don't need a Pic to light the LEDs or decode anything. The decoder will light them directly depending on the DTMF frequency it receives. Each number 0-9 plus * and # have DTMF frequencies standardized and assigned to them. A BCD to Decimal decoder will light 0-9 LEDs.
 
Last edited:

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
Oh, ok.
So, your htc phone can play polyphonic tones which sound just like the Dual Tone Modulated Frequency that the Plain Old Telephone System uses.

Your going to play a tune with your phone. (a series of tones) A circuit with a micropone will pass the tones to the CM8870pl which turns them into a series of binary. You want to compare that binary series to a pre-set binary series and react when it gets a match.

So, by playing a particular melody on your phone, you make something happen. (light / motor)

Did I get that right??

If you just want to respond to one single dual-tone note being played, then the PIC would be overkill, but to respond to a whole melody, a PIC might do nicely.

--tim
 

hfboueri

May 14, 2012
4
Joined
May 14, 2012
Messages
4
Oh, ok.
So, your htc phone can play polyphonic tones which sound just like the Dual Tone Modulated Frequency that the Plain Old Telephone System uses.

Your going to play a tune with your phone. (a series of tones) A circuit with a micropone will pass the tones to the CM8870pl which turns them into a series of binary. You want to compare that binary series to a pre-set binary series and react when it gets a match.

So, by playing a particular melody on your phone, you make something happen. (light / motor)

Did I get that right??

If you just want to respond to one single dual-tone note being played, then the PIC would be overkill, but to respond to a whole melody, a PIC might do nicely.

--tim

THAT IS EXACTLY WHAT I NEED
 

hfboueri

May 14, 2012
4
Joined
May 14, 2012
Messages
4
the idea of the project is to give a signal from a phone to a circuit (not through cable)
the teacher gave me the idea of the tone
if u have better ideas i'll be thankfull
 

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
Awsome!
That sounds like a fun project. I'll have to remember this when I start getting into microcontrollers. I'm not yet, so I won't be able to help much. I love to read these threads, though. I learn a lot.

What skills in this area do you already have? Have you worked with digital electronics and reading datasheets? Have you used microcontrollers? You can program?

You might not find a schematic for this whole circuit anywhere, but there is plenty of information on the PIC and other microcontrollers. There are also some tutorials on the cm8870.

Also, if you google for "cm8870 microcontroller" the first 5 or 6 links are about making a phone controlled robot or something similar to that.

Please don't take the following as any kind of advice. I have not done this. There are things I havn't thought of. Think of it as a newbie sort of brainstorming with you.

I think I would break this project up into these tiny managable steps.

  • Get the cm8870pl to respond to a audio signal form whatever your source is. A microphone? An actual phone? Whatever that is, then understand how it outputs the binary. (serial, parallel, volatge levels? Maybe get the cm8870pl to light an LED so you can see that its working.)
  • Get your PIC to light an LED. This might be the biggest step if your just starting out. You need to set a pin for output and turn it on in your code. Learn to download the code to the PIC. Drive the LED appropriately. (It probably need a resistor of the right size.)
  • Get your PIC to light an LED based on a digital input on one of it's pins. (Set a pin for input and drive it somehow so you can see that it works)
  • Determine how many input pins you need on the PIC.
  • Figure out if the cm8870pl and the PIC can be connected directly or not and deal with that. (Check datasheets for voltage levels and input/output impedence, that sort of thing.)
  • From there on, it's all programing.
  • Program the PIC to monitor the binary from the cm8870pI and respond by lighting the light when it gets just one specific tone and make sure that's working.
  • Then write code to watch the incomming binary and make sure each signal matches one or another stored sequence. As each tone matches increment an index. If there is a mismatch, reset the index. If the index reaches the count of number of notes to be matched, then light the LED.
  • (Oh, yeah. The motor!) Modify the code to compare the incomming binary to 2 different strings of notes and turn on one LED or another depending on which matches. (Ignoring the motor at that part.)
  • Then figure out how to drive a motor from the output of the PIC. Check the volts and max amps of the output and what your motor requires to be driven. You'll need something to switch it I imagine.
  • Get the pic to drive the motor.
  • Make one of those 2 LEDs into a motor.
  • Done I think.

Good luck! Keep us informed. (Keep me informed, so I can learn to do this, too.)
--tim
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Odd, I googled the term polyphonic ring tone an read a few descriptions including this excerpt..

"A polyphonic ring tone can consist of several notes at a time. The first polyphonic ring tones used sequenced recording methods such as MIDI. Such recordings specify what synthetic instrument should play a note at a given time, and the actual instrument sound is dependent upon the playback device. Later, synthesized instruments could be included along with the composition data, which allowed for more varied sounds beyond the built-in sound bank of each phone."

From: http://en.wikipedia.org/wiki/Ringtone

Unfortunately, nowhere did I find anything that stated that polyphonic ring tones are comprised of recognized DTMF tones. DTMF tones are comprised of only two frequencies. No more, no less.

Are you certain that your phone will ring out recognizable DTMF? Just because a ring tone is comprised of mixed frequencies doesn't make it recognized DTMF. There's also the issue of 'capture time'. Music is moving fast . It can't exceed the Decoders capture spec.

http://nemesis.lonestar.org/reference/telecom/signaling/dtmf.html
 
Last edited:

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
Aught! I knew there would be a hiccup or two.

So, a modern smartPhone might make a sound (polyphonic as it is) that is similar to the good 'ol DTMF signals but isn't a match enough for the DTMF decoder.

Perhaps an actual old-style POTS phone should be used to produce the signal to drive this.

In the links I saw with using the DTMF to control a robot they had a cellphone strapped to the body of the robot. I didn't look to close at what they were doing, but I surmised that they were using a second phone to call the one strapped in and manually pressed the answer button to connect the call, and then used DTMF signals phone-to-phone to control it.

The truth is, I don't know how the OP is planning on controling this. hfbouri said, "give a signal from a phone to a circuit (not through cable)" and I'm not sure what that means except that "not a cable" means "not hard wired."

I assumed an audio connected signal at first, then audible sound from a smartPhone, now I don't know. So that is something we need to know. (The source of the driving signal or the method of control.)

About "capture time," according to the DTMF datasheet the "Min Tone Duration Accept" is 40ms. That seems pretty quick to me, but if the melody had to be slowed down to accomidate that, I don't think that's a huge hurdle to overcome.

-t


I just invision myself walking up to the door to my house and wistling a tune to diable my security alarm. That'd be so cool. (But then I don't have an alarm, and I can't particularly wistle. Oh well.)

edit:"I see now that the OP said,"i want to play the sound on my htc phone" so that is the driving signal. If the htc can't make an acceptable DTMF then that is another hiccup!!:endEdit
 
Last edited:

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Aught! I knew there would be a hiccup or two.

So, a modern smartPhone might make a sound (polyphonic as it is) that is similar to the good 'ol DTMF signals but isn't a match enough for the DTMF decoder.

Perhaps an actual old-style POTS phone should be used to produce the signal to drive this.

Tim, Yes and yes. Remote DTMF control has to be on the top wrung of fun, useful and powerful projects. You can turn your home PC on and off from anywhere in the world via the keypad of any phone. Start your car or disable it. The list is endless.

Back in my dark days of dial-up I had two tel lines in my home. One for business and the other for my personal line. I built a DTMF switch box that took its commands from my PC. I didn't even have to write software for it because the dial-up window let me select where I was dialing from. It was just a matter of adding a * for the business line or a # to the dial string for the personal line. This was followed by a hook flash prior to dialing the number to my ISP.

Reading up on extended Hayes Command Sets is useful for working with Telco projects.;)
 
Top