Author Archives: R-B

PIC microcontroller based audio spectrum analyzer

This project introduces a real-time audio spectrum analyzer based on a PIC18F4550 microcontroller. The spectrum frequency analysis is done with a 16-bit Fast Fourier Transformation (FFT) routine coded in C. It uses a 128×64 GLCD to display the FFT waveform of a live audio signal.

“In order to perform a FFT calculation on an audio signal it is necessary to prepare the audio so the PIC18F4550 can sample the signal. The PIC18F4550 provides several analogue to digital converters (ADCs) which can be used to measure a voltage from 0V to 5V with 10-bit accuracy (0-1023). A typical audio line-out signal is an analogue wave with a peak-to-peak intensity of 1V centred around 0V (i.e. it is an AC signal) as shown by the following oscilloscope trace (from pin W2 of the demo board): Read more

Regulated power supply for embedded systems

Power is an important aspect of all embedded systems. Nothing works without electric power. Depending upon the type of applications, several options for power are available. For example, if the system doesn’t need to be portable, it can be powered directly from the wall source using AC adaptors. AC adaptors are cheap and easily available at any electronics store. They are used to power a bunch of electronics gadgets at home, like radios, answering machines, wireless routers, etc. They also come with mobile phones as chargers. They convert the high voltage AC in the wall socket to low voltage DC suitable to run the appliances. They usually provide the output voltage somewhere in the range of +3.3V to +12V DC, and supply current up to few amperes.

An embedded system consists of many different components that can operate from a wide range of power supply. But some components, such as Analog-to-Digital Converters (ADCs), require a constant voltage supply to provide an accurate output because they need a reference voltage for converting the analog signal to digital count. A device, known as voltage regulator, is used for this purpose. It’s job is to convert a range of input DC voltages to a constant output voltage. Besides, a voltage regulator also minimizes the power supply noise and provide a sort of protection for the embedded system from any possible damages due to fluctuating input voltages. The bottom line is that including a voltage regulator in your design is always good.

Types of voltage regulators
1. Linear regulators: Linear regulators use at least one active component (like transistor) and require a higher input voltage than the output. They are small, cheap, easy to implement, provide clean output voltage with low noise, and therefore are very popular. However, they generates a lot of waste heat (note that the difference of input and output voltage is dropped across the regulator) that must be dissipated with bulky heatsinks. So, in terms of efficiency they are not a good choice, specially for battery-powered embedded system. Furthermore, they can only step a voltage down and cannot boost the input voltage.

2. Switching Regulators: Unlike linear regulators, switching regulators can step up (boost), step down (buck), or invert the input voltage. A switching regulator works by transferring energy in discrete packets from the input voltage source to the output. This is accomplished with the help of an electrical switch (usually MOSFET) and a controller which regulates the rate at which energy is transferred to the output. They use an inductor or a capacitor as an energy-storing element in order to transfer energy from the input to the output. Since the energy is delivered as required they waste less power, and are very efficient than linear regulators. However, their drawback are they require more components (that makes them expensive), take up more space, and are complex circuits to design. That’s why they are not popular among hobbyists. Besides, the high switching frequency in the circuit generates far more noise than linear regulators.

LM78xx Voltage Regulators
There are hundreds of voltage regulators available. The most commonly used are LM78xx series linear regulators manufactured by several companies like Fairchild, Semelab, and ST Microelectronics. They typically come in a TO-220 package, and have a metallic attachment point for a heatsink. The part number designates the output voltage. For example, LM7805 provides a 5 V regulated output, while LM7809 provides a regulated 9 V output. They can provide an output current up to 1 Amp, and have overload and short-circuit protection features.

The figure below shows how to use a LM7805 to get a regulated +5 V power supply. Decoupling capacitors (nominally between 1 uF and 47 uF) are used to filter input and output voltages, and they also help in removing any momentary glitches in the power source. The input DC voltage for LM7805 is obtained by rectifying the low-voltage AC output from a step-down transformer using a diode-bridge rectifier.

Also read: Regulated power supply for breadboard

Looking for expanding RAM for your Atmega128?

An Atmega128 microcontroller has got 4K of built in static RAM, which is pretty enough for small and medium range projects that do not involve huge amount of data processing. But if you think you need more than that for your application, you can expand it by adding an external RAM chip. This article shows how you can expand the RAM capacity of Atmega128 up to 64K.

Read more

Arduino based breath analyzer

This is a simple breath analyzer based on a gas sensor (MQ-3 from Sparkfun) that is highly sensitive to alcohol. The author demonstrates how to interface the gas sensor to Arduino to sense the content of alcohol in your breath.

This project does not display the numeric value of the alcohol concentration on any LCD, but it has a series of 11 LEDs (green through red) that gives the strength of the alcohol content.

Read more

Power usage monitor using Atmel AVR

This project uses Atmega168 microcontroller to compute the power usage at home and logs it to an SD card. It has a graphical LCD display too that shows the power usage as a strip chart. Besides, the voltage and current waveforms can also be displayed on the LCD.

The current is measured using a pair of current transformers whereas the voltage is measured using a 2000:1 voltage divider network. An LMC6484AIN quad op-amp and an AD623AN instrumentation amplifier are also used for signal amplification from the current sensor and the voltage divider. Read more

« Older Entries Recent Entries »