Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Simple programming help

Status
Not open for further replies.
Not quite right.

The transistor needs to be "biased", technically that means the correct base current has to flow in order that it isn't forced into a non-conducting state or a fully conducting state but somewhere between the two. In that middle state, a small amount of bias change will make a large change in collector current and amplification is achieved. What Cc does is allow the signal (the audio waveform) to change the bias and therefore be amplified but still isolates any steady voltage that is present on the radio output connection. For example, if the Cc wasn't there and the radio had an 8 Ohm loudspeaker between the output connection and ground, all the current through Rb would flow through the loudspeaker instead of the transistor and it would never conduct. Likewise, if the radio output had say 6v on it, the transistor would be forced so hard into conduction it could be damaged. The capacitor keeps the bias voltage and anything other than the signal separated.

The collector of the transistor will have a voltage on it because current flows through RL. As in the case of Cc, what we want to do is keep that voltage out of the DAC and only let the signal through so we use another capacitor to block the steady voltage. After that capacitor there should be an amplified version of the signal from the radio. The diode comes next, it's purpose is to rectify the signal because the DAC will not measure negative voltages and can be damaged easily if a negative voltage reaches its input pin. The diode 'blocks' the negative half of the signal while letting the positive parts of the cycles pass through. Don't get fixated on the 0.7V drop, that's the forward saturation voltage and isn't too important in this application. The positive cycles now need something to average them so the voltage from them rises according to how loud the audio is, another capacitor, after the diode and connected to ground works as a reservoir, it tops up from the incoming signal and holds the peak voltage it gets from the diode. The ADC can easily read this because it is the correct polarity and only changes slowly. Finally, the reservoir should have a resistor connected across it to allow some of the charge to leak away. A low value resistor will leak it faster and the voltage will more closely follow the signal, a larger ne will mak the change slower. You need a compromise value that allows a quick enough response to sound but doesn't make the ADc reading drop too low in short pauses or interference.

Brian.
 

Not quite right.

The transistor needs to be "biased", technically that means the correct base current has to flow in order that it isn't forced into a non-conducting state or a fully conducting state but somewhere between the two. In that middle state, a small amount of bias change will make a large change in collector current and amplification is achieved. What Cc does is allow the signal (the audio waveform) to change the bias and therefore be amplified but still isolates any steady voltage that is present on the radio output connection. For example, if the Cc wasn't there and the radio had an 8 Ohm loudspeaker between the output connection and ground, all the current through Rb would flow through the loudspeaker instead of the transistor and it would never conduct. Likewise, if the radio output had say 6v on it, the transistor would be forced so hard into conduction it could be damaged. The capacitor keeps the bias voltage and anything other than the signal separated.

The collector of the transistor will have a voltage on it because current flows through RL. As in the case of Cc, what we want to do is keep that voltage out of the DAC and only let the signal through so we use another capacitor to block the steady voltage. After that capacitor there should be an amplified version of the signal from the radio. The diode comes next, it's purpose is to rectify the signal because the DAC will not measure negative voltages and can be damaged easily if a negative voltage reaches its input pin. The diode 'blocks' the negative half of the signal while letting the positive parts of the cycles pass through. Don't get fixated on the 0.7V drop, that's the forward saturation voltage and isn't too important in this application. The positive cycles now need something to average them so the voltage from them rises according to how loud the audio is, another capacitor, after the diode and connected to ground works as a reservoir, it tops up from the incoming signal and holds the peak voltage it gets from the diode. The ADC can easily read this because it is the correct polarity and only changes slowly. Finally, the reservoir should have a resistor connected across it to allow some of the charge to leak away. A low value resistor will leak it faster and the voltage will more closely follow the signal, a larger ne will mak the change slower. You need a compromise value that allows a quick enough response to sound but doesn't make the ADc reading drop too low in short pauses or interference.

Brian.

Ive always been confused when it came to biasing transistors, your explanation is helping me. So i guess the bias current will depend on the voltage coming out of the radio then?

And the way i understand it, is, i could use a 0.1uF capacitor for Cc?

The other capacitor you are referring to, which would be used to keep voltage out of the DAC, would be placed in series with the positive output from the transistor? Or between RL and the Transistor?

you've been extremely helpful so far, Im so close to getting this working thanks to you!
 

No, bias is provided through the base resistor, the capacitor is there to prevent the radio upsetting the bias. Remember that capacitors block DC but allow AC (the signal) to pass through.
I've drawn a schematic that I hope will explain:


Ca is to prevent the radio upsetting the bias. Cb is to couple the amplified signal to the rectifier diode while stopping the collector voltage reaching it and Cc is the reservoir for the rectified voltage. In conjunction with the 330K resistor, Cc will have a voltage across it which is roughly proportional to the volume of the signal from the radio.

Brian.
 

So that schematic you drew will be the amp to amplify the signal coming from the radio. This will then be fed into the micro-controller, which will be used for triggering purposes, and then into the recording chip to be recorded.

The sound then coming out of the recording chip will have to be fed through the "mic" of the radio using VOX, to transmit the message. But would that sound be to high in voltage and damage the radio? I would just put it through a potentiometer correct?

By the way Brian, i sent you an email.

Thanks
 

Got the email thanks! Hopefully the replies here answer your questions.

The sound recording side of things stays as you originally planned it, only the triggering audio needs amplification. If the level from the recording IC is too high, use a potentiometer as a volume control to adjust the level until it is right. Without information on the radio I can't tell you what fixed value resistors would be optimal but using a potentiometer instead will allow you to set it by trial and error. Feed the output from the recording IC to the top of the potentiometer, ground the bottom side and take the audio to the radio from the wiper (center) connection. Basically, you are using it like a conventional volume control but on the input to the radio rather than the output of it.

