Silicon ChipVery accurate speedo, car clock & auto volume change - June 2019 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Will 5G mobile networks live up to the hype?
  4. Feature: From a knotted rope to side-scanning SONAR by Dr David Maddison
  5. Project: An AM/FM/CW Scanning HF/VHF RF Signal Generator by Andrew Woodfield, ZL2PD
  6. Feature: e-Paper displays: no paper involved! by Tim Blythman
  7. Project: Steering Wheel Audio Button to Infrared Adaptor by John Clarke
  8. Product Showcase
  9. Serviceman's Log: Fixing a “Cheap as” set of cans by Dave Thompson
  10. Project: Very accurate speedo, car clock & auto volume change by Tim Blythman
  11. Project: DSP Active Crossover and 8-channel Parametric Equaliser, part two by Phil Prosser & Nicholas Vinen
  12. Feature: El Cheapo Modules: Long Range (LoRa) Transceivers by Jim Rowe
  13. Subscriptions
  14. Vintage Radio: AWA Radiola Model 137 by Rob Leplaw
  15. PartShop
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: DSP Active Crossover/Parametric Equaliser, May 2019
  19. Outer Back Cover: Hare & Forbes

This is only a preview of the June 2019 issue of Silicon Chip.

You can view 39 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.

Items relevant to "An AM/FM/CW Scanning HF/VHF RF Signal Generator":
  • AM/FM/CW Scanning HF/VHF RF Signal Generator PCB [04106191] (AUD $15.00)
  • ATmega328P programmed with the firmware for the RF Signal Generator [0410619A.HEX] (V14) (Programmed Microcontroller, AUD $10.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • Firmware for the RF Signal Generator [0410619A.HEX] (Software, Free)
  • AM/FM/CW Scanning HF/VHF RF Signal Generator PCB pattern (PDF download) [05105191] (Free)
  • AM/FM/CW Scanning HF/VHF RF Signal Generator panel artwork, cutting diagrams and STL files (downloads) (Free)
Articles in this series:
  • An AM/FM/CW Scanning HF/VHF RF Signal Generator (June 2019)
  • An AM/FM/CW Scanning HF/VHF RF Signal Generator (June 2019)
  • Building the RF Signal Generator (Part 2) (July 2019)
  • Building the RF Signal Generator (Part 2) (July 2019)
Items relevant to "e-Paper displays: no paper involved!":
  • Demonstration software for the e-Paper/e-Ink article (Free)
Items relevant to "Steering Wheel Audio Button to Infrared Adaptor":
  • Steering Wheel Controller to IR PCB [05105191] (AUD $5.00)
  • PIC12F617-I/P programmed for the Steering Wheel Controller to IR project [1510519A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware (ASM and HEX) files for the Steering Wheel Controller to IR adaptor [1510519A.HEX] (Software, Free)
  • Steering Wheel Controller to IR PCB pattern (PDF download) [05105191] (Free)
  • Steering Wheel Controller to IR lid panel artwork (PDF download) (Free)
Items relevant to "Very accurate speedo, car clock & auto volume change":
  • GPS "Finesaver Plus" Speedo/Clock/Volume Control PCB [01104191] (AUD $7.50)
  • PIC16F1455-I/P programmed for the GPS "Finesaver Plus" Speedo/Clock/Volume Control [0110419A.HEX] (Programmed Microcontroller, AUD $10.00)
  • 1.3-inch blue OLED with 4-pin I²C interface (Component, AUD $15.00)
  • 1.3-inch white OLED with 4-pin I²C interface (Component, AUD $15.00)
  • VK2828U7G5LF TTL GPS/GLONASS/GALILEO module with antenna and cable (Component, AUD $25.00)
  • MCP4251-502E/P dual 5kΩ digital potentiometer (Component, AUD $3.00)
  • Spare cable for VK2828U7G5LF GPS module (Component, AUD $1.00)
  • Laser-cut acrylic case pieces for the GPS "Finesaver Plus" Speedo/Clock/Volume Control (PCB, AUD $10.00)
  • Firmware (C and HEX) files for the GPS "Finesaver Plus" Speedo/Clock/Volume Control [0110419A.HEX] (Software, Free)
  • GPS "Finesaver Plus" Speedo/Clock/Volume Control PCB pattern (PDF download) [01104191] (Free)
Items relevant to "DSP Active Crossover and 8-channel Parametric Equaliser, part two":
  • DSP Crossover CPU PCB [01106193] (AUD $5.00)
  • DSP Crossover LCD Adaptor PCB [01106196] (AUD $2.50)
  • DSP Crossover front panel control PCB [01106195] (AUD $5.00)
  • DSP Crossover DAC PCB [01106192] (AUD $7.50)
  • DSP Crossover power supply PCB [01106194] (AUD $7.50)
  • DSP Crossover ADC PCB [01106191] (AUD $7.50)
  • DSP Active Crossover complete PCB set (7 boards) [01106191-6] (AUD $40.00)
  • PIC32MZ2048EFH064-250I/PT programmed for the DSP Active Crossover/Equaliser (V8) (Programmed Microcontroller, AUD $30.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • 128x64 Blue LCD screen with KS0108-compatible controller (Component, AUD $30.00)
  • Firmware and source code for the DSP Active Crossover/Equaliser project [0610619A.HEX] (Software, Free)
  • DSP Active Crossover/DDS/Reflow Oven PCB patterns (PDF download) [01106191-6] (Free)
Articles in this series:
  • DSP Active Crossover and 8-channel Parametric Equaliser (May 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (May 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser, part two (June 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser, part two (June 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (July 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (July 2019)
Items relevant to "El Cheapo Modules: Long Range (LoRa) Transceivers":
  • Sample code for El Cheapo Modules - 434MHz LoRa Transceivers (Software, Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 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 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 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 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 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 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 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: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 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 (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 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 Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)

Purchase a printed copy of this issue for $10.00.

This is one of those gadgets which you have always needed – but until now, never realised it! It uses the highly accurate time signals embedded in a GPS signal to display your car’s speed – almost certainly with much more accuracy than your speedo. It displays the exact time – without you having to set it. And last – but by no means least – it automatically adjusts your car radio/stereo volume to a comfortable level which suits the speed you’re travelling at as well as noise in the car. It’s cheap and easy to build . . . GPS FineSa ver ...PLUS! If • Very Accurate Speedo • Very Accurate Clock • Automatic Car Audio Volume Adjustment by Tim Blythman you have any doubts about the accuracy of your car’s inbuilt speedo (and you should!), then this little circuit is about to become your best friend! Speedometers can (legally) give readings which overstate your true speed by as much as (10% + 4km/h) high! That can leave you with a difficult decision: be overtaken by just about everybody, or speed up and risk going over the speed limit, as you don’t know exactly how fast you are going. By the way, if you drive an older (<2006) car its speedo could be worse – much worse! The old rule simply said ±10% – so if you’re innocently driving along with your speedo showing 100km/h (the speed limit), you could actually be doing 110km/h – and you won’t know about it until you start seeing flashes of red and blue! But with a clear view of the sky, GPS speed readings are typically accurate to well within 1km/h. So it’s worth 68 Silicon Chip building this project just for that function alone. But wait, there’s more! It’s also a very accurate clock. GPS provides not only an accurate determination of your speed and position, but the (exact) current time as well. This is converted from UTC to your local time and it is also shown on the display. All that you need to do when you set up the unit is enter your local timezone offset. Having accurate time also solves yet another common driving problem: your dashboard clock says it’s 4:01pm... Phew! Just missed that school zone 40km/h limit. So you sail through at the “normal” 60km/h speed limit. Or did you just miss it? Is it actually 3:59pm and the 40km/h school zone limit still applies? FLASH! Uh-oh: maybe your clock is ever-so-slightly out? It’s better to know for sure, and GPS time is accurate to Australia’s electronics magazine siliconchip.com.au the millisecond. (That, incidentally, is also how school time zones know when to book you and when not to). of the GPS Volume Control, and it will control the volume of the audio passing through it. • Powered from 12V DC (eg, vehicle supply) or USB 5V DC Alternatively, if you have a • Automatic GPS speed-based volume control head unit feeding a line level I already have a sat-nav! • GPS speed display signal into a dedicated amplifiNot like this, you don’t. In- • Shows local time derived from GPS er, then the GPS Volume Control built (ie, OEM-fitted) sat-nav • Volume control range: 0-200% can be connected between the systems are great – but we don’t head unit and amplifier. Many know of any which display in- • Stylish, slimline laser-cut case aftermarket head units have stantaneous speed, as this one • Blue OLED display matches many car consoles RCA ‘preout’ output sockets at does. That’s because the manu- • Display brightness adjustment the back. In this case, you can facturers want to avoid a legal • Automatic display dimming can be easily added use 2xRCA to 3.5mm jack plug “stoush” when the sat-nav and leads to make the connections. speedo showed different readings, which they almost inIf you have a standard DIN-size radio in your car but no variably will. preouts and/or no separate amplifier, the easiest way to in(On the other hand, aftermarket sat-nav units almost install this device seamlessly may be to replace your radio variably display instantaneous speed, which is why you’ll with one that does have preouts and wire up a separate see many cars with both an in-dash and an on-dash GPS). amplifier to drive the vehicle’s inbuilt speakers. You can then easily connect this unit between those two devices. But wait, there’s even more! Unfortunately, if you have a single dedicated head unit When you are driving in traffic which is continually with integrated amplifier, there’s usually no easy way to tap speeding up and slowing down, do you continually have into the audio path to alter its volume. Your only real opto nudge the volume of your radio or car stereo up and tion is to open the unit up, find the tracks feeding the sigdown to maintain a comfortable listening level above the nals into the power amplifier section, cut these, then solder road noise? This clever little device will do that for you, the inner conductor of shielded wires to each end of these without you having to take your eyes off the road! tracks, with the shields going to a nearby ground point. Many newer (luxury?) cars have this feature built in – These wires can then be soldered to 3.5mm stereo plugs, it’s called SVC or speed-sensitve volume control. Build one for the outputs of the preamp and one for the inputs to this project and your old jallopy can have this feature too! the amplifier, which should then be routed out of a hole at You can see a typical display in the photo opposite. the rear of the unit (drill one if necessary), which can then The bar graph at the bottom shows the volume adjustbe plugged into the GPS Volume Control sockets. ment which is currently being applied to audio signals Each head unit will route its audio signals differently passing through the unit. Refer to Fig.4 to get an idea of so we can’t give you much guidance in finding them, exhow the volume varies with speed. We’ll cover that in cept to suggest that you look for the audio amplifier chips/ more detail later. transistors, which will probably have heatsinks, and try to find the signal tracks leading to them. Making the audio connections You will need a scope or audio probe to have much Looking at the volume control function first, it has a chance of figuring out which tracks carry the audio signals. 3.5mm stereo input and output socket, for compactness. This is not a job for the faint-hearted or inexperienced. The way you use the GPS Volume Control will depend on How it works the setup you have. You will need to be able to inUnsurprisingly, the GPS Volume Consert the GPS Volume Control into trol is based around a microcontrolthe audio signal path to give it ler. The circuit diagram is shown control of the volume. in Fig.1. We’re using a ‘lowly’ It is ideally suited to takPIC16F1455. ing audio from a portaWhile this is a low-cost device, ble audio source such it does everything we need and as an MP3 player or comes in a compact 14-pin DIL mobile phone with a package. 3.5mm output socket. If You might rememyou have an arrangement ber that we used this where you connect a chip for the May mobile phone into the 2017 Microbridge auxiliary input on your (siliconchip.com. radio ‘head unit’, then au/Article/10648) this lead can now be used and Micromite to connect the GPS Volume V2 BackPack Control to the head unit. (siliconchip.com.au/ Then you will merely need another Article/10652) articles. auxiliary lead to connect your exIt has USB support, but we isting audio source into the input aren’t using that in this project. siliconchip.com.au Features Australia’s electronics magazine June 2019  69 Let’s start by looking at the audio processing, as that is one of the main aspects of this device. The stereo audio signal is applied to CON2, a 3.5mm socket. 100kresistors provide a DC bias to ground while 1kseries resistors protect the rest of the circuit from excessive voltages. The signal is then AC-coupled to digital potentiometer IC2 via 1µF non-polarised capacitors, with the digital pot signals DC-biased to a 2.5V half supply rail via 22kresistors. IC2 is an MCP4251 dual 5kdigital potentiometer. The P0A/P0B and P1A/P1B terminals connect to either end of the ‘track’ of the internal potentiometers, while P0W and P1W are the digitally controlled ‘wipers’ which move along those ‘tracks’. The audio signals are applied to the “A” track ends while the “B” track ends are connected directly to the 2.5V reference rail. So with the ‘wiper’ at the “A” end, the signal amplitude is pretty much the same as the original, and when it is at the “B” end, the signal is heavily attenuated. Intermediate positions give different amounts of attenuation. There is a little extra attenuation in the signal due to the 1kseries protection resistors, so the maximum output signal is about 80% of full amplitude while the minimum is around 1%. The signals from the wipers go directly to the non-inverting inputs (pins 3 & 5) of dual rail-to-rail op amp IC3 (LM6482AIN). The two channels have a gain of around three, set by the 10kand 5.1kfeedback resistors. As well as providing gain, this op amp provides low output impedances. Taking this gain into account, the total gain across the analog section of the circuit is just over two. Given that the digital potentiometers power up with their wipers set at their mid-points, the default gain is slightly over unity. The output from IC3 is AC-coupled by two more 1µF capacitors. The op amp is isolated from any output capacitance by a pair of 100resistors. The 22kresistors re-bias the output signals near 0V. These signals are fed to another 3.5mm jack socket, CON3. GPS data The GPS module is connected to CON7 and runs from the same 5V rail as the ICs in this circuit. It generates position, speed and time data once per second and this is sent to microcontroller IC1 in NMEA1803 format. This signal goes to the hardware UART serial input on pin 5. We used an SKM53-based module for our prototype but the VK2828U7G5LF modules (or revised -U8G5LF versions) available from the SILICON CHIP ONLINE SHOP also work fine (see siliconchip.com.au/Shop/7/3362). IC1 processes the serial stream and extracts time, speed and validity data from the RMC ‘sentence’, which it expects to receive at 9600 baud. That is the default for many GPS modules, including those mentioned above. Note that the “RM” in RMC stands for “recommended minimum”, meaning that all NMEA-compatible GPS receivers will generate this data. Typical RMC data is shown in Fig.2. IC1’s system clock is generated internally and runs at 48MHz, with a 12MHz instruction clock. Once IC1 gets valid data, it updates the display on the OLED screen using an I2C serial bus from pins 7 (SCL, clock) and 8 (SDA, data). This display shows your current speed, in large digits. It also calculates the new potentiometer setting for the appropriate volume, based on your speed, and sends a command to the digital pot to update its current ‘position’. This is sent over IC1’s SPI serial bus to IC2 via pins 9 (SDI - data), 10 (SCK - clock) and 6 (CS - chip select). The three onboard tactile pushbuttons are connected between pins 2, 12 & 13 of IC1 and ground. These pins are configured as digital inputs and each has a 10kpull-up resistor to the 5V rail. So usually these inputs are held high but if a button is pressed, that input goes low and IC1 detects this and takes the appropriate action. Why do you need to turn the volume up when you’re moving faster? Most sources of noise in a vehicle vary depending upon your speed. The major sources vary from vehicle to vehicle, but it typically consists of a mix of road (tyre) noise, engine noise and wind noise. Engine noise can be further broken up into induction noise, mechanical noise, transmission noise and exhaust noise. Road noise is the sound that your tyres make as they rotate and distort under the weight of the vehicle. This varies based on speed, road surface, conditions (eg, water on the road) and tyre type/condition. It’s attenuated by the vehicle’s soundproofing, but some vehicles have much better soundproofing than others. The only easy way to reduce this is to swap out your tyres for quieter ones, but there is usually a compromise between quietness, grip and cost. So if you want quiet 70 Silicon Chip tyres with lots of grip, they will probably be costly. And high-performance tyres are usually noisy even though they are expensive. Engine noise varies by many different parameters. There is very little of this in an electric car – usually just a whine. But petrol and diesel engines can vary from whisper quiet to deafening. This varies to some extent based on load, which is related to how fast you are going, as well as whether you’re going up or down a hill and whether you are accelerating, cruising or coasting. Engine noise consists primarily of induction noise (air going into the engine) and mechanical noise (fuel injectors, valves, gears). Combustion noise is normally muffled significantly by the water jacket. Vehicles with forced induction (turbo- or supercharged) typically have less induction noise, since the compressor muffles it. But modern direct-injection petrol or diesel enAustralia’s electronics magazine gines typically have very audible injectors, while older engines may have more valve-train noise. Exhaust noise depends on the type of engine, load conditions and exhaust system type and condition. Exhausts in poor condition or high-performance exhausts will let a lot more noise through. Turbocharged cars may have less exhaust noise since the turbine reduces exhaust pressure pulses. Wind noise is typically only heard at higher speeds and usually only if the other sources of noise are low (ie, a wellinsulated car with a quiet engine cruising at speed). You may hear whistles or buffeting. This varies depending on the aerodynamic design and anything attached to the outside of the vehicle, such as a roof rack, rain shields, bull bar and so on. siliconchip.com.au Power supply DC power is fed into either CON1, a 2-way header or at CON6, a mini-USB socket. CON1 can be connected to a vehicle’s nominally 12V DC supply (varying over approximately 11-14.5V) and this feeds 5V regulator REG1 via D1, a schottky diode used for reverse polarity protection. If USB power is applied to CON6, this bypasses REG1 and powers the circuit directly. Only one of these power sources should be connected at any time. The 5V rail powers IC1, IC2, IC3, the OLED screen, the GPS module and is also used to derive the 2.5V half supply rail via two 10kresistors and a 220µF filter capacitor. Fig.1: audio from CON2 is coupled to IC2, a dual digital potentiometer. The volume-adjusted signals appear at pins 6 and 9 and are then fed to op amp IC3 for buffering and amplification before being fed to output socket CON3. This is all controlled by micro IC1 which gets the current speed and time from the GPS module wired to CON7 and also updates the OLED MOD1 display siliconchip.com.au Australia’s electronics magazine June 2019  71 being used for calculations. Laser-cut case We’ve designed a slimline laser-cut case specifically for this project, so the completed unit is only about 20mm thick. The top panel is simple, with just the display and three buttons visible. Access to the power, audio and header for the GPS are through the sides, as is the trimpot for brightness adjustment. Sourcing the OLED screen RMC Sentence Time GPS State Speed in knots Date Fig.2: the GPS module produces a serial data stream consisting of ‘sentences’ which carry GPS information. The ‘RMC’ sentence contains all the information we need; the time, speed (in knots) and whether a valid fix has been achieved. Note that in this case, the date is out by around 19 years as this module suffers from the GPS week roll-over bug, but it still gives valid time and speed data. Serial communications As mentioned above, the GPS signal, OLED screen control and digital potentiometer control are transmitted over three different types of serial bus: UART, I2C and SPI respectively. To avoid conflicts between the various hardware peripheral modules and to provide maximum pin flexibility, the UART interface is implemented in hardware while the I2C and SPI buses are software-driven (‘bit banged’). The control of the digital potentiometer is straightforward; we need only transmit a six-bit command followed by a ten-bit potentiometer value to update the position of one of the potentiometers. For simplicity, this sixteen-bit command is sent as two eight-bit values, as we don’t need the full precision of the potentiometers. The value sent is proportional to the wiper position and thus the final volume. Both channels are set to the same value to maintain stereo balance. The display module, MOD1, incorporates an SH1106 display controller and a 128x64 OLED panel, as well as I2C pull-up resistors and a regulator to supply 3.3V to the SH1106. The I2C interface does not need level conversion as the microcontroller only needs to pull the I2C control lines down to GND; the module’s onboard pull-ups bring them back up to 3.3V when the micro releases them. IC1 initialises MOD1 during its startup sequence and continues to update it to display the information that is needed. There are two main screens; one has the speed, time, current volume and GPS signal status. The second screen shows some settings which can be changed. The one remaining pin on IC1 is an analog input and has been broken out to a three pin header, CON5. This can be used to adjust the display brightness manually using a trimpot. But you could instead connect a voltage divider comprising a fixed resistor and a light-dependent resistor (LDR) to provide automatic brightness control. Microcontroller IC1 is configured with an internal timer (Timer1) which triggers an interrupt around 22 times per second. This is used to smoothly ramp the volume as well as keep a check on how long it has been since a valid GPS sentence has been received. This prevents stale data from 72 Silicon Chip There are various generic OLED modules available in different sizes; we are using a 1.3in variant, although 0.96in versions are also available with a similar I2C interface. Some OLED modules have a different pinout to the one we used, so check this when you are ordering yours. Ours has four pins, which are from left to right: GND, VCC, SCL and SDA. Some OLED modules also use the SSD1306 display controller, which uses a superset of the commands used by the SH1106. The software has been designed to be compatible with both display controllers. Construction Use the PCB overlay diagram, Fig.3, and matching photo, as a guide to assembling the board. The project is built on a double-sided PCB coded 01104191 which measures 92mm x 69mm. As mentioned earlier, it is housed in a custom-made acrylic case which results in a compact package, only about 20mm thick. The most challenging part to solder is the SMD mini-USB socket, so if you plan to use this, solder this first. Locate the socket using the lugs on its underside and tack one of the mounting tabs in place. Check that the two power pins are correctly aligned and then solder them to their pads. We have made the solder mask openings slightly larger so that you don’t need to get your iron in so close (which would risk bridging the pins). It’s not necessary to solder the middle two data pins, which are unused, but if you do bridge them, you should clean them up anyway just in case. Then solder the remainder of the mechanical pins on the socket. Next, fit the resistors as shown in Fig.3. All resistors are mounted flat against the PCB. Follow with diode D1, which must be orientated with its cathode stripe aligned as shown. The four components of the laser-cut acrylic case. We’ve made the matte side the outside to minimise reflections. Australia’s electronics magazine siliconchip.com.au As you continue construction, keep in mind that the front panel will be mounted around 10.5mm above the top of the PCB, so taller components (eg, electrolytic capacitors) need to be laid on their sides. As you proceed with assembly, check that all components are mounted flush so that they aren’t higher than necessary. Fit the three ICs next. Although you could use sockets, we would not recommend them for IC2 and IC3, as they may affect the audio signal integrity. Make sure the ICs are orientated as shown in Fig.3. REG1 is mounted with its tab against the PCB. We suggest that you attach it to the board using a machine screw and nut before soldering its pins. Due to minimal clearance behind the PCB, put the head of the screw behind the PCB and attach the nut from above. Note that REG1 and D1 can be omitted if you don’t plan to run the unit from a 12V supply. Next, fit the MKT and ceramic capacitors where shown, followed by the electrolytic capacitors, which must be laid over for the case to fit later. Only the electrolytic capacitors are polarised. Make sure that the longer leads go into the pads marked “+” on the PCB. Now mount 3.5mm sockets CON2 and CON3. Some types can be quite a firm fit on the PCB, so check that they are pushed all the way down before soldering their pins. They are keyed and will only fit one way. Next install CON4, the ICSP header. If you have a pre-programmed PIC or can program the PIC before installation, you can leave it off. We suggest using a right-angle header, but a typical straight header is only 9mm tall and so should also fit. Then attach the connector for the GPS module (CON7). We used a right-angle male header and interfaced to the GPS module using jumper wires so that we could easily detach it. We then wrapped the GPS module in heatshrink so that it can be placed in a spot that has a good view of the sky. You could solder wires from the GPS module directly to CON7 if you prefer. If you’re fitting a multi-turn trimpot for manual Fig.3: use this PCB overlay diagram and photo as a guide when screen brightness adjustment, bend its leads by building the GPS Volume Control. All the taller components, except 90° and solder it to the pads for CON5. Although switches S1-S3, need to be mounted on their side to clear the front it will overhang the PCB, the case is large enough panel. Rather than fitting connectors for CON1 and CON7, you can to protect it. solder wires directly to the PCB. Note the added multi-turn trimpot To use an LDR for automatic brightness control, and LDR for brightness control; you could leave the LDR off or use an we suggest that you fit a 1Mmulti-turn trimpot LDR and a fixed resistor. instead, then solder a 10k LDR between the being bumped, and apart from the initial setup, they only middle pin and the one marked “5V”. Later, when you’re need to be accessed when daylight savings starts and ends. putting the whole thing in a case, you can bend it so that Alternatively, you could use switches that are 15mm it will be exposed to ambient light. tall and they will protrude around 2mm above the case. This will still let you set the brightness for dark environ12mm tall switches will work too, leaving the switches ments using the trimpot, but it will automatically increase only slightly recessed. the brightness when the ambient light level is higher. Solder the switches to the PCB, ensuring that their botThe three tactile switches are the only components that toms are flat against the PCB, so they point straight up. protrude through the front panel, so you can access them The final part to attach is the OLED module, MOD1. This during use. We used switches that are 9mm long (from PCB needs to be done last. to tip), which means they are recessed and can only be First, check that the pinout on the module matches that pressed with a small screwdriver or pen. This avoids them siliconchip.com.au Australia’s electronics magazine June 2019  73 Once a fix has been obtained, the speed will be shown, three “)” symbols will be displayed and the time will be shown instead of dashes. The time may not be correct until the time zone is set. You can also attach an audio source and test that audio is being passed through undistorted. Even without a GPS fix, an audio signal should make its way through with approximately unity gain. If everything works as noted, the unit is functional, and you can complete its housing. Case assembly The completed unit inside its purpose-designed, lasercut acrylic case, obviously without the front case section. CON6 (at left) is a 5V (USB) power input socket; it can also be powered from the 12V DC car supply via CON1. The CON7 header pins at right connect to the GPS receiver. printed on the PCB. If it does not, you will have to remove the four-pin header from the module and use short lengths of hookup wire instead. You may wish to do this anyway, as it will provide some flexibility in assembling the case. Otherwise, you can just solder a four-way female header to the PCB and plug the module directly into this header. A regular 9mm-high header socket is probably too high, but Altronics offer a low profile (5mm) female header, Cat P5398. If you are using a 12V supply, now is the time to fit the accessory plug and lead. Fit the twin-core wire into the plug and solder the other end of the wires to the pads on the top left of the PCB, threading it through the adjacent hole for strain relief and checking that the polarity is correct. With the display module connected, the GPS Volume Control is complete enough to test. If you used a blank PIC, now is the time to program it, using the .hex file found on the SILICON CHIP website. Testing At this point, we can check the basic functions of the GPS Volume Control. Start by powering the unit up, either from the 12V input (if REG1 and D1 have been fitted), or from 5V via USB socket CON6. The display should spring to life, probably showing mostly blank space with “km/h” on the right. Below this will be the volume bar graph set at its midpoint and, below that, the GPS status and a series of dashes. If there is nothing on the display, turn the unit off, as there may be a problem with its construction. Some GPS modules can take up to 15 minutes to obtain a fix from a cold start, so this display may remain for a while until the GPS unit gets a fix. This can be improved by taking it outside to get a clearer view of the sky. Even if a fix has not been obtained, you should see two “)” symbols next to the GPS after a few seconds. If you only see one, then the most likely cause is that the GPS module is producing data at the wrong baud rate, or it has been wired incorrectly. 74 Silicon Chip We have designed the case so that the matte side of the black front and back panels face outwards, avoiding reflections from the glossy side. Start assembling the case with the back panel. Feed four of the 10mm M3 machine screws through the rear of the back panel, and secure with M3 Nylon nuts on the other side of the panel. These nuts also act as spacers to keep the PCB clear of the back panel. If MOD1 has been attached to the PCB via a header socket, unplug it at this stage. If it has been attached with wires, fold it out of the way. Insert the top and bottom panels of the case into the slots on the rear panel, then thread the PCB over the screw threads and secure it in place by threading the four 9mm tapped spacers on top. Now sandwich the OLED between the top of the spacers and the back of the front panel. These are then secured by another four 10mm M3 machine screws. We recommend that you use black machine screws for the top to match the top panel colour. Available functions On power-up, the main speed screen is shown, with your current speed readout in large digits, with a choice of km/h, mph or knots. Below the speed is a bar graph indicating the current volume, which defaults to mid-level at startup. Below the volume indication, the GPS status is shown as the letters “GPS” followed by up to three “)” symbols. One means that serial data is being received by IC1, two symbols means that a correctly formed GPS sentence has been detected, and three indicates that satellite lock has occurred and that the GPS data is valid. At bottom right, the time is shown in hh:mm:ss format. If the GPS does not have a lock, the speed and time displays will be blank, and the volume will not be adjusted. Left and right edge-on views of the unit in its assembled case. Only four case panels are used so that the connectors on either side of the PCB can be accessed. Australia’s electronics magazine siliconchip.com.au Parts list – GPS-Based Speedo, Clock & Volume Control Fig.4: audio volume varies with speed according to this graph. Below the adjustable Bottom Speed, the Bottom Volume is applied. As the speed increases above this, the volume increases linearly until Top Volume is achieved at Top Speed. At higher speeds, the Top Volume is maintained. The volume slowly changes towards its target so that there are no sudden changes in volume with sudden changes in speed. Pressing the left-hand SEL button (S1) cycles through the available settings and then back to the main screen. The settings are: Top Speed, Top Volume, Bottom Speed, Bottom Volume, Units, Time Zone and an option to save the settings to flash memory. Pressing the DOWN and UP buttons (S2 and S3) will change the currently selected setting. For the speed and volume settings, the values can be set between zero and 255. The speed units can be km/h, mph or kts for km/h, mph or knots respectively. The time zone offset is set in multiples of 15 minutes from UTC. This is stored as an eight bit signed number, so it can vary between -32:00 and +31:45, although -12:00 to +14:00 is enough to cover the world’s current time zones. The settings take effect immediately although saving to flash (so that the settings are loaded when the device restarts) is done manually, by pressing the UP button when the save option is selected. This avoids excessive wear and tear on the flash memory. The volume control works as follows. When the speed is at or above Top Speed, the volume is set to Top Volume. When the speed is at or below Bottom Speed, the volume is On the underside, just four screws are used which hold the PCB, OLED display and other case pieces in place. As mentioned in the parts list, it might look better if the case screws were black (but we didn’t have any on hand!). siliconchip.com.au 1 double-sided PCB coded 01104191, 92mm x 69mm 1 GPS module with TTL NMEA output (eg, VK2828U7G5LF or SKM53) [SILICON CHIP ONLNE SHOP Cat SC3362] 1 1.3in SH1106 or SSD1306-based OLED display module (MOD1) 3 tactile pushbuttons with 9mm-15mm shafts (S1-S3) 2 stereo 3.5mm jack sockets (CON2, CON3) [Altronics P0094] 1 6-way right-angle male header (CON4, for programming IC1 in-circuit; optional) 1 mini-USB socket (CON6; optional) 1 6-way right-angle male header (CON7) 1 set of laser-cut acrylic case panels [SILICON CHIP ONLNE SHOP Cat SC4987] 9 M3 x 10mm machine screws (preferably black; one for REG1, eight for case assembly) 1 M3 nut (for REG1) 4 M3 x 9mm tapped Nylon spacers 4 M3 Nylon nuts 1 length of twin core cable to suit installation (optional, for 12V supply) 1 fused vehicle accessory plug (1A fuse; optional, for 12V supply) [Jaycar PP2001, Altronics P0658] 1 10k LDR (optional; see text) Semiconductors 1 PIC16F1455 microcontroller, programmed with 0110419A.HEX (IC1) 1 MCP4251-502 dual 5k digital potentiometer (IC2) 1 LMC6482 dual rail-to-rail op-amp (IC3) [Jaycar ZL3482] 1 7805 5V 1A linear regulator (REG1) 1 1N5819 schottky diode (D1) Capacitors 1 220µF 10V electrolytic 1 100µF 16V electrolytic 1 10µF 16V electrolytic 4 1µF multi-layer ceramic 3 100nF MKT (code 100n, 0.1 or 104) Resistors (all 1/4W metal film 1%) 2 100k (brown black yellow brown or brown black black orange brown) 4 22k (red red orange brown or red red black red brown) 8 10k (brown black orange brown or brown black black red brown) 2 5.1k (green brown red brown or green brown black brown brown) 3 1k (brown black red brown or brown black black brown brown) 2 100 (brown black brown brown or brown black black black brown) 1 10k multi-turn vertical trimpot set to Bottom Volume. In between Top Speed and Bottom Speed, the volume is interpolated linearly. This is shown in graphical format by Fig.4. The Top Speed and Bottom Speed are always referred to in terms of the currently set units. If you plan on driving at more than 255km/h for extended periods, we suggest that you switch the units to knots! The speed display will read up to 999km/h, which should be sufficient for most users. . . Setting it up Before proceeding with the setup, you will need to wire Australia’s electronics magazine June 2019  75 TIME ZONE REGION Australian Western Time Western Australia Australian Central Western Time Eucla Australian Central Time South Australia/NT Australian Eastern Time Tas/Vic/NSW/Qld Lord Howe Time Lord Howe Island New Zealand Time New Zealand Chatham Island Time Chatham Islands OFFSET +8:00 +8:45 +9:30 +10:00 +10:30 +12:00 +12:45 change in ambient noise from zero to 30km/h. We also recommend leaving the Bottom Volume value around 128. This means that the GPS Volume Control does not make any volume adjustments at low speeds. You can then adjust the volume of your source or amplifier so that the overall volume through the speakers is satisfactory when stopped. Now you can adjust the Top Volume, and we recommend having a second person in the car to adjust this while moving, so the driver is not distracted. You could start with a value of say 192, giving a roughly 50% increase perceived volume at the Top Speed. As you are driving, once you have reached or exceeded your Top Speed setting, wait a little time for the unit to ramp up to its maximum volume setting. It takes the unit around 11 seconds to go from zero to 255, so it should not take much more than five seconds to reach maximum volume. On the main screen, you can check the bar graph to confirm that the volume has settled where expected. Take note of whether the audio while moving at this speed level is too loud, too quiet or just right. If it was too loud or too quiet, you can pull over later and make an adjustment (or get your passenger to do it for you). Repeat until you are satisfied, then save the settings to flash. Note that you may need to adjust the Bottom Volume value below 128 to give more range if you find you have set the Top Volume value to 255 and you would prefer it SC to be higher. DST OFFSET No DST No DST +10:30 +11:00 +11:00 +13:00 +13:45 Time zone offsets for the Australia and New Zealand area. the GPS Volume Control into your vehicle audio system, as described above. You can then power up the unit and press the leftmost button (S1, “SEL”) to go to the settings page. By default, all volume settings are 128, so the audio volume will not change. All volume values are between 0 (off) and 255 (approximately double the incoming volume). Continue to press SEL until you get to the Units setting, then use the DOWN or UP buttons to select your desired speed unit: kph, mph or kts. Use a similar procedure to set your time zone; see Table 1 above for the appropriate time zone offsets for Australia and New Zealand areas. All setting take effect immediately and you can scroll down to “Save to FLASH” and press the UP button to store these settings, so they are loaded the next time the GPS Volume Control starts up. We suggest setting the Top Speed value to between 80km/h and 110km/h, and the Bottom Speed to around 30km/h. In a typical passenger vehicle, there isn’t much The SILICON CHIP Inductance - Reactance - Capacitance - Frequency READY RECKONER For ANYONE in ELECTRONICS: HUGE 420x594m on h m eavy pho to paper You’ll find this wall chart as handy as your multimeter – and just as ESSENTIAL! Whether you’re a raw beginner or a PhD rocket scientist . . . if you’re building, repairing, checking or designing electronics circuits, this is what you’ve been waiting for! Why try to remember formulas when this chart will give you the answers you seek in seconds . . . easily! Read the feature in Jan16 SILICON CHIP (you can view it online) to see just how much simpler it will make your life! All you do is follow the lines for the known values . . . and read the unknown value off the intersecting axis. It really is that easy – and quick (much quicker than reaching for your calculator! Printed on heavy (200gsm) photo paper Mailed flat (rolled in tube) or folded Limited quantity available Mailed Folded: Mailed Rolled: ORDER NOW AT $10.00 $20.00 inc P&P & GST 76 www.siliconchip.com.au/shop Silicon Chip inc P&P & GST Australia’s electronics magazine siliconchip.com.au