Evaluation of frequency 1750Hz Vpp=3V on C.2

ok1if

New Member
I use a PICAXE 08M2 for one project. I have a free C.2 port and I would like to evaluate whether a sine signal with a frequency of 1750 Hz is coming to this port (it occurs on a speaker with an amplitude of about Vpp=3V). If so, I need to save log 1 in some registry. Has anyone already solved this problem?
Thank you for your help
Milan Stejskal
 

Buzby

Senior Member
A simple diode/resistor/capacitor circuit would easily detect any 3V signal at the speaker terminals, but it would not be able to discriminate the frequency.

Is it important that you only detect 1750 Hz ?
 

piclt

Member
Have you a scope.......look at it and measure it on a scope....??
If you don't have a scope connect it to linein on PC/Laptop input and look at it and measure it using Audacity.
If amplitude is too high for linein use a voltage divider or pot....
You can then export your recording as samples if you want..and plot the values or whatever...??
 

piclt

Member
Hi, ok1if.....your initial post....are you trying to generate 1750 Hz within the 08M2 and you are sending it out on pin C.2 and you want to know if it is actually 1750 Hz by measuring the output signal from the 08M2...????
..... OR .... have you a 1750 Hz signal from an external source coming in to pin C.2 and you want 08M2 to detect it and measure its frequency etc etc.

...... and which will be the more difficult......generating a 1750 Hz sine wave on a 08M2 or ..... detecting and measuring a 1750 Hz sine wave using a 08M2
 

Buzby

Senior Member
I thought the OP was asking about detecting the 1750 Hz signal which is driving the speaker, then logging the time/date or similar when the tone is detected. It sounds like some kind of alarm, and the OP wants to record when it occurs.

If the tone is the only signal that the speaker emits, then a simple R/C envelope detector will do the job. However, if the speaker is also used for voice, or other specific tones which don't need detecting, then the NE567 solution will be needed.

More info from the OP would help narrow down the solution.
 

ok1if

New Member
A simple diode/resistor/capacitor circuit would easily detect any 3V signal at the speaker terminals, but it would not be able to discriminate the frequency.

Is it important that you only detect 1750 Hz ?
sVám
A simple diode/resistor/capacitor circuit would easily detect any 3V signal at the speaker terminals, but it would not be able to discriminate the frequency.

Is it important that you only detect 1750 Hz ?
Yes I need to detect 1750Hz
 

ok1if

New Member
Hi, ok1if.....your initial post....are you trying to generate 1750 Hz within the 08M2 and you are sending it out on pin C.2 and you want to know if it is actually 1750 Hz by measuring the output signal from the 08M2...????
..... OR .... have you a 1750 Hz signal from an external source coming in to pin C.2 and you want 08M2 to detect it and measure its frequency etc etc.

...... and which will be the more difficult......generating a 1750 Hz sine wave on a 08M2 or ..... detecting and measuring a 1750 Hz sine wave using a 08M2
I have signal and when is 1750Hz I need to set some register
 

ok1if

New Member
Thank you all for your help and inspiration. I probably need to clarify my problem more. The voltage whose frequency I need to evaluate as LOG 0 or LOG 1 is a normal sine signal, which can be e.g. 1000Hz, 1350Hz 2100Hz, etc. However, I only need to know if the received signal is not 1750Hz (plus or minus 5 percent). As soon as 1750 Hz appears, I need the processor to do some action. Until then, it can be in a waiting loop just watching the input frequency.
 

Buzby

Senior Member
This 1750 Hz tone, how long is it ?.

1s sec ? 5s ?. 0.2s. ? etc.

The Picaxe could detect the tone directly if the time is long enough, but it would be more reliable to use a NE567.

If the different frequency tones overlap, or the 1750Hz is very short duration, the Picaxe will struggle to identify it.

A purpose designed tone detector chip, NE567, will be much easier and more reliable. It will provide a digital on/off signal when the specific tone is detected, even if there is interference with the target tone. The Picaxe can just use this digital signal to log the time, or whatever.
 

ok1if

New Member
This 1750 Hz tone, how long is it ?.

1s sec ? 5s ?. 0.2s. ? etc.

The Picaxe could detect the tone directly if the time is long enough, but it would be more reliable to use a NE567.

If the different frequency tones overlap, or the 1750Hz is very short duration, the Picaxe will struggle to identify it.

A purpose designed tone detector chip, NE567, will be much easier and more reliable. It will provide a digital on/off signal when the specific tone is detected, even if there is interference with the target tone. The Picaxe can just use this digital signal to log the time, or whatever.
About from 2 to 4 sec
 

PieM

Senior Member
On a 08M2 , C.2 is a Schmitt trigger type. So high level must be 0.8 * Vsupply. If your Vpp is 3V, you need a diode, so the signal will be too low.
 

Buzby

Senior Member
Thinking on it a bit, some galvanic isolation may be needed. A simple opto-isolator will do the job easily.

The two 150R resistors limit the opto current to 10mA. There is one from each speaker connection to offer some protection to the amplifier against shorts in the add-on circuitry.

The opto-isolater shown is a dual-diode device, so it will generate twice the input frequency. Maybe better to use a single diode version.

The 100K resistor gives a solid pull-down when the opto is 'off'. The 1K resistor is a 5mA load for the opto.

This type of circuit should give a good signal to the Schmitt trigger on C.2, so then you just need to measure the frequency, which we will cover later.

As PieM suggested, a simple diode envelope detector is not going to be reliable with a Schmitt input, unless maybe you are running the Picaxe at 3V. Either way, I think the opto-isolator is a safer solution.

25960
 

Buzby

Senior Member
The opto circuit will work with 3v, but you may need to search for an isolator that can pull the output lower, maybe something like TLP241BP.
 

piclt

Member
What is method of isolating the 1750 Hz signal if ok1if doesn't want any external hardware or band pass filter etc solution..... Can Picaxe do it itself...??
 

Buzby

Senior Member
The opto-isolator serves two purposes.

1, It provides a definite high/low level. Because the Picaxe is running on 3v, the C.2 Schmitt trigger theoretically needs a minimum of 2.4v to guarantee correct operation. It's good practice to use circuits that provide reliable signals to microprocessors, because then all your problems become software ones. It's difficult to debug hardware and software simultaneously !.

2, It totally removes the possibility of high voltages entering the Picaxe, which would pose a risk to both the electronics and any person using them. You have not told us how the tone generator is powered. If it is mains powered then I would think again about any kind of direct connection. Why do you need to connect to the speaker electrically ?. Could you use some kind of microphone, maybe like a piezo disk ?

The Picaxe has no method of built-in isolation, I don't know of any microprocessor that has.

The Picaxe can easily measure a single continuous frequency, but it will need a 'clean' signal and no interference.
 

erco

Senior Member
Personally I like the LM567, old hardware chips have a special place in my heart.

That said, on a clean sine wave you can simply use the COUNT command to determine frequency. My two attached demo videos show audio frequency measurement with a BASIC Stamp, and older cousin of Picaxe. Picaxe can do as good or better.


 
Top