Soldering Your Accelerometer – The ADXL202E

Wednesday, December 31st, 2008

I finally get my hands on Analog Devices’ accelerometer- the ADXL202E. It’s small,very small.
See what I mean!

However there’s this problem, I usually work on PDIP packages and SMDs do give me a scare,not because I’ve never soldered them,but because I do not have the necessary equipment for it. So I decide to do my thing , and also take a little inspiration from Sparkfun’s Breakout board.

My first step was to find a thinner tip for the soldering iron. It presently has a standard tip,too big to solder the accelerometer. I decide to go shopping for a thinner one and get the finest one available at my local shop.
This is what the tip looks like[It's standard, I need a thinner one]

This is the new tip.

Since I needed to get wires out from the ADXL202 , I used very thin ones.You can easy get these by removing the insulation off normal wires you use in breadboarding. Now comes the difficult part – soldering.

First you need to hold your chip in place.With a little tape,firmly place the accelerometer on the table your working on.

This will prevent the chip from moving around ,when you solder the wires

First, put a little solder on one of the accelerometer’s solder points.Then taking a wire ,heat the wire, add some solder and touch it to the sensor’s pads. Do the same for the other seven “pins” of the sensor This is how it looked when done.[I know it's gory and ugly,but it's the best I could do]

Here’s the top view.

Now to mount the sensor onto a PCB. I chose a simple general purpose PCB[ dot matrix], as it’s easy available.That’s a One Ruppee coin,Indian currency ,the board is next to.

I cut the PCB to half to get a smaller footprint,that will house the ADXL202 and the supporting components. This is the finished version of the board:

If you notice,there are pins at the bottom of the board.These are for the signal and supply lines.I put them ,so that the board can piggy back on a bigger PCB housing the microcontroller…I also put a berg connector on the top,so that I could debug the signals. Following scope traces show the PWM changing as the accelerometer is tilted.

Tilted to one side:

Sensor on level surface:

Tilted to the other side:



Accelerometers for your Robot[The ADXL202 and the MEMSIC 2125]

Wednesday, December 31st, 2008


You’ve seen robots run on two wheels ,walk on two legs and balance just like us humans.I bet you’ve wondered whats in them that makes them “not tip over.

The device that enables this is a tiny teeny IMEM [aMicro Electro-Mechanical System] which can measure anything between ±1g to ±20g [some of the high g accelerometers measure ±20g to ±250g ]

The sensors:
accelerometer_adxl202e_coin

What’s a “g”?
A “g” is a unit of acceleration having a value of 9.8
if you say 1g of acceleration .Its equivalent to:
1g = 1*9.8 = 9.8 m/s2
2g = 2*9.8 = 19.6m/s2

“g” in reality :

1g The acceleration exerted by the Earth’s gravity on an object or person (for example, a cell
phone on a desk experiences 1 g of acceleration).
0-2g The acceleration range experienced by a person when walking.
10-50g The acceleration experienced by an automobile in a typical crash.
100-2,000g The acceleration experienced by a laptop if it is dropped from a height of three feet onto a
concrete floor.
50,000g The acceleration experienced by a munition when shot from a cannon.

…….Memsic.com

Where are Accelerometers used:

  • Robotics
    —To measure Tilt and Acceleration
  • Vibration monitoring
    —Vibration monitoring of heavy machinery
  • Alarms and Motion Detectors
  • Cellphones
    —To invert the Phone screen so that the screen is always vertical
  • Model Airplanes
    —Detecting pitch and yaw
  • Vehicle headlight aligning
  • Disk Drives
  • Vehicle Security

The following describes the two most popularly used accelerometers.
Both these accelerometers work on the same principle ,but on different technologies.

The Analog Devices ADXL202
accelerometer_adxl202e
Manufacturer :: Analog Devices
Datasheet :: pdf

Principle
The ADXL202 has a movable mass inside it which responds to vibrations,tilt or jerks.
The sensor element is a differential capacitor whose output is proportional to acceleration. The beam is made up of many interdigitated fingers.
Each set of fingers can be visualized as shown below:
accelerometer_green202accelerometer_adxlblock
Images Courtesy : Microchip.com

The movement of the beam is controlled by the polysilicon springs holding the beam.
These springs and the beam’s mass obey the laws of physics .
The force (F) on a mass (m) subject to acceleration (a), according to Newton’s Second Law, is
F = m a
The deflection (x) of a restraining spring according to Hooke’s Law is proportional to the applied force:
F = k x
From the above two equations…
a(acceleration) is proportional to x(displacement)

This enables us to compute the acceleration.
Once acceleration is obtained. Tilt can be obtained by monitoring each of the axes

The MEMSIC 2125
accelerometer_memsic
Manufacturer :: Memsic
Datasheet :: pdf

Principle
Unlike the Analog Devices ADXL which uses a movable beam, the Memsic accelerometers measure acceleration by monitoring a hot gas inside a chamber. The chamber is lined by a numerous temperature sensors which monitor the movement of the gas.
The picture below illustrates this:
accelerometer_memsic1
Images courtesy of Parallax Inc. (www.parallax.com), from the Stamps in
Class Forum article”
How to – Accelerometer (1) Fundamentals and Tilt

The first figure illustrates the accelerometer when it is held level.Note the position of the hot gas. The adjacent figure shows the accelerometer when tilted.The gas now shifts,changing the values of the sensors appropriately.

Output of an Accelerometer
Accelerometers like the ADXL and Memsic output their measurements in terms of PWM [Pulse Width Modulation].
For example take the ADXL202jqc which measures -2g to 2g. According to the ADXL datasheet 0g would translate to a 50% duty cycle.
accelerometer__1g
A < than 0g readout with a lower than 50% duty cycle

accelerometer_0g
A 0g readout with 50% duty cycle

accelerometer_1g
A > than 0g readout with a greater than 50% duty cycle

Accelerometer AXIS
Both the above sensors measure 2 axis i.e the x and the y

accelerometer_xy

Selection of an axis depends on your project requirements. You can even use the sensors to measure a full 360 degree of tilt. by using two accelerometers oriented perpendicular to one another.When one sensor is reading a maximum change in output per degree, the other is at its minimum.
accelerometer_360d

Well thats it..these sensors do not need a lot of interfacing components. The ADXL202 just need 2 resistors and capacitors to set certain parameters while the Memsic needs even fewer components.

Parallel Port Tutorial – Part 2 (Handling Inputs)

Wednesday, December 31st, 2008

Disclaimer : The information provided here is correct to my best knowledge.You may use it at your own risk.
This is a followup of the first tutorial which described using the port as an output. This tutorial demonstrates how to use the parallel port as an input. This feature is a great help in robotics as it is used to collect data of what the robot really is encountering.

The INPUT PINS

Picture Courtesy :: Ian Harries

The 10,11,12,13,15 pins of the STATUS PORT are the basic input pins.

Though the CONTROL PORT pins can also be used as inputs,only accessing the status pins are described here.Follow these steps to read an input


Step1
Construct the following TEST circuit.
In this example I have taken pin 13 of the STATUS port as an input.
WARNING   Please do not feed your port more than 5V.You’ll blow it up.
Check all the voltages with a Multimeter before proceeding




Step2
Fire up your C compiler and typre the following program:


The program scans the STATUS[0x379] port and give an appropriate integer number,depending on what combinations of pins have gone high or low.
In this example ,since I have used pin 13 and connected to a high value i.e a binary “1″, I get a value of “127″ on my PC. Please note that this number will differ from PC to PC. Now we test for a Low value i.e a binary “0″. Modify the above circuit as shown below:

Short pin13 to GND.
When you do this and run the above program ,you get a different number.
On my PC ,i get a “230″

Step3
Now using a simple switch case statement you can monitor the input at pin13.

When pin13 is set HIGH:

When pin13is set LOW:

This is for monitoring a particular pin.
You can use all the status pins as inputs ,note down the numbers for different combinations and then write your program.Please note that the 11th pin is inverted i.e If u give a HIGH to it ,the port reads it as LOW.
That’s it for the parallel port inputs.

Me

Welcome to my place on the web. I note down anything interesting most of them relating to my experiences, Tech, To-dos, How-tos and various hacks. Most of my time is spent in tinkering around with hardware, building robots and working with DSPs.More

Want to subscribe?

 Subscribe in a reader Or, subscribe via Email

Add to Technorati Favorites
Find entries :