Silicon ChipEasy-to-build Digital AM/FM/SW Receiver - December 2021 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions: PicoLog Cloud
  5. Back Issues: PICOLOG
  6. Publisher's Letter
  7. Feature: The Fox Report by Barry Fox
  8. Feature: Techno Talk by Mark Nelson
  9. Feature: Net Work by Alan Winstanley
  10. Project: Easy-to-build Digital AM/FM/SW Receiver by Charles Koslna
  11. Project: Balanced Input and Attenuator for the USB by Phil Prosser
  12. Project: Mini Digital Volt/ Amp Panel Meters by Jim Rowe
  13. Feature: Max’s Cool Beans by Max the Magnifi cent
  14. Feature: KickStart by Mike Tooley
  15. Feature: Circuit Surgery by Ian Bell
  16. Feature: AUDIO OUT by Jake Rothman
  17. Feature: Electronic Building Blocks by Julian Edgar
  18. PCB Order Form
  19. Advertising Index

This is only a preview of the December 2021 issue of Practical Electronics.

You can view 0 of the 72 pages in the full issue.

Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
All the hard parts are already done for you! by Char les K osina Easy-to-build Digital AM/FM/SW Receiver Digital radios are very capable, but can be somewhat complicated and costly to build. Not this one, though! It uses the BK1198 digital radio chip which is cheap and readily available, and requires only a handful of discrete components to work. The resulting radio covers the AM and FM broadcast bands, plus shortwave from 2.7 to 22MHz. T he design of radio receivers has changed dramatically in recent years. For decades, the standard AM receiver was a superheterodyne circuit with a mixer stage that combined the incoming signal with a local oscillator. 16 The resulting intermediate frequency signal was then further amplified and fed into an envelope detector that extracted the required audio component. Finally, sufficient audio amplification was provided to drive a loudspeaker. When transistors replaced valves, the initial design philosophy remained much the same. Such receivers (and those that preceded them, such as superregenerative and tuned radio frequency [TRF] receivers) required multiple tuned circuits, many of them adjustable. Practical Electronics | December | 2021 But with the advancement of technology, analogue circuits have largely been replaced by digital techniques. The BK1198 is a good example of this. Its functions are described in the following PDF document from Jaycar: https://bit.ly/pe-dec21-bk1198 Jaycar sells the mono version of the BK1198 separately (Cat ZK8829), as part of a prebuilt AM/FM portable radio (AR1458) or in their ‘Cardboard Radio’ kit (Cat KJ9021). We reckoned that we could do more with the chip, and build a more capable radio – hence this design. If you don’t mind using an external speaker, it fits into a low-cost Jiffy box. Alternatively, you can use a larger box and include an internal speaker. Either way, it delivers 0.9W to the 8W speaker. The current band, tuning range and frequency are displayed clearly on a backlit character LCD screen. It also boasts a tone control, volume control, on/off switch and headphone socket. So basically, it has everything you need for listening to AM, FM and SW broadcasts and not much else, and it’s easy to drive. It runs off a 9-12V AC plugpack or 12V DC external battery. The PCB has been designed with a mixture of SMD and through-hole components; we can’t avoid having SMDs since the BK1198 is not available in any through-hole packages (a common situation these days). That being the case, we decided to use some larger passive SMDs to keep the overall device compact, without making it too hard to put together. Performance Performance is reasonable for such a simple design. On the FM band, I found an internal wire length to be quite adequate to pick up many local stations (in my case, the Melbourne area) with good quality. I do have lineof-sight to to local towers, however. The AM band suffers from interference from various sources, and switchmode power supplies in the vicinity will create background noise. Moving away from such sources gives reasonable quality. I got the best results by taking it into my car and running it off the car battery. On the short wave bands, a 1µV signal is detectable, and 10µV gives a reasonable signal-to-noise ratio. Circuit description While the simplest radio designs using the BK1198 require only a few discrete components plus an audio amplifier, my design is rather more ambitious, but thanks to the use of an Arduino Nano, still manageable. The circuit I came up with is shown in Fig.1. There are two ways of controlling the BK1198 radio chip (IC4), selected by the MODE pin (pin 5). If this pin is tied low, it’s controlled by serial data on the SCLK and SDIO pins. While this would appear to be the sensible approach, documentation on how to do this is rather sparse, and the translation from Chinese does leave a lot to be desired. My design leaves this as a future option, but for now, an analogue tuning approach is used. This means that we have the jumper on LK1 pulling MODE up to 3.3V. A voltage on the BAND pin (pin 15) selects the band that the BK1198 operates on. There are a total of 18 pre-programmed frequency ranges available, and the simplest way is to have a volt- Fig.1: block diagram of the BK1198 radio receiver chip, on which this project is based. All you have to do is tell it which band(s) you want to listen to, display its details and amplify the audio output. Practical Electronics | December | 2021 Cov erage AM: FM: SW1: SW2: SW3: SW4: 513-1629kHz (1kHz steps) 87-108MHz (100kHz steps) 6.4-10.25MHz (5kHz steps) 2.7-10.25MHz (5kHz steps) 9.8-15MHz (5kHz steps) 14.0-22MHz (5kHz steps) age divider connected to TUNE1 (pin 1), which is the tuning supply voltage and very close to 1.2V. However, I have used a different approach. The required voltages are: AM 2 (513–1629kHz, 9kHz steps) 300mV FM 1 (87–108 MHz, 100kHz steps) 33mV SW10 (2.7–10.25MHz, 5kHz steps) 1033mV SW11 (9.8-22MHz, 5kHz steps) 1100mV The appropriate voltage is generated by IC2, an MCP4822 12-bit digital-toanalogue converter (DAC). The user controls the band using 6-position rotary switch S2. Why six position? I decided to split up each of the shortwave bands into two (more on why I did this later). The frequency tuning voltage is generated by another DAC, the DAC8551 (IC6), which has 16-bit resolution. It needs to be more accurate than the band selection voltage, hence the higher resolution. The reference voltage for this DAC is the 1.2V on pin 1 of IC4 (TUNE1). This ratiometric approach ensures that an accurate voltage will be generated regardless of the BK1198 chip variations you may encounter. If we take the FM band as an example, there are 210 channels spaced at 100kHz intervals. The change in channel voltage is thus 1200mV ÷ 210 = 5.7mV. One bit of the 16-bit DAC represents about 18.3µV (1.2V ÷ 216), so the digital value steps by about 311 to switch from one channel to the next. This is a more-than-an-adequate safety margin in resolution. It gets a bit tighter on the shortwave bands. There are 2440 channels spaced at 5kHz on the 9.8–22MHz band. This is only 490µV between channels, or a step-change of 27 in the digital data. Again, we have a sufficient safety margin. Note that a 12-bit DAC would have less than two steps between channels, which would be quite inadequate. 17 SC BK1198 BASED BK1198-based Digital AM/FM/SW Radio Receiver DIGITAL AM/FM/SW RADIO RECEIVER Ó Fig.2: despite receiving FM and AM in three different bands, the radio circuit is relatively simple thanks to the all-in-one BK1198 digital radio receiver chip (IC4). JFETs Q3 and Q4 provide extra RF gain for shortwave and FM signals respectively, while inductors L1-L4 provide preselection for different shortwave frequency ranges. Tuning and band switching is controlled by the Arduino Nano using DACs IC3 (12-bit, for band selection) and IC6 (16-bit, for tuning). IC1 is the audio amplifier. There are two RF inputs on the BK1198 chip. It receives the FM signal at pin 2. Reference designs include a preamplifier using an NPN transistor, but I opted to use 18 a grounded-gate JFET as this gives good gain and a high stability margin. The second RF input is on pin 4, and is for the AM and SW bands. This presented something of a design challenge. For the AM band, a ferrite rod of about 400µH is required. An internal varicap tunes the ferrite rod to the correct frequency. However, there are not many pre-wired ferrite rods Practical Electronics | December | 2021 16 x 2 LCD MODULE IC1, IC3, IC6 D2-D5 y, lled K A available – the only one Jaycar sells is their Cat LF1020. I found the performance of this one not very satisfactory. A better option is to use their LF1012 ferrite rod, which is 180mm Practical Electronics | December | 2021 long and 9mm diameter. With 65 turns of 24AWG (0.5mm diameter) enamelled copper wire, this gives considerably improved performance. The Q of such a coil is not particularly high, 8 IC4 4 1 16 8 1 and it is preferable to use Litz wire, but it is challenging to strip and tin each strand. Litz wire is used on the LF1020, and it’s possible to very carefully remove this winding and slip it 19 on the longer rod, and thus provide an almost-ideal solution. (If you are building this project and don’t have ‘easy’ access to Jaycar then get the spec from the Jaycar online catalogue, source similar parts and experiment.) Shortwave tuning I felt that a low-noise preamplifier was desirable for the SW bands, so I chose the J310 JFET for this as well. Since I wanted some degree of tuning on this preamplifier, I used different inductors for the various bands, which brings me back to why I divided up the shortwave bands into two. My original intention was to use a readily available varicap diode, type BB201, which has a range of about 20– 110pF with a tuning voltage of 10–0.5V. This tuning voltage was to be generated by the second DAC in IC3, and amplified by a rail-to-rail op-amp running off 12V. The varicap range is such that it would cover the appropriate band with the chosen inductor. By using an appropriate formula, the tuning voltage could be calculated by the micro. However, this just did not seem to work at all; the best result obtained was with the varicap run at its minimum capacitance, regardless of the band or frequency. Based on the BK1198 documentation, I gathered that its internal varicap only operated on the AM band. But I suspect that it also works on the SW bands, although the documentation does not describe this. The op amp and varicap of the original prototype were therefore unnecessary, so I removed them in the final design. You will see that there is a 2.2kW resistor from the drain of Q3 to +8V. Originally, this was a 1000µH RF choke, which was fine for the shortwave bands, but it completely killed the AM band because the 100pF capacitor in series resonated within the AM band and formed a very effective series-resonant trap. By replacing it with a resistor, the HF performance is not significantly affected, and it has a minimal effect on the AM band. Small-signal diodes D4 and D5 provide some measure of protection against voltage spikes being picked up on the SW antenna, for example, during a thunderstorm. Obviously, they cannot protect against a direct or even nearby strike, but will prevent damage to Q3 from general lightning activity. The 100pF coupling capacitor, in combination with the inductor L1-L4 selected by rotary switch S2a peaks the shortwave preamp response around the selected frequency band. 20 Band selection details Getting back to band selection, S2b selects from equally-spaced voltages between 0 and 5V, generated by a chain of 2.2kW resistors between 5V and 0V. The selected tap is fed to the internal analogue-to-digital converter (ADC) of the AVR ATmega328 chip on the Arduino Nano module. This ADC has a 10-bit resolution, so that the values read are approximately 0, 204, 409, 613, 818 and 1023. By truncating the last two digits we get 0, 2, 4, 6, 8, and 10. Then dividing by two and adding one gives the selected band number, from one to six. The Arduino code then uses a lookup table to find the value needed to generate the appropriate band select voltage for the BK1198 chip. This is a more versatile arrangement than using a resistor network to generate the voltage directly, as it can easily be programmed to select any of the different bands available. Switch positions 3 and 4 both select the 2.7-10.25MHz band, and switch positions 5 and 6 both select the 9.822MHz band. However, different inductor values are chosen as part of the SW filter by S2a for each shortwave position. The Arduino Nano module is available at very low cost and has the advantage of providing regulated 5V and 3.3V outputs, which are needed by other devices in the circuit. Most of its I/O pins are used. The LCD module is the popular 16×2 type that is widely available. The SCL and SDA lines of the Nano are routed to the BK1198 chip in case someone can work out how the BK1198 serial interface works. The Nano is a 5V device, while the BK1198 runs from 3.3V. So schottky diodes D2 and D3 are used (along with pull-up resistors to 3.3V) to prevent damage to the BK1198 IC. Tuning is controlled via incremental rotary encoder RE1. The falling edges of its output pulses generate an interrupt Quirks with the BK1198’s shortwave tuning My original prototype had a problem with its SW10 shortwave range; I found it to actually cover 3.1–10.1MHz rather than the expected 2.7-10.25MHz range. As the ranges are set at the factory by internal programming, this could have been an anomalous chip. Replacing the chip gave me the correct range. Fortunately, if this happens to you, it is easy to correct by altering just a few numbers in the program code. on the INT0 pin (Arduino digital input D2), at which point the state of analogue/digital input A3 is read. If it is high, the frequency is increased by the appropriate step, and if low, it is decreased. This scheme works with either momentary or level type encoders. The pushbutton switch integrated with the rotary encoder is connected to INT1 (digital input D3). This is used to toggle between the step sizes on different bands. On the AM band, the spacing in Australia is 9kHz, but the toggle allows for 1kHz step size as well. On the FM band, only a 100kHz step size is used, as it does not take too long to sweep across the band. All four shortwave bands have step sizes that can be set to 5kHz, 50kHz and 500kHz. Audio amplification The audio output section is fairly straightforward. The OUT pin of the BK1198 chip (pin 13) is capacitively coupled to volume control potentiometer VR2. The tone control potentiometer (VR3) at minimum resistance gives a −3dB point of about 700Hz. This works by forming a variable lowpass filter in combination with the 2.2kW resistor and 100nF capacitor. The audio amplifier is an SSM2211 chip which will deliver about 0.9W into 8W. The phono jack is configured to cut off the signal to the loudspeaker when phones are inserted. To prevent hearing damage, a 560W resistor reduces the output level to the headphones. Power supply The original idea was to run the radio from a 12V DC plugpack. There are plenty of switchmode ones available, but they generate so much hash as to make the AM band all but useless. You could use one which has an iron-cored transformer, but they are almost impossible to buy new now. Fortunately, Jaycar still sells a 9V AC plugpack, the MP3027. We use this and rectify its output using bridge rectifier BR1. The resulting pulsating DC is filtered by a 2200µF capacitor and applied to the input of 7805 regulator REG1. Don’t be fooled though – this regulator is not producing a 5V output. A resistive divider between its output, GND pins and the actual circuit ground (0V) lifts its output to 8V while retaining decent regulation. The Nano module has a 5V regulator, which powers the ATmega328 micro and also the audio amplifier. We don’t want this regulator to drop too much voltage or else it could overheat. Tests showed that with sustained Practical Electronics | December | 2021 maximum audio output, this regulator does not overheat as long as its input voltage is no higher than about 8V. So REG1 is essentially a pre-regulator for the Arduino’s own 5V regulator. Note that you could use a 7808 for REG1, leave out the 330W resistor and replace the 180W resistor with a wire link or 0W resistor. However, 7808s are not as common to find as 7805s are. By the way, the 100nF capacitor across the input to bridge rectifier BR1 may seem redundant, but it helps to filter out any unwanted RF picked up by the supply leads. Debugging interface A simplified RS232 serial interface is provided by transistors Q1 and Q2, which operate as level shifters. This was included purely for debugging purposes in development, operating at 38,400 baud with the usual 8,N,1 encoding. These components (and their 15kW drain pull-up resistors) may be omitted if you don’t plan to fiddle with the software. Software The firmware is written in BASCOM, a versatile BASIC-like language that compiles into native AVR code. On power-up, the receiver retrieves the last frequency and step size for the set band from EEPROM. The LCD module shows the selected band on the top line and the set frequency on the bottom line. When another frequency is selected by the tuning knob, the new set frequency and current step size is written into the EEPROM after about half a second. Sourcing the components... We know that sourcing components can be a challenge, so the ones used in this design were carefully chosen so that they are available from suppliers such as Jaycar, Altronics and element14. In some cases, you might have to buy multiples of the one item. ...but do remember! Some of these items might be available more cheaply on eBay, AliExpress or Banggood, if you don’t mind the longer lead time. For the full details, see the parts list below. Construction Refer to the PCB overlay diagram, Fig.3. The BK1198 radio is built on a PCB coded CSE200902A, available from the PE PCB Service. It measures 127 × 88mm. If you have some experience soldering surface-mount components, the assembly should not present any problems for you. If you don’t, you might want to practice with something simpler first. Practical Electronics | December | 2021 Case holes required for the receiver. No diagram is shown for these as none of them are super-critical. Start by fitting IC6, the 16-bit DAC. It’s in an eight-pin fine-pitch (0.65mm) package and does require special care. First, locate its pin 1 dot in the top corner and line it up with the pin 1 indicator on the PCB. Spread some flux paste over the pads, place the chip and carefully tack down one corner pin. Use a magnifier to verify that the other seven pins are correctly located over their pads. If not, re-melt the solder on that tacked pin and gently nudge it into position. Repeat until it is precisely located, then solder all the pins and again use a magnifier to check for bridges between pins. If you find any, add extra flux paste and clean up the bridge(s) using solder wick. The remaining ICs have twice the pin pitch (1.27mm), so they should be fairly easy in comparison. Use a similar technique to fit those, making sure in each case to check the pin 1 orientation before soldering. Follow with the four small transistors and the four diodes. Don’t get the different types of transistors or diodes mixed up. The orientation of each transistor will be obvious, but you will have to check (probably under magnification) for the cathode stripe on the diodes to determine their correct orientations. The SMD resistors and capacitors are all either 2.0 × 1.2mm or 3.2 × 1.6mm, so again should be fairly easy and they are not polarised. The SMD resistors will be printed with a tiny code on top that identifies their value (eg, 183 [18 × 103] or 1802 [180 × 102] indicates 1.8kW) while the capacitors will be unmarked. Make sure each component goes in the correct location as per Fig.3. Through-hole parts Next, fit the low-profile through-hole parts: the 1W resistor, axial inductors and the bridge rectifier (watch the orientation – the positive terminal should be marked). The watch crystal (X1) is laid over on its side and held down with a loop of wire soldered to the board (use a component lead offcut). Be careful bending and soldering its leads because they will be very thin, and you don’t want them shorting against each other or the crystal case. Continue by fitting taller parts like trimpot VR1 (with its adjustment screw towards BR1), polarised headers CON1-CON3, CON7 and CON9 and SMA sockets CON5 and CON6. Also fit the 3-pin header for LK1, and place the shorting block between pins 1 and 2 and the socket strips for the Arduino Nano. Note that you don’t need CON3 unless you plan to use the serial debugging feature, and most of the other headers could be left off if you prefer to solder flying leads straight to the board. That will make the final construction steps a bit more tricky, though. Also, if you live in a strong signal area, you could use FM antenna connector CON6 off the board and just solder a length of wire to its central pad. Now mount the Arduino Nano module, which can be soldered straight to the board (it’s usually supplied with pin header strips) or optionally, plugged in via female sockets soldered to the board. Either way, make sure that its pinout matches the PCB silkscreen. With that in place, fit the sole electrolytic capacitor, ensuring its longer lead goes to the pad marked with a ‘+’ symbol. 21 The last part to fit on this side of the board is inductor L8, which is wound using six turns of 0.5mm-diameter enamelled copper wire on a 5mm-diameter former (such as the shaft of a 5mm drill bit). Space out the windings so that the coil is 7mm long, then cut it to length, strip the enamel off the ends of the wires (using emery paper or a sharp knife), tin the wires and solder the coil to the board where shown. Underside components We have seen LCDs with pins 1 (GND) and 2 (+5V) swapped, so check your screen. If pin 2 is GND, you will need to cut the header pins off and add wires to cross these connections over. The LCD screen mounts on the underside of the board. Solder its header strip in place, then check that it has a pin header attached; if not, solder it now. Plug it into the socket and attach it to the board using the tapped spacers and machine screws. With the LCD in place, the remaining underside components can be fitted: rotary encoder RE1, rotary switch S1, volume control potentiometer VR2 and tone control potentiometer VR3. Preparing the ferrite rod antenna As explained earlier, you probably won’t find a 400µH ferrite rod that comes pre-fitted with a coil. The easiest and best solution is to also buy a smaller ferrite rod antenna, such as the Jaycar LF1020, carefully remove the windings from that rod and then gently slip them over the longer rod. If you can’t (or don’t want to) do that, instead wind 65 turns of 0.5mm 22 enamelled copper wire onto the rod, and strip and tin the ends, ready for attachment to the PCB via flying leads. Programming You can program the Nano module separately, or plugged into the main board, but it’s easier before you plug it in. As the code is written in BASCOM, you can’t use the Arduino IDE to program the chip. We suggest a free program called AVRDUDE or (preferably) its Windows graphical version, AVRDUDESS. Download and install it from: https://bit.ly/pe-dec21-avrdude Launch it and find the dropdown under the label ‘Presets’ in the upper right-hand corner of the window, click the drop-down and select the ‘Arduino Nano (ATmega328P)’ option. In the upper left-hand corner, modify the COM port number to match your Nano. Once you have plugged it in, you can find its port number in Windows’ ‘Bluetooth and other devices’ Settings page. Under the ‘Flash’ heading, click the ‘...’ button and find the radio HEX file (available as a download from the December 2021 page of the PE website). Ensure ‘Write’ is selected just below this and press ‘Go’. Messages will appear at the bottom of the window, hopefully indicating that the programming was successful. The most likely cause of any problem is an incorrect port selection. Finally, unplug the USB cable from the Arduino Nano module and plug it into your radio board. The board assembly is now complete. Testing It’s a good idea to do a little bit of testing before you put the board in the case, as it is easier to debug and fix in its current state. You will need some sort of antenna connected to verify that the radio is working – at this stage, the FM antenna is probably the easiest to organise. A length of wire might be good enough for initial testing. You will also probably want to temporarily connect an 8W speaker between pins 1 and 3 of CON7. Position the board so that you can see the LCD and access the controls, and connect a 9V AC or 12V DC power supply to CON1. Verify that the LCD backlight switches on and you get a sensible display on the LCD screen. If you can’t see the characters, try adjusting trimpot VR1. If the backlight doesn’t come on, then that points to a power supply problem – check the output of REG1 and verify that it is a steady 8V or so. If you still don’t get any display, then there may be a problem with the programming of the Arduino Nano module, or perhaps the Nano or LCD are not making good contact with their sockets. Assuming that the display looks OK, rotate S2 to get the unit into FM mode and then try turning RE1 to find a station. Adjust VR2 to get a sensible volume from the speaker. If you can pick up stations then it’s all looking good. If not, you might need a better antenna, or you could have a problem in or around transistor Q4, IC4, crystal X1 or audio amplifier IC1. If you want to test the other bands, then you will need to connect up a shortwave antenna to CON5 and/or the ferrite rod to CON2. Practical Electronics | December | 2021 Fig.3 (left): the PCB uses a mix of SMD and through-hole components. Start by fitting the only fine-pitch SMD, IC6, then the remaining SMDs (don’t forget the two caps under the Nano!), followed by the top-side through-hole parts and finally, those which mount on the underside (mainly the display and controls). There are a few optional components, such as the debugging header CON3. This diagram also shows most of the external wiring. At right, the photo shows the assembled PCB mounted in the case. Note that this is an early prototype board so there are some minor differences between this and the PCB overlay opposite. Assuming that it all checks out, you can now proceed to finish the build. If you run into problems, it’s always a good idea to carefully inspect all of your solder joints, while also verifying that the right parts are in the right locations, and any polarised components have not been soldered in the wrong way around. Final construction If you’re building the radio into the smaller and cheaper UB2 Jiffy box, you can drill and cut holes in the lid that came with your box. Fig.4 shows the details of the cutouts. You could cut a piece of ~3mm thick plastic to this size and make the cut-outs, but it’s probably easier to just print this (it’s available as a PDF download from the December 2021 page of the PE website) and use it as a template on the existing Jiffy box lid. A laser cutter can’t make countersunk holes for the PCB mounting screws, so if you are cutting your own, you will need to use a countersinking tool to profile those four holes on the outside face of the panel. It’s also a good idea to attach a panel label. The artwork we’ve prepared is available as a PDF download from the December 2021 page of the PE website. Print it onto adhesive paper or print it onto regular paper and laminate it. You can then cut the panel to size and cut out the holes with a sharp hobby knife. But before you glue it to the lid, attach the PCB to the rear so that you can hide the mounting screws. The radio board attaches to the back of the lid using the 15mm spacers, with countersunk screws through the lid and Practical Electronics | December | 2021 regular machine screws holding the PCB to the spacers. Once the panel has been glued in place, you can attach the nuts to hold the potentiometer(s), rotary encoder and rotary switch to the panel, then attach the knobs (after cutting down any shafts which are too long). The power on/off switch (S1) and headphone socket (CON8) mount in the hole provided on the front panel. You will also need to drill a hole somewhere in the side of the box for the barrel power socket. While you’re at it, decide where in the case you are going to mount the ferrite rod, and if fitting an internal speaker, that too (you will need to drill sound and mounting holes). Once you drop the lid into the box, the FM and SW sockets will be accessible via holes in the left-hand side. Temporarily insert the lid into the box and mark out the locations, then drill these holes large enough to get cables onto those connectors. One of the last steps is to make up the wires and plugs for the ferrite rod, power supply and switch and speaker/ headphone socket. For the ferrite rod, this is simple; you just need to attach a two-way plug to the end of a short piece of shielded cable or twin-lead. The polarity doesn’t matter, but it must be long enough to reach CON2 before the lid is attached to the case. Solder this to the primary winding on the ferrite rod. If you’re using a pre-made coil, it might have two pairs of wires, so use the pair with the highest (but non-infinite) resistance reading between them. The power wiring is slightly more complicated (see Fig.3); one pin of CON1 (it doesn’t matter which) goes straight to the outer barrel contact of the socket, while the other pin goes to the central pin contact via switch S1. If your switch has more than two contacts, pick two which are connected when the switch toggle is down but open when up. One possible pitfall is that barrel sockets often have three solder tabs, one of which is disconnected when a plug is inserted. So make sure the outer barrel contact you solder to is not that one. It’s easiest to check by inserting a plug, then soldering to the tab which has continuity to the outer barrel. Finally, wire up the headphone socket and speaker as per Fig.1 and Fig.3. Start by identifying the switched and unswitched tip and ring contacts on the socket and joining them together, turning it into a mono socket. Connect the sleeve tab back to the middle pin of the Radio source code We will make the source code available for this project, along with the HEX file. The firmware was written in BASCOMAVR, a version of the BASIC language that compiles to native Atmel AVR code. So it is quite easy to modify. BASCOM is commercial software there is a free demo version available which can produce binaries up to 4KB in size, but the radio software is larger than that. A full license for the software costs around £100 (it’s available from a few different online shops). But, do note this is only relevant for those who wish to edit the software. ou do not need it to load the HEX file into the chip. There are plenty of free software packages that can do that, like MPLAB IPE and AVR Studio. 23 The see-through case shows how the electronics mounts to the lid/front panel – and because you can see the ‘works’, it also adds to the intrigue of this radio! 24 Practical Electronics | December | 2021 P arts list – AM / F M / S W 1 double-sided PCB coded CSE200902A, 127 x 88mm 1 5V Arduino Nano module 1 16x2 blue backlit alphanumeric LCD module 1 220 x 160 x 80mm IP65 sealed ABS enclosure or similar (fits internal speaker), OR 1 UB2 Jiffy box, 197 x 113 x 63mm (no internal speaker) 1 10kW single-turn mini vertical (SIL) trimpot (VR1) [eg, element14 9317236] 2 9mm vertical 10kW potentiometer (VR2, VR3) [eg, element14 1191725] 1 2.2µH axial RF inductor (L1) [eg, element14 1167666] 1 4.7µH axial RF inductor (L2) [eg, element14 1180375] 1 10µH axial RF inductor (L3) [eg, element14 1180270] 1 33µH axial RF inductor (L4) [eg, element14 1857853] 1 100µH axial RF inductors (L9) [eg, element14 2858897] 1 1m length of 0.5mm diameter enamelled copper wire (L8 and possibly L10) 1 400µH ferrite rod (L10) 1 coil taken from ferrite rod antenna (L10) 1 32768Hz watch crystal (X1) [Jaycar RQ5297] 1 rotary encoder with inbuilt pushbutton (RE1) [eg, element14 2663519] 1 SPST chassis-mount toggle switch (S1) 1 2-pole, 6-position rotary switch (S2) [Jaycar SR1212] 3-4 knobs (to suit VR2, VR3 [if fitted], RE1 and S2) 3 2-pin polarised headers (CON1,CON2,CON9) [Jaycar HM3412] 3 2-pin polarised plugs (for CON1,CON2,CON9) [Jaycar HM3402] 2 3-pin polarised headers (CON3,CON7) [Jaycar HM3413] 2 3-pin polarised plugs (for CON3,CON7) [Jaycar HM3403] 2 right-angle or vertical PCB-mount SMA sockets (CON5,CON6) [eg, element14 2612349] 1 6.35mm switched stereo chassis-mount jack socket (CON8) [Jaycar PS0184 or similar] 2 15-pin female header sockets (for the Nano; can be cut down from longer strips) 1 16-pin female header socket (for the LCD) 1 3-pin header with jumper/shorting block (LK1) 1 2.1mm inner diameter bulkhead barrel socket [Jaycar PS0522 or similar] 1 8W 1W full-range speaker driver (eg, 76mm if mounting in a larger box) or an external 8W speaker) 4 knobs (size as required) 4 8mm-long M3 tapped spacer (for mounting LCD) 4 15mm-long M3 tapped spacers (for mounting PCB to box) 12 M3 x 5mm panhead machine screws 4 M3 x 10mm countersunk head screws various lengths of shielded and hookup wire Sem iconduct ors 1 SSM2211SZ or NCS2211DR2G 1.5W audio power amplifier, SOIC-8 (IC1) [element14 2464727] plug for CON7. The contacts which connect to the ring and sleeve when a plug is inserted then go to pin 1 of CON7. Then wire the unused pair of headphone socket contacts to one end of the speaker, and the other end of the speaker back to pin 3 of CON7. Note that if you’re building it into the UB2 Jiffy box and using an external speaker, you will have to run a pair of wires out of an extra hole in the case Practical Electronics | December | 2021 D igital R eceiver 1 MCP4822-E/SN dual 12-bit DAC, SOIC-8 (IC3) [element14 1439414] 1 BK1198VB digital radio receiver, SOIC-16 (IC4) [Jaycar ZK8829] – IMPORTANT: many vendors (eg, Amazon or AliExpress) sell the SOP (not SOIC) version. This is essentially identical, and you can use it instead. 1 DAC8551IDGKT 16-bit DAC, VSSOP-8 (IC6) [element14 1693841] 1 7805 5V 1A linear regulator (REG1) 2 2N7002 N-channel MOSFETs, SOT-23 (Q1,Q2) [element14 1764537] 2 MMBFJ310LT1G N-channel VHF/UHF JFETs, SOT-23 (Q3,Q4) [element14 1431340] 1 DB104 bridge rectifier, DIP-4 (BR1) 2 BAT54T1G schottky diodes, SOD-123 (D2,D3) 2 1N4148WS signal diodes, SOD-323F (D4,D5) C apacitors (through-hole) 1 2200µF 16V electrolytic C apacitors (SMD M3216/1206-size) 4 10µF 25V X7R ceramic 3 1µF 25V X7R ceramic C apacitors (SMD M2012/0805-size) 1 10µF 25V X7R ceramic 9 100nF 50V X7R ceramic 2 10nF 50V X7R ceramic 1 1nF 50V X7R ceramic 1 100pF 50V C0G/NP0 ceramic 1 33pF 50V C0G/NP0 ceramic 3 18pF 50V C0G/NP0 ceramic R esistors (all SMD M3216/1206-size 1% thick film unless otherwise specified) 1 10MW M2012/0805-size (code 106) 1 270kW M2012/0805-size (code 274) 1 220kW (code 224) 1 56kW (code 563) 1 18kW (code 183) 5 15kW (code 153) 1 10kW (code 103) 2 4.7kW (code 472) 7 2.2kW (code 222) 1 560W (code 561) 1 330W (code 331) 1 180W (code 181) 2 100W (code 101) 1 100W 1W 5% axial (code brown black brown gold) UK/EU/US... readers You don’t need to use the exact Altronics/Jaycar parts listed here – they are quoted so you can find local alternatives from the specs provided online. to your external speaker. Alternatively, fit a two pin (or more) connector somewhere on the box, with a matching plug for the external speaker. A good option for this external speaker is to use an unpowered computer speaker, which usually has a 3.5mm jack plug fitted, then use a 3.5mm jack socket to connect it back to the radio board. When the wiring is complete, you can plug all the wires into the appropriate headers on the board, then give it all a final test before buttoning it up (ie, attaching the lid to the box). You should be able to do this using the selftapping screws supplied with the box. You can now enjoy listening to your new radio! Reproduced by arrangement with SILICON CHIP magazine 2021. www.siliconchip.com.au 25 An alternative, smaller and slightly cheaper version We have also made a second version of the AM/FM/SW receiver which is not only more compact, it is also a little cheaper to build. It uses the same BK1198 receiver module; in fact, the electronics is virtually identical. The main difference is that it doesn’t have an internal speaker, relying instead on headphones or earpieces. (The photo below shows a 3.5mm adapator plugged into a standard 6.35mm socket, so it will take the vast majority of headphone types.) The other difference is that it uses a standard UB2 jiffy box instead of the more expensive (and larger) ABS case. Construction is basically the same as the larger version. Like the larger version, the PCB assembly ‘hangs’ from the case lid, with suitable cutouts for the display, controls and ‘phones socket. The photos show how the assembled BK1198 receiver board is an easy fit in the smaller case. Front panel artwork, as shown in the photo below can be downloaded from the December 2021 page of the PE website – it can also be used as a drilling template. Lid drilling detail for the Jiffy Box version. This, and the front panel artwork is available from the December 2021 page of the PE website. 26 Practical Electronics | December | 2021