Low frequency Butterworth and optimal Wiener ECG filters

Regular ad hoc filters don’t guarantee optimal signal filtering as there is no any criteria that evaluates filter characteristics. Usually filter parameters are calculated empirically and filtering is done by best results. In order to avoid such shortage there are optimal filters used where parameters are optimized by some criteria. The main idea of optimal filtering is to give bigger weight coefficients to signal spectra parts where signal noise has less power and true signal spectral components has bigger power. Lets project simple Butterworth filter that will be used as comparative filter to optimal Wiener DSP filter. Butterworth filter transfer characteristics:   Where N – indicates filter Tap number. I will skip description of butterworth filter for now as main idea is constructing optimal wiener filter. Butterworth filter characteristics are pretty plain:   Butterworth characteristics with bandpass of 70Hz Main disadvantage of Butterworth filter is that signal is distorted on filter output. If you want minimal signal distortions it is better to use optimal Wiener filter. Filter chart looks as follows:   As you can see to make this filter functional wee need additional conditions like signal model reference. Filter coefficients are calculated using MMSE. root mean square error. Lets…

Continue reading

24×24 LED dot matrix display control

This is a pretty old circuit, but I found it interesting to describe here. 24×24 LED display is formed by using nine 8×8 Dot LED matrix displays, that are connected to AT90S2313 MCU. MCU scans an indicator line in series. Special PC program is written which allows drawing images on screen and transfer them via a COM port to the device. You can send pictures in series what gives an animation effect. Device circuit: The circuit is built using obsolete AT90S2313 MCU which can be replaced by Attiny2313 MCU with minor modifications of firmware. To make program work you event don’t need to connect the device to the computer COM port. You can store images in other master MCU EEPROM memory Each received byte from UART is immediately sent to 8 LEDs, the second byte to next 8 LEDs and so on. Bytes has to be addressed one by one without delay. USART is working at 115200 baud, 8bits, no parity. Demo movie (137kB); Source code Originals source svv.on.ufanet.ru

Continue reading

PCB Exposure using UV light LED box

I came across this interesting project. The guy decided to make UV PCB exposure box made of UV light LED’s. The main reason why he used LED was the power dissipation and compactness. Assuming that one UV tube would take about 6W while one UV LED would take about (20mAx3.2V=64mW). Most of that energy UV tubes dissipate as heat energy. So he took: 54 x UV LEDs of 400nm (6000 – 7000 mcd) – 100 units in Ebay costed 12€; 18 x 68ohms resistors 1/4W – 0,36 €; 1 connector – 0.50€; 1 electrolytic condenser of 2200uF – 30v; 1 Eurocard Plate 100×160 about 5 € ;  

Continue reading

Compact dual oscillator and power on reset for MCU

Would you consider connecting an IC with dual-speed oscillator and a power-on reset to you MCU. This is what MAX7378 does. This is a good replacement for ceramic resonators, crystals and other oscillator modules and discrete reset circuits as well. Good thing here is that at any time you can select either low frequency 32.768kHz or a high frequency from range 600kHz to 10MHz.Clock frequency can be switched at any time without glitches. MAX7378 can be powered from 2,7V to 5,5V, so it is suitable for most of MCU types. Comparing to Crystal resonators it is resistive to vibrations and EMI. It is good solution for automotive and industrial environment. High frequency oscillator error reaches of ±2% at 25°C at 5V power supply. In other words speaking oscillator frequency stability is about ±325ppm (when crystal stability is from ±10ppm to ±100ppm). So it doesn’t correspond to crystal accuracy, but it suits for most non time critical applications. 32.768kHz oscillator is more accurate with an error of 1%, but it still a bit much for time measurements. Reset circuitry takes care that reset will occur after 100us after clock startup. Reset output is available in three different options: two of them…

Continue reading

IR remote control signal receiver using AVR microcontroller

IR remote control is a device you can find everywhere where you can find TV, VCR or home theatre. Why not to use one of them for controlling your own devices like light, air conditioning etc. As we know remote control devices uses IR light. This is invisible light about 950nm wavelength. One most significant problem in using IR light is that there many other sources of it like the sun, light bulbs, fire. To exclude other sources, the IR signal is modulated by some frequency. The receiver has to be tuned for this frequency. Mostly remote controls transmit IR signal using 36kHz frequency signals. Transmitting and coding is one part which can be done more efficiently than receiving and decoding. Decoding is usually performed by using microcontrollers. Firs of all receiver has to get rid of 36kHz carrier frequency. This is not a simple task to demodulate the signal; this is why particular IR receiver IC’s are produced. One of them is TSOP1736: This receiver simply removes 36KHz carrier signal and gives clean pulses that are used for device control. I won’t go too deep in how it works – you can find this information in datasheets. This module…

Continue reading

Characteristics of sensors and transducers

Sensor ir transducer is a device which converts one type of energy to another – usually electric. They are used for various purposes including measurement or information transfer. Generally speaking sensor or transducer is a device that converts a signal from one to another. Lets go through transducer characteristics that describe a performance of sensors. One of characteristics, that describes the functional relationship between physical input and electrical output is Transfer Function Transfer function is a graph that shows relationship between the input and output signal. Depending details of this characteristic it may be a complete description of sensor characteristics. Transfer function may be used as a calibration curve. For instance lets take an example of infrared temperature sensor.   Its transfer function can be represented as 3D function of a thermal radiation. It is because sensor is affected by two temperatures: Tb – absolute temperature of object and Ts – Absolute temperature of transducer sensor surface. Then output Voltage: V=G(Tb4-Ts4), where G- constant. Then we can represent transfer function in 3D space:   Another characteristic is Dynamic Range of sensor. This term defines the input signal that can be converted to electrical. Signals outside the range may cause large…

Continue reading

Generate true random numbers on microcontroller

Sometimes there is really a problem of how to generate true random numbers using your microcontroller. Usually computer processor or any other MCU is capable to generate a Pseudo Random Number (PRN). These numbers are generated by algorithms so called Pseudo Random Number Generators (PRNG). Everything what pure algorithm produces is predictable in some sort of level. There are many PRNG algorithms that generate random numbers, but there is always a defined number of iterations when random number sequence will repeat itself. Sometimes it may be acceptable. One popular way to generate pseudo random numbers is using Timers. Moreuniversal algorithm is concept of Linear Feedback Shift Register (LFSR). LSFR is a n -bit register which is initiated with non zero seed value and is clocked by shifting values to the left and loading new bit in to bit0. New bit is calculated by XOR’ing the bits of selected taps of LSFR. This method is used in rand() functions. Usually we know simple solution of random number generation (AVR-GCC example): < p style=”margin-bottom: 0mm”> //Example how to generate PRN in range (0 to 9) < p style=”margin-bottom: 0mm”>uint8_t randNumber; // Get a random number (0 to 255) randNumber = (uint8_t) rand();…

Continue reading