Silicon ChipMiniHeart: A Miniature Heartbeat Simulator - January 2021 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: More articles than space - a good problem to have!
  4. Feature: Automotive Electronics, Part 2 by Dr David Maddison
  5. Project: AM/FM/SW Single-Chip Digital Radio by Charles Kosina
  6. Review: Altium 365 and Altium Designer 21 by Tim Blythman
  7. Project: MiniHeart: A Miniature Heartbeat Simulator by John Clarke
  8. Feature: How to use the MPLAB X Development Environment by Tim Blythman
  9. Serviceman's Log: One good turn deserves another by Dave Thompson
  10. Project: The Bass Block Subwoofer by Nicholas Dunand
  11. Project: Busy Loo Indicator by John Chappell
  12. Feature: AVR128DA48 and Curiosity Nano Evaluation Board by Tim Blythman
  13. Product Showcase
  14. Vintage Radio: 1963 Philips Musicmaker MM1 mantel radio by Associate Professor Graham Parslow
  15. PartShop
  16. Feature: El Cheapo Modules: Mini Digital AC Panel Meters by Jim Rowe
  17. Market Centre
  18. Advertising Index
  19. Notes & Errata: Balanced Input Attenuator for the USB SuperCodec, November-December 2020; Two LED Christmas Stars, November 2020; D1 Mini LCD BackPack, October 2020
  20. Outer Back Cover

This is only a preview of the January 2021 issue of Silicon Chip.

You can view 42 of the 112 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Automotive Electronics, Part 1 (December 2020)
  • Automotive Electronics, Part 2 (January 2021)
