Stereo tone controller with transistors

 Author:   Posted on:    No comments

The tone controller is a circuit inserted before an audio power amplifier. Its purpose is to allow the user to adjust the gain of specific frequencies of the audio spectrum. Tone controllers range from simple bass boost circuits to complex equalizers. The circuit presented here is a simple one, with a potentiometer which alters the lower third of the audio spectrum (for bass adjustment) and another one which alters the upper third of the audio spectrum (for treble adjustment).

The schematic does not contain a volume adjustment potentiometer, but that can be added before the controller input. The signal input level should not exceed 1 Vp-p. When both potentiometers are turned up to the middle (flat), the relative gain of the circuit is -1 to -2 dB. Therefore, with an input signal of 1 Vp-p, you get no less than 0.8 Vp-p at the output.

Stereo tone controller with transistors

Built prototype of the stereo tone controller

External interrupts on STM32 bluepill

 Author:   Posted on:    No comments

The bluepill is a cheap STM32F103 development board. It can be programmed even from Arduino IDE with an additional boards package. But to get the most out of it, you should develop software using the development kit from ST. This is because STM32 is much more complex than ATmega microcontrollers used by some Arduino boards. While the latter are use 8 bit CPUs, STM32F103 contains a 32 bit ARM Cortex CPU.

It's not my first attempt to program the STM32 bluepill using HAL library from ST. This post contains information about the tools you need to install in order to program the board. I'm going to make a new project in System Workbench and I will use the same clock configuration routine from the mentioned post (the SystemClock_Config() function). Then I will write code that toggles an LED when you push a button using interrupts.

STM32 bluepill on the breadboard

STM32 bluepill on the breadboard

Air pressure, temperature and altitude with BMP280 sensor

 Author:   Posted on:    No comments

BMP280 is a digital air pressure sensor especially designed for mobile applications. It is a very small device, having a footprint of 2 by 2.5 millimeters. Interfacing with a development board would be difficult if breakout boards wouldn't exist. Even so, there's another issue: sensor's nominal voltage is 1.8 V. Fortunately, it can handle 3.3 volts. BMP280 can measure atmospheric pressure and temperature. Since there is a correlation between pressure and altitude, the latter can be estimated.

I ended up wiring this sensor to a 5 V development board because of the display. Pressure, temperature and altitude required 3 rows, so I used my ST7920 graphic LCD. Although this controller works at 3.3V, the way my display is hardwired by manufacturer does not because you cannot increase contrast enough. I connected the display in SPI mode, so only 4 wires are used (3 for SPI and 1 is reset). The BMP280 supports either SPI or I2C interface. Because the only level shifter I have is one I built a while ago for I2C, this is the protocol I wrote the code for.

The BMP280 sensor on the breadboard

The BMP280 sensor on the breadboard

Stereo audio amplifier with TDA2003

 Author:   Posted on:    No comments

TDA2003 is an integrated audio amplifier circuit capable of providing up to 10 W into 2 ohms load and 6 W into 4 ohms load when powered at 14.4 V. It is very easy to build a reliable circuit with it because it has short circuit protection. It will withstand a permanent short circuit on the output as long as supply voltage doesn't exceed 16 V. The maximum operating DC voltage is 18 V, however TDA2003 will not get damaged as long as supply voltage is less than 28 V. It comes with integrated thermal limiting circuit.

Having these features, the TDA2003 proves to be a good option for small power amplifiers. It was designed for car audio, that's why it is powered from single supply of about 12 V. Although nowadays it is considered obsolete, there are plenty of electronic parts suppliers which have TDA2003 in stock. At very low prices, by the way. Using the datasheet as source of inspiration, I designed my own PCB for two TDA2003 circuits, to make a stereo amplifier.

Stereo audio amplifier with TDA2003

The TDA2003 amplifier on homemade PCB without heatsink

Upload binary and debug STM32 bluepill on Eclipse

 Author:   Posted on:    No comments

The blue pill is a STM32 development board which can be programmed in multiple ways. You can use Arduino IDE, mBed OS or HAL library from ST. This post is about STM32 development using HAL. There is a plugin for Eclipse that adds features for working with this family of microcontrollers (MCU) and there is also System Workbench for STM32 (SW4STM32), a complete development environment based on Eclipse IDE.

In a previous post I talked about STM32 development on SW4STM32. At that time I was just beginning with this MCU and after I was compiling the project binary, I used ST-Link tools to upload it to the board. That worked, but it was uncomfortable to launch ST-link utility or call st-flash after each build. More important, I lost all debug options with this method. I didn't knew then that Eclipse/SW4STM32 can be configured to automatically upload (burn) binary to MCU and debug it. Configuration procedure is a one-time process per project.

Upload binary and debug STM32 bluepill on Eclipse