Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Interfacing matrix keyboard with AVR

The keypad is the most widely used input device to provide input from the outside world to the microcontroller. The keypad makes an application more users interactive.  The concept of interfacing a keypad with the ATmega16 is similar to interfacing it with any other microcontroller. Many applications require a large number of keys connected to a computing system which includes a PC keyboard, Cell Phone keypad, and Calculators. If we attach a single key to MCU, we connect it directly to i/o line. But we cannot connect; say 10 or 100 keys directly MCUs because it will eat up precious i/o line and MCU to Keypad interface will contain lots of wires. The rows R0 to R3 are Input to the Microcontroller. They are made an input by setting the proper DDR Register in AVR. The columns C0 to C3 are also connected to MCUs i/o line. These are kept at High Impedance State (AKA input), in high z state (z= impedance) state these pins are neither HIGH nor LOW they are in TRI-STATE. And in their PORT value, we set them all… Continue reading

Sensing Temperature Using AVR


In this new tutorial, we will be interfacing an LM35 based temperature sensor with ATMEGA32. The three main types are thermometers, resistance temperature detectors, and thermocouples. All three of these sensors measure a physical property (i.e., the volume of a liquid, current through a wire), which changes as a function of temperature. In addition to the three main types of temperature sensors, there are numerous other temperature sensors available for use. However, the LM35 based sensors are precision-integrated temperature sensors, with an output voltage linearly proportional to the Centigrade temperature. The main advantage is these types of sensors don’t require any external calibration. They are internally calibrated and simply generate the output to the temperature they detect. The device is used with single power supplies, or with plus and minus supplies. As the LM35 draws only 60 μA from the supply, it has very low self-heating of less than 0.1°C in still air. The LM35 is rated to operate over a −55°C to +150°C temperature range, while the LM35C is rated for a −40°C to +110°C range (−10° with improved… Continue reading

Interfacing Ultrasonic Rangefinder with AVR

HC-SR04 sensor

In this tutorial, we are going to interface ultrasonic rangefinder with the all popular ATMEGA8. An ultrasonic rangefinder is used to find the range of an obstacle or a wall from the sensor. However, when there are cheap methods available to find a distance like the IR sensor or even a combination of LED’s and LDR would do, but the question is why we use a more expensive sensor. The reason is:- IR sensors are not accurate The result varies from object to object Calibration is required Works well only for short range Typically the IR sensors have a detection range from 30-80 cm or even less depending upon the manufacturer and also the LED’s used. However, for an ultrasonic rangefinder, the distance can be measured accurately up to 400cm with an accuracy of 1cm. Ultrasonic rangefinders find application to measure a level of a liquid, object sensing. Also, the great thing with this sensor is they required no calibration; no conversion from analog to digital data and the code are is not limited to any particular manufacturer sensor. The… Continue reading

Interfacing analog Joystick with AVR

In this tutorial, we are going to learn something interesting which is already sued by many people to play games. Yes, the analog joystick which is used to control the motion of a vehicle or a character. They are also used to control the movement of an RC car or maybe an RC helicopter. Usually, all the joysticks are two axis joysticks. The ‘y’ axis is used to move the object forward or backward while the ‘x’ axis is generally used to move the object left or right. These joysticks are available both in digital and analog outputs. The digital joystick gives pulse width modulated output but is more costly than the analog output joystick. In this tutorial, we will get the input from the joystick from both the ‘x’ and the ‘y’ axis, convert the analog data into a digital value and then display the data into LCD.  Before starting the tutorial, I will recommend you to read the LCD tutorial, if you haven’t, which can be found in the AVR tutorial section. Also, before displaying the data, there… Continue reading

Interfacing shift register with AVR

74HC595 shift register

The shift register is one of the vital things to learn while designing an embedded system. Using shift registers, one can increase the number of input and output pins available in any microcontroller. There are situations where you want to interface many peripherals together and keep the low system cost and reliable. This is where the shift register come into the picture. For example, in a joystick used to play games, instead of running all the pins from the console to the joystick buttons, a shift register reduces the number of pins almost by half.  This increases the reliability of the joystick and has helped in saving a lot of money in the long run. Another advantage of using shift register is that only three pins mainly control, latch and serial input/output can drive virtually any number of outputs or take inputs from a large number of the device. You might have seen different led cubes available in sizes of 4×4 or 6×6. The LED’s in those cubes are all driven by using shift registers. Continue reading

Controlling servo motor with AVR

Servo motor

Servo motors are a type of electromechanical actuators that do not rotate continuously like DC/AC motors. They used to position and hold some object. They are used where continuous rotation is not required, so they are not used to drive wheels. In contrast, they are used where something is needed to move to a particular position and then stopped and held there. The most common use is to position the rudder of aircraft and boats etc. Servos can be used effectively here because the rudders do not need to move full 360 degrees, nor they require continuous rotation like a wheel. Servos are DC motors with built-in gearing and feedback control loop circuitry. Most servo motors can rotate about 90 to 180 degrees. Some rotate through a full 360 degrees or more. Servos that can rotate 360 degrees are required mainly for building RC helicopters. Most commonly available servos have a three-wire connector. One wire supplies positive DC voltage – usually 5 to 6 volts. The second wire is for voltage ground, and the third wire is the signal wire. The receiver… Continue reading