-
Power amp
03/06/2022 at 15:01 • 0 commentsI've been noodling on the power amp stage for a few days. My first thought always goes to the IRF510 RF MOSFET as it's a classic for homebrew radios, has loads of example circuits, and is as cheep as chips. However, it can be a bit fiddly. The biggest problem is the high gate capacitance. 180 pF requires a lot of gate power just to keep it conducting, perhaps as high as 1 W continuous to get full amplification! That's basically a non-starter for a low power portable. Fortunately there are a lot of options out there if you're willing to pay a bit more. I've seen suggestions for 2SK3476 from Toshiba but it's unobtainium right now. However, there's another device from the same family which could be an even better match, the 2SK4037.
This device is designed for 470 MHz but these devices often have acceptable response down to DC. Typical output power is 36.5 dBm with a gain of 11.5 dBm. We'd like more gain but this should be acceptable for a first shot, we can always add another drive stage if we want to get up to a full 5W. This device doesn't list input capacitance but the similar 3476 has an input capacitance of 53 pF so we can assume the 4037 is in the same order of magnitude. At $2.49 in quantities of 10, it's not as cheap as the IRF510 but it's not going to break the bank either. I think I'll buy a couple and see how they work in the HF.
I'll put together a first take on an amplifier stage and post an update. Then it's time to order parts and start breadboarding the design to see if it works.
-
Let's talk about microphones
02/28/2022 at 19:33 • 0 commentsBroadly speaking, there are two main types of microphones we talk about with regards to HAM radio: dynamic and condenser. There's a third, the electret, which is really a type of condenser mic but different enough that we'll consider it separate.
Dynamic mics use a diaphragm connected to a fixed magnet which moves in and out of a coil of wire. This induces a current in the wire which we can amplify and use as our output. It's basically a loudspeaker in reverse. They are durable and easy to use but also are not generally as sensitive as electrostatic microphones due to the mass of the magnet. They are often used as stage mics and for instruments with lots of bass frequencies. They are also quite commonly used with HAM base stations because they are usually pretty inexpensive and don't need special biasing circuitry.
Condenser mics are a type of electrostatic microphone. There's a diaphragm with a conductive coating and a fix plate a certain distance from the diaphragm. This setup acts like a capacitor and when a bias voltage is applied we can measure the change in capacitance and use that as the microphone output. These can be made to be quite sensitive and are commonly used as studio microphones for voice recording. They are a little more difficult to use than dynamic mics since you need to generate a bias voltage. With a studio mic this is usually done with a standardized 48V "phantom" power option on a mic preamp. This works the same way as a bias voltage on a coax line used to power an amplifier near an antenna and a bias tee can be used to inject the voltage. This added complexity usually limits the use of these microphones in HAM radio unless you use a professional mic preamp to feed your radio.
Electret mics are condenser mics which have a static charge permanently applied to the diaphragm which provides the bias needed. An electret capsule almost always has a JFET attached to the diaphragm to provide the initial amplification. Electret mics don't need external bias voltage and are quite sensitive but they are limited to physically small devices. They are very common in small microphones like lapel mics and mics attached to headphones such as the ones on earbuds that work with cellular phones. If you have a small handheld walkie talkie style microphone or a small HT, you are probably using an electret. The other downside to an electret is the need to include a bias resistor since the internal JFET does not have a source or drain resistor. Since he JFET is generating current at the drain, this resistor determines the sensitivity of the mic by converting that current to a voltage. It also determines the impedance of the microphone. The data sheet for the electret will tell you what values are best for that capsule but are typically 1k-2k.
If we are building the mic from a capsule then we need to design the microphone stage to use a specific capsule. If we're using a headset or small commercial mic, this resistor is included in the device and we can assume we'll get a fairly standard voltage range from the microphone plug, usually 1-10mV. Earbuds and small headphones with built-in microphones are inexpensive, portable, and usually of adequate quality for a small radio, especially ones designed for cell phones since they are optimized for voice communication and clarify. I'll assume we'll be using one of these and design to this 1-10mV input range. I'll also include a TRRS (3+ground) jack since this is the usual interface for a cell phone. If you want to use a setup with two TRS or TRS+TS connectors, it's easy to connect those to the headers instead of the TRRS.
Background done, lets get designing. Since the last post, I added a split-rail power supply for he receive side audio opamps. Even though it's not necessarily the best choice for a virtual ground, I used the same opamp for the rail spliiter's virtual ground since we're already ordering the chip. Normally, I'd switch to a TLV9154 which is the same device as the TLV9152 but has 4 opamps in a single package. However, there are none available from digikey or mouser. An extra chip takes up a little more room, uses slightly more idle current, and costs a little extra but none of these should be significant, and if you can't get the chip, you can't get it so you make do. Since we've now got an unused opamp we might as well use it for our mic preamp.
Let's do some quick math. If we're getting, say 5mV from the mic into 1.2kΩ we end up with about 0.02μW or about -47dBm. We want about 37dBm (5W) output. A rules of thumb for drive needed to power a 5W power amp is probably about 50-100 mW, about 20dBm.
I opted for a 3 band equalizer design I've used for music processing which has the benefit of only requiring a single opamp. It's not the best design but should work well enough. I built the circuit in Micro-Cap and fiddled with the tuning potentiometers until I got a curve that was close to the shape we'd like. I then adjusted some of values to change the band frequencies and to flatten the high response to a shelf. It was more fiddle and test than proper engineering but sometimes that's the quicker method. The circuit automatically sets up a virtual ground so it's fed with +12V. The Bode plot below shows the final equalizer curve.
I was running out of room on a single schematic sheet so I cleaned it up a bit with hierarchical sheets. Double click on a block to open the expanded view. Right click and select Leave Sheet to return to the top level.
-
Receiver Audio Circuit
02/27/2022 at 17:41 • 0 commentsI started working through the receiver audio circuitry. I spec'd out what I think is a reasonable circuit but it might require some tweaking once the receiver is built, especially the equalizer points. I've had quite a bit of experience designing audio circuits as another hobby of mine is music synthesizer design so I used that as a starting point.
You get the most "punch" from transmitter audio equalization but some subtle filtering at the receive end can help clean up poor audio and provide some adjustment for the listener. This is a low power, portable radio so we don't want anything too complex or power hungry so we'll do minimal processing.
We also need a fair amount of gain in the audio stage to make up the remaining gain for the system. The following table helps us determine the total gain we'll need.
S number Power relative to 50Ω <30 MHz >30 MHz S1 -121 dBm -141 dBm S2 -115 dBm -135 dBm S3 -109 dBm -129 dBm S4 -103 dBm -123 dBm S5 -97 dBm -117 dBm S6 -91 dBm -111 dBm S7 -85 dBm -105 dBm S8 -79 dBm -99 dBm S9 -73 dBm -93 dBm We'd like the dynamic range of the system to go from S9 down to about S5 which is 24 dB of dynamic range and a minimum of about 86 dB of gain. This puts the output at about 15 mW for S9. This app note talks about headphone power level requirements and it can be complex and pretty specific to your headphone, but in general a few mW to maybe 10 mW or so is a good maximum for many small headphones. This might be a little low for S5 (0.1 mW output) but a few more dB can be added somewhere in the chain if needed.
The IF currently provides about 60 dB of gain so we need another 26 dB in the audio path, maybe closer to 40 dB for the weak signals. This is very achievable with a couple of opamps.
Opamp selection can be difficult these days, there are so many options out there. There are some decent "jelly bean" parts however. The N553x series is a go-to for hifi audio work but it's not inexpensive and probably overkill for this application. The TL07x is also a great opamp for audio work if you need a JFET input, but their primary advantage is when you have a very high impedance input and 50Ω hardly qualifies as high impedance. That brings me to my other go-to voltage opamp for audio work, the TLV915x series. Low offset voltage, low drive, low noise, low bias current, decent GBW and rail-to-rail operation over a large power supply voltage range make this a great choice. It's cheap too, about $1.50 in small volumes.
The TLV9152 contains two opamps in a single package and we'll take advantage of this by using two gain stages. One will be an active bandpass filter and the other will be a straight gain stage. When designing a filter there are a number of architectures available. The Sallen-Key is a very common active filter design but when gain levels get larger, the Sallen-Key becomes pretty sensitive to component values so higher precision components are needed. At this point, I usually look at a multiple feedback architecture. There's a great tool to help with the design here. Since our target frequency range for speech is about 300Hz to 3000Hz we'll look at a center frequency between 1k and 1.6k and see what the filter looks like. A Q factor between 1.5 and 2.5 should work well enough. Divide the center frequency by the filter width at -3dB to get the Q factor. After playing around with the values a little, the following values are what I came up with.
The plots show that it's unconditionally stable but I'd still like to do a little more simulation so I built it in Micro-Cap. The circuit is available in github. You'll notice a few extra components in there. I have a voltage source (V1) and a 300Ω load resistor (Rload) to make the simulation work. Headphones can run anywhere from a few Ωs to thousands, but 300 is a decent compromise for low and mid-level headphones. Feel free to adjust if you know what you'll be using. There are some lot values assigned to the passive components and these represent the variation in values. E96 resistors, for example, have a lot=1%. This will help with worst case analysis later. There are also Probe components which are necessary for stability analysis. They indicate where the circuit should be broken to calculate the open loop values.
In addition to these, I added a 16dB inverting gain stage to make up the remainder of the gain for the audio stage. There's a DC blocking capacitor and current limiting resistor at the end of the chain to prevent momentary short circuits from blowing up the opamps. These can happen when plugging in the headphones to output jack. There's also another load resistor (Rstage1) so we can compare the output of the filter to the output of the entire audio stage.
I run an AC analysis from 1 Hz to 100 kHz to see what the Bode plot looks like. The red plots are the first stage and the blue plots are the overall. I've marked the voice frequency range. The filter gives us just short of 20 dB gain and we get another 25 dB from the overall system. A little more than our design calls for but still pretty good. We should be able to adjust the feedback resistance in the second stage for volume control across our desired dynamic range. More on that later. Also note that the second stage does roll off the low-end more since C3 forms a high-pass filter with the load. It's well below our 300 Hz target so we won't worry about it, although we could turn it more into a low shelf if needed.
Next we'll run a stability test which lets us know two important things, the gain margin and the phase margin. We'll see the familiar Bode plot but with two extra arrows indicating these margin values. The numbers are on the tab labeled NYQUIST. Reading a NYQUIST diagram is beyond the scope of this post so we'll skip it for now. The gain margin is 38.77 which roughly means that we can add another 38 dB of gain to this stage before it becomes unstable and oscillates. Plenty of headroom. The phase margin of 322.89 has a similar meaning but has to do with the phase shift (delay) through the stage. It also important to look at where this margin is in comparison to the frequency of interest. In short, there's still plenty of margin there as well. Running the analysis on stage two shows we can add 46.27 dB gain across the stage and a phase of 90.23 degrees. That's a little closer than we normally would like but it'll still ensure there are no unexpected oscillations in the audio.
Earlier I talked about adjusting the gain of the second stage. Currently, there's a 102kΩ resistor in the feedback loop. If we change that to a a fixed resistor and an audio (logarithmic) tapered potentiometer, we'll get a decent volume control. We could simply put a potentiometer after the second stage and attenuate, but this is preferable as it will introduce less noise. A unity gain stage would require a 3.4kΩ resistor in the feedback path so if we use that for our fixed resistor then use a 100kΩ potentiometer, we'll get approximately the same total gain. We can easily simulate this in Micro-Cap by setting the Stepping in the AC simulation. Set the stepping component to R6 and the range from 3.4k to 103.4k. Use a Step Value of 2 and log stepping. Make sure you enable Step It then run the simulation. I turned off the display of the stage one curve so it's easier to see what's happening. A couple of markings on the graph show a range of about 30 dB from 15 dB to 44.8 dB of volume control. Perfect!
Since we've got the simulation up and we've entered tolerance values, we'll do a Worst Case simulation. In the AC Simulation, select Worst Case from the AC menu. You'll see all the components with lot values. Add outputs for the maximum gain and the center frequency at maximum gain.
High_Y(dB(v(Rload)/V(1)),1) High_X(dB(v(Rload)/V(1)),1)
This shows us the Y value (gain) and associated X value (frequency) of the gain peak. A number of simulations will be run while randomly varying the component values within the specified precision. It's a small circuit so I enabled EVA (Optimizer) for more accurate but slower results. By default, a Gaussian distribution of values will be used. Click Calculate and watch as the simulations run. After a minute or two we'll get some results. The important parts of this are the frequency and gain ranges as a percentage. The RSS (root sum squared) range of gain values is -1.15% to +1.03% or about a half dB either way. The corresponding RSS range of frequency values is -6.66% to +7.54% or less than 80 Hz either way. These seem acceptable to me so I'll add them to the KiCad schematic.
-
More IF Filter Matching
02/23/2022 at 22:24 • 0 commentsA brief update to the IF filter matching. The large different in impedance was making it tricky to get a good match with easy and inexpensive inductors. I had been trying to minimize the number of handmade inductors needed as some people find this a little intimidating and the cost of decent toroids can be a bit high. However I opted for two transformers on type 43 toroids (most like FT50 sized). They each have a 2 turn and 11 turn side which matches to 1512.5Ω. This is something like a 1.08 VSWR which is perfectly acceptable and the windings are pretty low so it should be too hard to make these.
I've pushed the latest schematics to github. Check them out and let me know what you think.
Next up is the receiver audio section, the microphone section, the power amp, and the control circuitry.
-
The oscillator and a design change
02/16/2022 at 20:36 • 0 commentsWhile working on the oscillator section I looked into ceramic filters a little more and found an alternate which I think will work better than the 2 kHz device we chose previously. The LTC455GW is also a 455 kHz filter but has a bandwidth of 4.5 kHz which will allow more frequencies through for clearer speech. There's also a more complete datasheet available so design will be easier. It's more than twice the price of the old device but it's still only $3 a piece in small quantities so it should be ok.
The Si5351A modules outputs a square wave with an unloaded 3.2v peak-to-peak (pp). Having used this device I know the output into 50Ω is closer to 1.6v pp. You can also google for this information. The mixers need an input of 200-300mV pp so we need to attenuate the output. The mixer input has an impedance of approximately 1.5kΩ. It's complex impedance but we'll deal with just the resistive portion for now. Calculating the attenuation using one of the many available tools usually requires an attenuation in power dB. Converting the voltages to power we get:
RMS voltage of a square wave is half the pp voltage
This shows we need about a 31 dB attenuator pad. I used this helpful tool to calculate the values for a pi attenuator. We need to use either a pi or tee as a bridged tee requires the input and output impedances to match. I usually start a little lower when there's a large attenuation needed as I've found actual attenuation tends to go up as does VSWR. I entered the input and output impedances and an attenuation of 24dB giving the following ideal values:
- Input shunt: 50.769 Ω
- Series: 2161.565 Ω
- Output shunt: 4776.276 Ω
- Minimum attenuation required for match: 20.719 dB
I went back to Micro-Cap and created a simple circuit with a 14.2 MHz square wave at 50 Ωdriving a 1.5 kΩ load. (The files are in github) A transient simulation confirmed the values with an output pp voltage of 276 mV. Micro-Cap allows you to double-click a resistor and select either Single or Combinations to use standard resistors instead of the idea value. It tells you the one or multiple resistors you can use and the percentage error from the original value. I did this for all three resistors in the pad and ended up with 51.1 Ω, 2.15 kΩ, and 4.75 kΩ values for the resistors. Each is within 0.6% of the ideal values. The resulting pp output is 278 mV which is in the allowed range. The final attenuation is 29.97 dB which is close to our estimated 31 dB. Input and output VSWR are 1.013 and 1.012 which is not going to cause a problem.
I mentioned that the impedance at the mixer is actually 1.5k || 3pF. This is a fairly small imaginary impedance value and we don't care about an exact match since loss of a bit more power isn't a problem and some minor distortion to the waveform shouldn't have a big effect on switching either.
Finally, we need to match the 50 Ω ports on the BGA2818 amplifiers to the 1500 Ω ports on the IF filter. We're interested in a fairly small bandwidth so an LC network should work well. The max Q of the match is 445k/7k or about 63. This tool calculates L-match, Pi-Match, and T-Match circuits. I used a Q of 45 to calculate a pi-match then implemented it in Micro-Cap.
-
More KiCad design
02/16/2022 at 18:00 • 0 commentsTrevor continued the KiCad layout, adding a simple power supply and RF bandpass filter.
The power supply uses two 9v batteries to generate about 15-18v input but another battery source (such as a rechargeable LiPo pack) could easily be substituted provided it supplies at least 12v. The K7805-500R3-LB is a high efficiency switching regulator that is a drop in replacement for the 7805 linear regulator. Since this is a battery operated device, conversion efficiency will prolong battery life and these regulators, although switching, are pretty clean and low noise and should not have a major effect on radio function. One of the transceiver parts most sensitive to power supply noise is the oscillator for traditional analog oscillators (Hartly, Colpitts, etc). The Si53451 is designed to be a digital clock synthesizer and uses a PLL so it is much more immune to supply noise. Amplifiers from transistors are also sensitive to noise but the MMIC amplifier used in this design is also quite resistant to noise. In addition to the 7805, there is an equivalent 12v converter, the K7812-500R3-LB used to generate a rail for the final power amplifier. When this is designed it may end up accepting a wide range of voltages and the second regulator might not be necessary but I've included it for now.
The band pass filter was designed with the help of Micro-Cap 12, a Windows circuit simulator that used to be a commercial product but was released as freeware some time ago. There are many filter design options including a number of websites, QUCS, and Lt-Spice. I'm familiar with Micro-Cap and it is a very powerful simulation tool with built-in filter generation. Selection Design->Passive Filter Design presents a dialog box with a number of options. I tried a number of these and settled on a Butterworth filter with the following properties.
- Center frequency: 14.25 MHz
- A 200 kHz bandwidth (3 dB)
- About 3 dB passband ripple
- A 1 MHz stopband (30 dB)
This was a fairly simple design only requiring a few components while still adequately attenuating out of band signals. A couple of standard, surface mount inductors provide two components but the higher inductance of the series inductor requires a hand wound inductor. A dual aperture ferrite core (BN-43-202) has good performance in the 20m band and only requires 6 turns of wire.
-
Initial design meeting
02/16/2022 at 17:43 • 0 commentsDuring the February tech night we streamed some initial design discussion and work.
IF frequency selection was discussed including some common frequencies. They are good options since many components for these frequencies are available and inexpensive. High IFs are good at image rejection and low IFs are better for small bandwidth filters. A low IF of 455 kHz was chosen as the single IF since a tight filter is more important than image rejection. A more robust design would have 2 or 3 IFs to cover both requirements.
Component selection was discussed. Trevor (K8TRC) has some amplifier and mixer components in his junk drawer which are inexpensive and seemed adequate for the job so we chose those as a basis for the design. The SA612A Gilbert cell mixer will be used for IF and baseband conversion and the BGA2812 amplifier will be used in the IF. In order to get reasonable gain levels, 2 of these will amplify for a combined 60dB or so in the IF. The remaining gain will likely come from the audio stage but another BGA2812 in the RF stage is also a possibility. The WTL6R60427VH ceramic filter is an inexpensive monolithic device designed for 455 kHz filtering and has a bandwidth of about 2kHz. Ideally this would be a little wider but there was no 3 kHz device available.
The Si5351A is often used as an oscillator for DIY radios as it's inexpensive, easy to use, and provides multiple square wave outputs up to a few hundred MHz. Modules with support components are readily available. The module from QRP Labs allows for an inexpensive crystal reference or for a few dollars more, a TCXO for better stability.
We went over basic use of Digikey and similar suppliers and how to use parametric search to find components.
We then laid out a basic IF strip in KiCad 6.