Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help with ADXL202 / PIC tilt sensor

Status
Not open for further replies.
Hi,

I'm a total beginner at this electrickery and robotics stuff so please be gentle.

I'm attempting to construct a tilt sensor using an Analog Devices ADXL202 accelerometer and a PIC. I'm utilising the analogue outputs from the XL as I've insufficient timer/counter pins on the PIC.

I've attached a circuit diag for reference.

On the PIC side I've coded up the A/D conversion and have a bank of 10 LEDs to show the 10-bit binary value of the conversion.

The math & doco says that on straight and level the voltage drop between the X axis npn emmiter and the A/D pin should be 2.5v (approx). This should equate to a value from the conversion of around 500.

My problem is this.... When the circuit is up and running and I measure the voltage between the emitter and ground it reads circa 2.5v and the LEDs show roughly the right value and are very stable. However, when I remove the meter the value the LEDs show changes and starts moving about all over the place. If I ground my meter and then touch the emmitter the values reads good and the LEDs show the value they should.

Remembering I know very little about this subject, any ideas what's wrong with my circuit? How is the meter alterring the behaviour of the circuit? I'm guessing at this stage that it's my circuit rather than my code as I'm a coder by trade.

Any help appreciated, thanks.
 

Attachments

  • drawing1.gif
    drawing1.gif
    13.8 KB · Views: 689
It sounds like you need a larege resistor (try 1MOhm) to ground at your PIC inputs. An IC's input will often have a leakage current that comes out of or into the pin. If you don't have a resistor to reference the input back to ground the input will float around. The meter is probably working like that resistor.

Brent
 
Building_A_Robot_Fish said:
bmcculla, many thanks. Problem sorted.
I think you need to eliminate the emitter followers entirely. They add about 0.6 volts of offset, and that will change at about -2mv/degC. The emitter follower output will be a nonlinear function of the output of your accelerometer, and will not even work when the outputs are near zero.
Use op amp voltage followers as your buffers. You can probably get away without any buffers at low sampling (conversion) rates, and just connect the accelerometer directly to the A/D.
 
I played with an op amp follower for a while but found it much more confusing than the trani solution, but that was before I found this forum. I read about the .6v effect but figured that as I must have a follower (the XL doco says it has a 35K output impedance which apparently is too high for the A/D mod direct) I'd go with something I could actually get to work (with help).

Now I've got it working with the emmitter follower I may well have another look at the op amp.

Thanks
 
That's a very generous offer, cheers. The op amp I've picked up is an 8-pin CA3160. I've seen a schematic in the doco for a single supply follower (which is my scenario) but it has a trimmer or something similar for 'offset adjust' and I couldn't make head-nor-tail of what it was trying to do.

Thanks again.
 
CA3160 may not work because the input common-mode range only goes to 2.8v with a 5v supply. This is a worst-case spec, so, depending on the luck of the draw, you may get a CA3160 whose input common-mode range goes high enough, in combination with an ADXL202 whose output range is low enough to fit into the CA3160's range. I think I would just bite the bullet and get an op amp whose output and inputs can swing from rail to rail. The MAX4092 can do that, as can many others from various mfrs.
 

Attachments

  • accelerometer.gif
    accelerometer.gif
    13.6 KB · Views: 562
Can't find MAX4092 on any of my usual sites in the UK. I've found:

Type: TLV2461CP
Manuf: TEX
Package: DIP8
Vcc(V): 2.7 to 6
GBP(MHz): 6.4
Slew-Rate(V/ms): 1.6
V Offset(mV): 2.2
Ibias: 30nA
Rail to Rail: I/O

Would this fit the bill? If not, what am I specifically looking for in the spec?

Thanks for the diag

Cheers
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top