If you build the circuit I gave, you should find that using the DC voltage range on a test meter, you get almost nothing when measuring the output directly from the radio and a few volts at the DAC connection point. The voltage should rise and fall according to how loud the sound is.

Brian.
 

Hi Brian,

im still keeping up with you here. Ive just been extremely busy lately but i will be working on this project tomorrow. That schematic that you provided will be to amplify the signal(boost the voltage) coming out of the radio so it can be read more accurately by the ADC on the micro-controller correct?

Once i do that, all i need to do is put the output of my recording chip through a pot, and adjust it properly as to not overload the "mic input" on the radio. What would be a good resistance to start out with, 500k, and then work my way down from there? Im not sure what kind of voltage is sent into the radio from a headset.

im getting pretty excited about this project as it is all coming together!

thanks again!

---------- Post added at 20:56 ---------- Previous post was at 20:36 ----------

Alright, so my radios, the SX700 motorola talkabouts dont have a VOX option. They have the iVOX, which means if you just have the radio itself, you can set the iVOX to active, that way when you talk, it detects your voice and transmits. But if you plug in a headset that has a VOX mic, it is always transmitting. So i picked up a headset with a PTT mic, which makes me think im going to need to build a circuit to switch the "ptt" function on automatically now.
 

You are correct on all points. A good starting value for the transmit level potentiometer would be 10K and preferably with a logarithmic characteristic. Being logarithmic (as opposed to linear) just means the signal from the control follows human hearing levels more closely as it is rotated. Hearing is approximately logarithmic, as sounds get louder our perception is the increase becomes less, it's what allows us to hear a pin drop at one end of the volume spectrum and hear a jet fly over at the other when one is many millions of times louder than the other.

If you can't use VOX, there is a simple software solution. When your ADC hears a signal and starts the recording process, start a timer in software, when the signal stops, stop the timer and note how long it lasted. This gives you the duration of the incoming sound and therefore how long it takes to transmit it again. Connect one pin of your microprocessor to the PTT line (through an interface if necessary) and when you start the playback, use the pin to hold the PTT in transmit for that period then release it.

Brian.
 

Alright, just a little update. When radio number 1 transmits to radio 2 (the one with the headset) i measure 1.97 volts, using a voltmeter, coming out of the headset, no matter the volume on the radio 2. And zero volts when radio 1 isnt transmitting.

---------- Post added at 20:54 ---------- Previous post was at 19:48 ----------

I was looking at the data sheet for my recording chip (The ISD1790P) and the max input voltage a to recorded is 300 mV P-P when using a 5.5v power supply. Im using just over 4v, something like 4.33 volts. That means max input voltage should be lets say, 250 mV P-P. But like i said, the voltage coming out of the radio is 1.97 volts. I guess another potentiometer is in order, but i dont believe i have a logarithmic pot. What else would work, just a regular pot?
 

When you measure 1.97V, where are you measuring across?

There are two likely sources of the voltage, one is the output of the earphone connection, coming from the amplifier in the radio, the other is a supply to the microphone. Some radios use 'electret' microphones which need a voltage in that region to operate them. In either case, P-P (Peak to Peak) refers to the signal level, not any DC voltage it is 'sitting on'. Capacitors in line with the signal will block DC while still letting the AC (signal) part through. If the signal level is still too high, yes, a potentiometer to allow you to adjust it would be the best solution.

Brian.
 

I measured it from ground to the positive of the speaker output. It is zero volts when nothing is happening and 1.97 when the radio is receiving.

As you can see in the pic, there are 3 pins. The lowest one is ground (green wire), the middle is the speaker output (red wire), and the top is the mic, (blue wire).

on the very right of the circuit board, is two wires going out to the earphone, which now that i think of it, i never measured voltage off of that.

**broken link removed**
 

Sorry but I'm still confused (probably due to advancing years!).

The microphone (cylinder with the black cloth top) is an electret type so it need voltage across it to function. If you are not familiar with electrets, they have a simple amplifier inside them which needs around 2V to operate, hence me being confused when you say there is 1.97V across the speaker wires. Normally there would be almost nothing across the speaker wires except the AC voltage driving the speaker coil.

What is on the reverse side of the board? It looks like a two pin device is soldered between the pads in the middle. Can you also see where the earphone wires are joined, I presume they pass through the board and continue with the three wires you highlighted back to the radio itself.

Incidentally, if the chip in the background id the PIC it should have decoupling capacitors across it's supply pins or it wont work.

Brian.
 

Ok, i put a voltmeter across the two pins identified in the first picture. One is ground, the other is speaker +. When the radio is not receiving anything, it is zero volts. As soon as the radio is receiving a message, it jumps to 1.97 volts.

Here is a pic of the other side of the board, these two wires go up to the single ear bud.

I measured voltage across these two wires as well, and its the same thing, zero volts when not receiving, and 1.97 when receiving.

**broken link removed**

---------- Post added at 17:16 ---------- Previous post was at 17:13 ----------

And as seen in the first picture, when i measure from the ground to the blue wire, (which is the microphone), i get 2.4 volts. It is originally zero, but i guess when i put my meter across to measure voltage, it triggers the mic and jumps to 2.4 volts.
 

Good news Brian!! I got part of it working now!!!

I plugged the radio into the pic and recording chip. When i talk to it, it records the message, and then re-plays on a speaker coming out of the ISD1790P. Now, i just have to put some de-coupling capacitors from the speaker output and maybe a pot, and it should work!!

Ill give that a shot, and let you know.

I really appreciate your help.
 

Alright Brian, the beast is alive!! Ill be heading out in the bush soon to test out the range enhancements of the system!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top