Stereo audio amplifier with TDA2003

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.

The TDA2003 amplifier on homemade PCB without heatsink

Upload binary and debug STM32 bluepill on Eclipse

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.

Autoranging capacitance meter with LCD display

A capacitance meter is an useful test gear. And since my multimeter is too crappy to get a constant reading, I decided to make my own meter, especially for large capacitances. With an Arduino development board, a display and some resistors, the capacitance meter was almost built. It needed proper software to charge and discharge the capacitor, then measure time constant and compute capacitance. A capacitor's value can be determined by placing it either into an L-C oscillator and measuring frequency, either in R-C circuit and measuring time constant. While the first method requires some additional parts and it is difficult in terms of software, it is able to measure small capacitances and also inductors (by using a known value capacitor and calculating the inductor).

This project uses the second method, with RC circuit. If a voltage is applied to a series resistor - capacitor circuit, the latter tends to reach supply voltage at its pins (it charges). The charging needs a time dependant on series resistor and capacitor value. It should be noted that the capacitor draws current as it modifies the voltage across its pins. The following circuit performs both charging and discharging of capacitors. However, measurements are performed only during charging. The discharge function allows Arduino to make multiple measurements of the same capacitor without taking it out of this circuit.

Capacitance meter wired on the breadboard

Alarm clock with DS1302 RTC

DS1302 is a timekeeping chip with battery backup and general purpose RAM. It has been replaced by newer variants like DS1307 or DS3231 which have improved accuracy. The newer ones have I2C interface, but DS1302 does not. It communicates with the host using a serial protocol that resembles SPI. Since I had a module with this chip, I decided to build and test an alarm clock. I added an Arduino, the alphanumeric LCD, an active buzzer and some buttons.

There are some great advantages when using an RTC (real time clock) module in your project. You don't have to do timekeeping in your code (if you read my previous post, you can see it's not quite easy) and, very important, time keeping is performed from backup battery when your development board is not powered. This means you don't have to set date everytime you plug in the Arduino. The advantage is obvious for projects that depend on accurate time to operate correctly.

Drive the multiplexed 4 digit 7-segment display

Seven segment displays are widely used in clocks, meters and other devices that need to display numerical information. The elements of the display, which are usually made from LEDs, are lit in different combinations to represent Arabic numerals. They have a limited ability to display some characters because there are only 7 elements that compose the shape of the displayed figure. Seven segment displays are very easy to find and are the cheapest display type.

In the previous post I talked about the electrical connections of such displays and how they should be interfaced to a microcontroller (MCU). A 7-segment display requires current limiting resistors on each segment and transistor drivers for each digit. This time I will identify the pins of an unmarked display device, I will wire it on the breadboard to an Arduino Nano compatible board and I’ll attempt to write the software to drive it.

Proper wiring of a 4 digit 7-segment display

Seven segment displays are widely used in clocks, meters and other devices that need to display numerical information. The elements of the display, which are usually made from LEDs, are lit in different combinations to represent Arabic numerals. They have a limited ability to display some characters because there are only 7 elements that compose the shape of the displayed figure.

Seven segment displays are very easy to find and are the cheapest display type. Nowadays, modules with such displays do exist, where a display of 4, 8 and even more digits are driven by an integrated circuit. This driver gets the digits to be displayed from a microcontroller (MCU) via a serial bus. This saves a lot of pins and makes programming easy since all modern MCUs have support for the common serial protocols. Examples of such ICs are MAX7219, TM1637 and TM1638. The latter two come with support for keypad, therefore you can build front panels with buttons and display using such ICs.