Items relevant to "AM/FM/SW Single-Chip Digital Radio":
  • AM/FM/SW Single-Chip Digital Radio PCB [CSE200902A] (AUD $10.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • PCB-mount right-angle SMA socket (Component, AUD $3.00)
  • 16x2 Alphanumeric serial (I²C) LCD module with blue backlight (Component, AUD $12.50)
  • Firmware for the AM/FM/SW Single-Chip Digital Radio (Software, Free)
  • AM/FM/SW Single-Chip Digital Radio PCB pattern (PDF download) [CSE200902A] (Free)
  • Cutting diagrams and front panel artwork for the AM/FM/SW Single-Chip Digital Radio (PDF download) (Free)
Items relevant to "MiniHeart: A Miniature Heartbeat Simulator":
  • MiniHeart PCB [01109201] (AUD $5.00)
  • PIC12F617-I/P programmed for the MiniHeart [0110920A.HEX] (Programmed Microcontroller, AUD $10.00)
  • MiniHeart SMD parts (Component, AUD $7.50)
  • Firmware for the MiniHeart [01109201A.hex] (Software, Free)
  • MiniHeart PCB pattern (PDF download) [01109201] (Free)
  • Cutting diagrams and front panel artwork for the MiniHeart (PDF download) (Free)
Items relevant to "The Bass Block Subwoofer":
  • Cutting diagrams for the Bass Block (PDF download) (Panel Artwork, Free)
Items relevant to "Busy Loo Indicator":
  • Busy Loo Indicator PCB [16112201] (AUD $2.50)
  • Busy Loo Indicator PCB pattern (PDF download) [16112201] (Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)

Purchase a printed copy of this issue for $10.00.

THE MiniHEART: A Miniature Heartbeat Simulator Give a favourite soft toy a beating heart! With both soft sound and a real beat, it could relax a baby, puppy or kitten for sleeping, or even help you sleep better yourself. All are possible with the SILICON CHIP MiniHEART! M any newborns – human babies as well as pets – are unsettled when left alone to sleep. They miss their mum, and it’s lonely and frightening for them. Just being able to cuddle up to the sound of a heartbeat can help with their anxiety. The MiniHeart is a small gizmo that produces a low-level soothing heartbeat sound, mimicking that of a real heart. The beat rate can be adjusted so that it more accurately matches the rate of the heart it is to emulate, while a timer will shut off the heartbeat after a set time. The unit is switched on and off with a toggle switch with the actuating lever only protruding slightly outside the box. This is to prevent any injury to a baby. It is fully enclosed into a plastic case that clips together, and we have added extra screw supports to make sure it stays shut. That way, the two internal AAA cells will not be easily accessed to cause a choking hazard. We recommend enclosing the device into a cloth bag that is sewn or zippered shut. That provides an extra margin of choke hazard safety which is necessary when used with a baby. We should point out that the simulated heartbeat is not a loud sound – it is not meant to be. It is more like the subtle sound of a real beating heart; it needs to be placed close to the ear, and is felt more than heard. Think of it as a tiny heart, but in a rounded rectangular prism shape. A loud heartbeat sound would require a large loudspeaker properly baffled to produce bass along with an amplifier with a reasonable amount of power. Neither of these are a feature of the MiniHeart (but could be added externally). Heart sounds By John Clarke 40 Silicon Chip When listening to a heartbeat, you will hear two distinct, separate sounds, often called a “lub” and a “dub”. These two sounds are produced by the closing of heart valves required to pump blood efficiently. You’ve almost certainly seen the classic heartbeat waveform as shown on an electrocardiogram (ECG). These are the electrical signals sent to the heart muscles, and when monitored with electrodes on the skin, are useful for diagnosing heart problems. Electrode readings do not represent the sounds and vibrations made by the heart; heartbeat sounds are heard using a stethoscope. Australia’s electronics magazine siliconchip.com.au FEATURES AND SPECIFICATIONS • • • • • • • Fig.1: this block diagram shows that the MiniHeart is quite simple, using just a microcontroller and a Class-D amplifier chip to produce the sound. A basic RC low-pass filter turns the PWM output of the micro into an analog signal for the amp, while ferrite beads and capacitors reduce EMI from the Class-D drive to the speaker The MiniHeart block diagram is shown in Fig.1. Microcontroller IC1 produces a heartbeat waveform in the form of a pulse-width modulated (PWM) signal. The pulse rate is 31.25kHz, and the pulse width is varied to produce a smoothed lower-frequency waveform after passing through a low-pass filter. This removes the high-frequency signals so that only the heartbeat waveform remains. Fig.2 shows how a PWM signal is used to produce a lower-frequency, smooth waveform. The red waveform is the PWM output from the microcontroller, IC1, while the green waveform is its average value after filtering out the PWM pulse frequency. For convenience, we show a sinewave, although any wave shape could be generated. If the PWM signal has a 50% duty cycle, ie, an equal period of being high and low, then the filtered voltage will sit mid-way between the high and low voltage levels. To produce a higher voltage, the PWM signal duty cycle is altered so that the period while high is longer than the period when low (ie, duty cycle > 50%). Conversely, for a lower voltage, the PWM period is kept low for longer than it is high (duty cycle <50%). The green wave shows the signal that appears after the low-pass filter has removed all of the higher frequencies. Note that this PWM signal is a representation only – in reality, the frequency of the PWM signal is very much higher (around 700 times higher!) than the sine wave shown and cannot be reproduced to scale on the diagram. Overleaf, we show the various scope waveforms for the MiniHeart. Scope1-Scope3 show the general operation. Scope1 shows a few periods of the PWM signal at around 31kHz (25µs timebase). Scope2 and Scope3 (10ms timebase) are the ‘lub’ and ‘dub’ signals produced after filtering the PWM signal. Scope4 shows a single heartbeat with both the ‘lub’ and ‘dub’ waveforms, while Scope5 shows two heartbeats, with the pause between each heartbeat visible. The period between each heartbeat, the frequency of the ‘lub’ and ‘dub’ waveforms and the period between the ‘lub’ and ‘dub’ waveforms have a small amount of randomness added. This is to prevent the heartbeat from sounding too artificial. It simulates the variation in heartbeat rate and timing of a real heart. These waveforms are fed to a tiny Class-D (ie, switching) amplifier that’s usually used in mobile phones and it siliconchip.com.au • • • • • • Compact size Adjustable volume Adjustable timeout and heart rate Flashing LED synchronised with the heartbeat On/off power switch Power: two AAA cells (nominally 3V), operating down to below 2.5V Current draw: 10mA average during operation, 500nA standby (typical) Timeout: adjustable from two minutes to four hours Heartbeat rate: 42 to 114bpm Rate randomness: about 15% variation Sound frequency: 45Hz-51Hz (with a 2Hz randomness) Waveform generation method: PWM <at> 31.25kHz Waveform sampling rate: approximately 1kHz is designed to be highly efficient. It drives the small loudspeaker in bridge mode, to maximise the power output from the limited 3V DC supply. The loudspeaker is weighted, ie, the speaker cone has a weight attached to it. This is so that low-frequency vibrations will be heard and felt. Circuit details The full circuit is shown in Fig.3. At its heart (!) is a PIC12F617 microcontroller, IC1. Its master clear (MCLR) input, pin 4, is tied to the 3V supply rail via a 10kΩ resistor to provide a power-up reset function. IC1 applies 3V across adjustment trimpot VR1 via its GP5 digital output; this is only brought high when the trimpot position is monitored via IC1’s AN3 analog input (pin 3). After the GP5 output is brought high, to 3V, the voltage at AN3 is converted to a digital value via IC1’s internal analogto-digital converter (ADC). Once the value is read, the GP5 output goes low again (0V) to conserve power. Jumper link JP1 can be placed in one of two positions; position 1 where GP1 is pulled to 0V, or position 2 where GP1 is pulled to the 3V supply. When in position 1, trimpot VR1 adjusts the heartbeat rate. When in position 2, VR1 adjusts the timeout period. The heartbeat rate can be set from 42 to 114 beats per minute (BPM). The timeout can be set between two minutes and four hours. The heartbeat rate can be adjusted while the heartbeat is RED WAVEFORM = PWM (PULSE WIDTH MODULATION) SIGNAL GREEN WAVEFORM = SYNTHESISED SINEWAVE (AFTER LOW-PASS FILTERING) Fig.2: this shows how a high-frequency pulse-widthmodulated ‘square wave’ can be fed through a low-pass filter to produce a smoothly varying, lower-frequency arbitrary waveform (shown in green). The instantaneous voltage of the green waveform equals the average voltage of the red waveform. In reality, the pulse frequency would be much higher in comparison to the reconstructed waveform. Australia’s electronics magazine January 2021  41               SC  MINIHEART HEARTBEAT SIMULATOR  Fig.3: the full MiniHeart Simulator circuit is not much more complicated than the block diagram. Here you can see the detail of the second-order low-pass filter, the AC-coupling capacitors to the inputs of IC2 and the series resistors which set its gain. LED1 responds to the average voltage delivered to the speaker, so it starts to light once sound is being produced. being generated, but the timeout is only checked at powerup. So after charging timeout value via VR1, power must be switched off and on again for the new timeout to take effect. The heartbeat generation switches off after the set timeout period. This conserves power in case it is left switched on. If JP1 is removed then the pin 6 GP1 input is not held high or low. The voltage can float at a voltage anywhere between 0V and 3V. This can lead to high current consumption in IC1, reducing cell life, as digital inputs are supposed to be in one state or the other. So IC1 checks for this condition by changing GP1 to an output and setting it to a high level for 1ms. The 1kΩ resistor charges the 100nF capacitor to 3V. Then GP1 is changed to an input, and the level is checked. If the input voltage remains high, then there is either a jumper in position 2 pulling the input high, or there is no jumper, and the input IC1 uses its internal 8MHz oscillator to generate the 31.25kHz PWM signal at output pin 5. This is fed to a twostage RC low-pass filter. The first stage comprises a 10kΩ resistor and 100nF capacitor to give a -3dB roll-off at 159Hz. The second stage has the same roll-off frequency but uses a 100kΩ resistor with a 10nF capacitor. These components give an impedance which is 10 times that of the first stage filter, minimising the loading on the first stage due to the second stage. The filtered signal is fed to volume control Scope1: this shows just over seven periods of the ~32kHz PWM signal that is produced at pin 5 of IC1. The signal swing is 3V peak-to-peak, and the timebase is 25µs. Scope2: this ‘lub’ signal reproduces a a real heartbeat sound, produced by filtering the PWM waveform, measured at the wiper of VR2. Note the longer timebase used here (10ms/div). 42 Silicon Chip is held high via the charged 100nF capacitor. This test is repeated with a low output. If the level changed, then JP1 is inserted. To prevent the floating input condition, GP1 is changed to a low (0V) output and left like that, minimising power consumption. Heartbeat generation Australia’s electronics magazine siliconchip.com.au trimpot VR2 and then to the non-inverting input, pin 3, of amplifier IC2 via a VDD TO 1µF capacitor and 27kΩ resistor. INTERNAL BATTERY OSCILLATOR IC2 is a TPA2005D1 Class-D (ie, switching) amplifier in a tiny SMD package, measuring only 3 x 5mm. It is specifiIN – + cally designed for use in mobile phones VO+ where its high efficiency is crucial. The – block diagram of the TPA2005D1 is DIFFERENTIAL H-BRIDGE PWM INPUT shown in Fig.4. VO– + It has differential inputs to an internal IN + – amplifier that drives the PWM section at a switching frequency of 250kHz, set by the internal oscillator. The PWM section GND then feeds an H-bridge circuit for drivSHUTDOWN BIAS CIRCUITRY ing an external loudspeaker. The data sheet for the TPA2005 highTPA2005D1 lights two interesting points. The first is its high CMRR (common-mode rejection Fig.4: the internal block diagram of the TPA2005 Class-D audio amplifier chip. ratio) which supposedly eliminates the Its differential inputs go to a balanced analog amplifier and then onto a PWM need for input coupling capacitors. But modulator which drives a Mosfet H-bridge, and that in turn drives the speaker. this high CMRR only applies if the amThis provides high efficiency and plenty of power from a low supply voltage. plifier is used in balanced mode, with As shown, the chip can drive a speaker in Class-D mode without a filter. both inputs at the same DC level. In our circuit, we are using it in unbalanced mode, with ceramic capacitor close to IC2’s supply rails, and a 100nF the inverting input grounded (via the 1µF capacitor), so capacitor at IC1’s supply rails. we need to use two input capacitors. The 27kΩ resistor Diode D1 is included to protect against component damfor the non-inverting input, in conjunction with the inter- age if the cells are inserted with reversed polarity. In that nal 150kΩ feedback resistor, sets amplifier gain at about case, the diode will conduct and limit the negative voltage 5.5 times. Since the amplifier is a bridge type, the overall to the circuit. The disadvantage is that this will quickly gain is double that, ie, 11 times. drain the cells, but presumably, you would notice that the The second interesting point is that the TPA2005 can run device is not working and fix it straight away. without an output filter that would usually be required to The alternative protection method, with a diode in series remove the 250kHz switching signal. That is, provided the with the supply, drops too much voltage for this application. output leads are kept short. Even so, we use ferrite beads Even a Schottky type, with its lower forward voltage, would (FB1 and FB2) plus 1nF shunting capacitors to reduce elec- not be suitable and we can’t justify the cost of a Mosfet in tromagnetic interference (EMI). this role (which would have a lower voltage drop again). Power supply Indication Power is from two series AAA cells to provide a nominal 3V supply, switched on or off by power switch S1. A 100µF capacitor bypasses the switched supply with a 1µF LED1 lights simultaneously with the lub/dub sounds and is driven via the VO- output of IC2. With no signal, this output sits at an average of 1.5V. This is derived by an Scope3: this is the ‘dub’ signal measured identically to the ‘lub’ signal shown in Scope2. Again, it is a reproduction of a real heartbeat sound. Scope4: a single heartbeat sound with both the ‘lub’ and ‘dub’ waveform. You can see their slightly different shapes and amplitudes, and the delay between them. siliconchip.com.au Australia’s electronics magazine January 2021  43 Also, after the timeout period expires, microcontroller IC1 is placed in sleep mode and only draws about 150nA. Amplifier IC2 is also switched off by IC1 taking the GP0 output low, which connects to its SDWN (shutdown) input. IC2 then draws around 500nA. We measured a 500nA current for the whole heartbeat circuit when in shutdown on our prototype (half a microamp!). The cells should last for their shelf life with such a small current drain. Construction Scope5: two heartbeats as shown in Scope4. With this slower timebase, you can also see the delay between beats. RC low-pass filter (2.2kΩ/100nF) from the 250kHz square wave signal at pin 8 of IC2. It swings between 0V and 3V with a 50% duty cycle when idle. The LED lights when this voltage rises above the usual LED forward voltage of around 1.8V, and that happens when the duty cycle of the pin 8 output increases above 60%. Saving power Since the device is powered from AAA cells, we need to minimise power usage to conserve cell life. Typically, the circuit draws an average of 10mA when producing the heartbeat. However, once the timeout period has ended, the current needs to drop to a very low level until the unit is switched off. This is achieved in several ways. Firstly, as already mentioned, there is no voltage across VR1 most of the time. The MiniHeart Simulator is built on a double-sided, plated-through PCB coded 01109201 which measures 70 x 73mm. It is housed in an 80 x 80 x 20mm vented plastic enclosure. Fig.5 shows the PCB component overlays. Begin by fitting the SMD Class-D amplifier chip, IC2. It requires a very fine soldering iron tip and, ideally, a lit gooseneck or desktop magnifier (a good LED headband magnifier also works well). Identify its pin 1 dot under magnification, then orientate it as shown in Fig.5, with pin 1 towards the speaker hole. Add some flux paste to the middle of the central pad (or liquid flux, if you don’t have paste), position IC2 carefully over its pads, then tack-solder pin 4 to its pad. Check that the IC is still aligned with the PCB pads on both sides; remelt the solder if required. If all is OK, solder the remaining corner pins and then pins 2, 3, 6 and 7. Use solder wick to remove any solder that bridges between the IC pins. IC2 also has a ground pad that needs to be soldered to the PCB. This can be done by feeding solder from the underside of the PCB, through the hole positioned under the IC. Use minimal solder to prevent the solder from spreading out and shorting to the IC leads. The flux you added earlier will help this solder flow onto the pad on the underside of the IC. Now install the resistors and surface mount capacitors. Parts List – MiniHeart Heartbeat Simulator 1 double-sided, plated-through PCB coded 01109201, 70 x 73mm 1 Hammond 1151V4 vented enclosure, 80 x 80 x 20mm [Jaycar HB6118] 2 AAA PCB-mount cell holders 2 AAA alkaline cells 1 40mm diameter Mylar cone loudspeaker [Jaycar AS3004] 1 PCB-mount SPDT toggle switch (S1) [Altronics S1421] 1 8-pin DIL IC socket 2 ferrite beads, 4mm diameter & 5mm long (FB1,FB2) [Altronics L5250A, Jaycar LF1250] 1 3-way header, 2.54mm pitch with jumper shunt (JP1) 2 9mm-long M3 tapped spacers 2 M3 x 6mm panhead machine screws 4 No.4 self-tapping screws 2 M3 x 6mm Nylon machine screws (countersunk head preferred) 1 M8 marine-grade 316 stainless non-magnetic steel nut (6.35mm tall) 1 40mm length of 0.7mm diameter tinned copper wire (for FB1 and FB2) 1 100mm length of light-gauge hookup wire (or 2-way ribbon cable or figure-8) 1 small tube of neutral-cure silicone sealant (eg, roof and gutter silicone) 44 Silicon Chip Semiconductors 1 PIC12F617-I/P microcontroller programmed with 0110920A.hex (IC1) 1 TPA2005D1DGNRQ1 1.4W mono filter-free Class-D amplifier (IC2) 1 1N5404 3A diode (D1) 1 3mm high-brightness red LED (LED1) Capacitors 1 100µF 16V PC electrolytic 3 1µF 6.3V SMD M3216/1206 X7R# ceramic 4 100nF 50V SMD M3216/1206 X7R ceramic   1 10nF 50V SMD M3216/1206 X7R ceramic 2 1nF 50V SMD M3216/1206 X7R ceramic   Resistors (all 1% SMD M3216/1206) 1 100kW (code 1003 or 104) 2 27kW (code 2702 or 273) 2 10kW (code 1002 or 103) 1 2.2kW (code 2201 or 222) 1 1kW (code 1001 or 102) 1 10kW mini horizontal trimpot (VR1) 1 100kW mini horizontal trimpot (VR2) # a Y5V type was found to work in our prototype but X5R or X7R is a better choice Australia’s electronics magazine siliconchip.com.au Fig.5: these (and the matching photos below), show where components are mounted on both sides of the PCB. It’s generally best to fit all the SMDs to the top side (and possibly also the bottom side) before moving on to the through-hole components due to their small size and low height. Note how the speaker is orientated so that its terminals fit through the provided board cut-out, and also how the cell holder wires are bent to fit the PCB pads, fed in through the underside and soldered on top. IC1 is a normal 8-pin DIP . . . but IC2 (a TPA2005D1DGNRQ1) is TINY (it’s shown below about life size). A word of warning: don’t sneeze or turn a fan on if you ever want to see it again! These components are located on both sides of the PCB. The capacitors are usually unmarked except on their packaging. The resistors will probably be marked with a small code, as shown in the parts list. The first few digits indicate the resistance value, followed by the number of extra zeroes in the last position. So for example, a 1kΩ resistor will have the code 102 or 1001. That is a 10 followed by two zeros, or 100 followed by one zero. For 10kΩ, the code will be 103 or 1002 etc. Next, fit diode D1, taking care to orientate it correctly. Then mount ferrite beads FB1 and FB2 by first feeding tinned copper wire through the centre hole, then inserting and soldering these to the PCB pads. Keep the wire taught when soldering to prevent the beads from being loose. We used a socket for IC1 in case we ever want to remove it for reprogramming. Take care to orientate the socket correctly (notch toward the PCB edge). Trimpots VR1 and VR2 can be mounted now. Take care to place the 10kΩ trimpot in the VR1 position and the 100kΩ trimpot in the VR2 position. Then fit three-way header JP1 with the shorter ends of the pins through the PCB holes. Power switch (S1) is installed in the position shown. The switch we used differs slightly from the one in the parts list siliconchip.com.au in that the actuator is longer on the recommended switch. The positioning of the switch has therefore been moved further from the edge of the PCB. That way, the switch actuator will protrude from the case by the same amount as shown on our prototype. LED1 mounts with the anode (longer lead) in the hole marked ‘A’. Solder it so that the top of the lens is 11mm above the top edge of the PCB For the AAA cell holders, bend the wire terminals so that they stick out the sides of the holder, then bend them up to feed the leads through the holes on the PCB from the underside, and solder them on the top. The cell holders need to be orientated correctly, as shown on the overlay diagram. The base of the cell holders should be positioned so that they sit on the enclosure base when the PCB is seated on the four mounting posts. That means that the bottom of the cell holders will be lower than the bottom edge of the PCB. Next, fit the 100µF capacitor. Insert its leads with the longer lead through the hole marked +, then lie it over, so the capacitor body is between the LED and AAA cell holder. It must be no higher than 11mm above the top edge of the PCB. That will allow the lid to fit. The two PC stakes for the loudspeaker connections can Australia’s electronics magazine January 2021  45 i The Min HEART   SILICON CHIP Fig.6: this drilling diagram shows the locations of the 3mm LED hole, two 3mm lid attachment holes (along the bottom) and optional holes to access the adjustment trimpots without having to remove the lid. now be installed with the shorter end inserted into the PCB from the top side. At this stage, don’t plug in the PIC microprocessor (IC1). If you purchase your PICI2F617-I/P for this project from the SILICON CHIP ONLINE SHOP, it will already have the firmware (0110920A.hex) loaded. If you wish to do this yourself, the file can be downloaded from the SILICON CHIP website. Housing www.siliconchip.com.au Fig.7: the “front panel” artwork, which has a hole provided for the LED. See our website link in the text for ideas on how to print this out and attach it to the lid. You can download a PDF of this artwork from the SILICON CHIP website. the LED hole and the two trimpot adjustment access holes. The holes for the trimpots are optional; you can omit them if you’re happy to open the case if you need to make any adjustments. The lid panel artwork (Fig.7) is also available for download from our website. Details about printing and attaching panel artwork can be found at www.siliconchip.com. au/Help/FrontPanels Press the side clips into the case lid to release it from Testing the baseplate. Locating flanges insert into one edge of the Place a shorting link in JP1’s position 1 and connect two lid also secure it in place. wires, about 80mm long, to the two PC stakes under the The PCB is designed to be mounted onto the integral PCB in readiness to solder to the miniature 8-ohm speakstandoffs on the base of the case. There is only one correct er. We used two wires stripped from a length of rainbow orientation, and that is with the two notches along the top cable; mini figure-8 would also work well as well as sepaedge of the PCB fitting into the rate hookup wires. case lid locating flanges on the The loudspeaker mounts on base plate. The PCB is secured top of the PCB with the speaker with small self-tapping screws terminals in the cut-out area. The into the standoffs. wires connect to the speaker terWe attach two 9mm-long M3 minals from the underside of the tapped spacers to the PCB to alPCB. For the moment, the speaker low the lid to be screwed down. will be loose. This is in addition to the side Insert the two AAA cells and clips on the cover that hold it in switch on the power. Check there place. Two screws then go into is about 3V between pins 1 and 8 the standoffs from the outside of of IC1’s socket. the lid. Attach these spacers by Disconnect power and insert feeding short machine screws the programmed PIC in its sockthrough the underside of the et, making sure it is oriented corPCB into the two corner holes, rectly (the notch toward the edge then tighten the tapped spacers of the PCB). Reapply power and onto the screw shafts. the speaker should start to move This view shows how the PCB is secured to the case The template (Fig.6) shows in response to the ‘lub dub’ sound. lid but more importantly, shows the “damper” glued the position of the two holes re- to the mica speaker diaphragm (in this case, a stain- If not, make sure that VR2 is adjustquired for the securing screws. less steel nut). Don’t be tempted to use a mild steel ed at least partly clockwise. Adjust It also shows the locations for nut: they’re magnetic and will not work in this role. further clockwise for more sound. 46 Silicon Chip Australia’s electronics magazine siliconchip.com.au Note that the sound will have an approximate 1kHz background tone. That’s because, even though this tone is filtered out in the circuitry, the speaker is much more efficient at producing 1kHz compared to the approximately 47Hz ‘lub dub’ sounds. Also note that you won’t really hear the ‘lub dub’ sound, but you will feel it if you place a finger at the centre of the loudspeaker cone. The loudspeaker cone needs to be weighted to make the heartbeat audible and to prevent the reproduction of higher frequency tones. To do this, we use an M8 stainless steel (nonmagnetic) nut as a weight on the speaker cone. A non-magnetic nut must be used; otherwise, the speaker cone would be pressed against the magnet of the speaker by the nut. We get away with this because the speaker cone is made from Mylar and so it is quite strong. This means that the central speaker coil is still centred within the magnet gap even with extra mass. To attach the nut, apply a smear of neutral-cure silicone sealant (roof and gutter silicone is ideal) to one side of the nut and affix centrally on the speaker cone. Additional silicone is required to fill the inside of the nut, making sure it is filled down to the cone. Keep the silicone flush with the top face of the nut. Also apply a thin layer around the speaker cone. While you’re at it, it’s a good idea to secure the ferrite beads (FB1 and FB2) using some of the silicone to hold them to the PCB. Only a small amount is necessary. This will prevent them from rattling and adding obscure sounds to the heartbeat. The loudspeaker is also secured to the PCB with some silicone around the central magnet, where it fits into the PCB hole. Note that the speaker needs to be positioned correctly, with the wire entry points positioned over the PCB cutout and with the back of the speaker magnet resting on the base of the case. The PCB should be temporarily positioned on the integral standoffs in the case while the silicone cures. This way, the speaker will be at the correct height above the PCB. Using it Adjust the timeout period so that the heartbeat sound lasts for the length of time you require. This is done with JP1 in position 2. To do this, move JP1 into position 2 with the power off and set the required time. Full clockwise adjustment of VR1 gives a 4-hour timeout. The mid position is two hours and mid-way between fully anticlockwise and mid-way is about one hour. Set the timeout and then switch on the power. The timeout period will be recorded. Any further adjustment of VR1 with the power on will be ignored. It is only the setting of VR1 at power-up when JP1 is in position 2 that is recorded. The setting is stored in non-volatile flash memory and remembered for use next time. When jumper 1 is in position 1, the heartbeat rate can be adjusted. This can be changed with power on, from 42 to 114 beats per minute. The setting is also stored in flash memory, and the last setting will be used should the unit be powered up with JP1 in position 2. The volume is set using VR2. However, the drive to the loudspeaker will become distorted if VR2 is rotated too far clockwise, so a position less than halfway clockwise should SC be used. AUSTRALIA’S OWN MICROMITE TOUCHSCREEN Since its introduction in February 2016, Geoff Graham’s mighty Micromite BackPack has proved to be one of the most versatile, most economical and easiest-to-use systems available – not only here in Australia but around the world! Now there’s the V3 BackPack – it can be plugged straight into a computer USB for easy programming or re-programming – YES, you can use the Micromite over and over again, for published projects, or for you to develop your own masterpiece! The Micromite’s BackPack colour touchscreen can be programmed for any of the following SILICON CHIP projects: BACKPACK Many of the HARD-TO-GET PARTS for these projects are available from the SILICON CHIP Online Shop (siliconchip. com.au/shop) Poor Air Quality Monitor (Feb20 – siliconchip.com.au/Article/12337) FREE GPS-Synched Frequency Reference (Oct18 – siliconchip.com.au/Series/326) PROGRAMM Tariff Super Clock (Jul18 – siliconchip.com.au/Article11137) ING Buy either Altimeter & Weather Station (Dec17 – siliconchip.com.au/Article/10898) tell us whichV2 or V3 BackPack, pr oj ect you for and we’ll Radio IF Alignment (Sep17– siliconchip.com.au/Article/10799) program it fowant it r you, Deluxe eFuse (Jul17 – siliconchip.com.au/Series/315) FREE OF C HARGE! DDS Signal Generator (Apr17 – siliconchip.com.au/Article/10616) Voltage/Current Reference (Oct16 – siliconchip.com.au/Series/305) Energy Meter (Aug16 – siliconchip.com.au/Series/302) Micromite V3 BackPack: * Super Clock (Jul16 – siliconchip.com.au/Article/9887) JUST $7500 Boat Computer (Apr16 – siliconchip.com.au/Article/9977) See August 2019 (Article 11764) Ultrasonic Parking Assistant (Mar16 – siliconchip.com.au/Article/9848) P&P: Flat $10 PER ORDER (within Australia) *P Price is for the Micromite BackPack only; not for the projects listed. www.siliconchip.com.au/shop siliconchip.com.au Australia’s electronics magazine January 2021  47