Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews

Notices


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
LinkBack Thread Tools Display Modes
Old 14th July 2004, 03:03 PM   (permalink (permalink))
Default Help with ADXL202 / PIC tilt sensor

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.
Attached Images
File Type: gif drawing1.gif (13.8 KB, 350 views)
Building_A_Robot_Fish is offline  
Reply With Quote
Old 14th July 2004, 05:43 PM   (permalink (permalink))
Default

Which PIC are you using?
Roff is online now  
Reply With Quote
Old 14th July 2004, 05:53 PM   (permalink (permalink))
Default

PIC16F877 running @ 4Mhz
Building_A_Robot_Fish is offline  
Reply With Quote
Old 14th July 2004, 06:13 PM   (permalink (permalink))
Default

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
bmcculla is offline  
Reply With Quote
Old 14th July 2004, 06:41 PM   (permalink (permalink))
Default

bmcculla, many thanks. Problem sorted.
Building_A_Robot_Fish is offline  
Reply With Quote
Old 14th July 2004, 06:45 PM   (permalink (permalink))
Default

Quote:
Originally Posted by Building_A_Robot_Fish
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.
Roff is online now  
Reply With Quote
Old 14th July 2004, 07:25 PM   (permalink (permalink))
Default

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
Building_A_Robot_Fish is offline  
Reply With Quote
Old 14th July 2004, 10:22 PM   (permalink (permalink))
Default

Tell me what supply voltage(s) you have, and I'll draw a schematic for you.
Roff is online now  
Reply With Quote
Old 14th July 2004, 10:59 PM   (permalink (permalink))
Default

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.
Building_A_Robot_Fish is offline  
Reply With Quote
Old 14th July 2004, 11:30 PM   (permalink (permalink))
Default

Failed to mention, single 5v supply
Building_A_Robot_Fish is offline  
Reply With Quote
Old 15th July 2004, 12:06 AM   (permalink (permalink))
Default

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.
Attached Images
File Type: gif accelerometer.gif (13.6 KB, 293 views)
Roff is online now  
Reply With Quote
Old 15th July 2004, 07:05 AM   (permalink (permalink))
Default

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
Building_A_Robot_Fish is offline  
Reply With Quote
Old 15th July 2004, 01:47 PM   (permalink (permalink))
Default

That sounds OK. I picked Maxim because they are (still?) generous with samples.
Roff is online now  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 12:18 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.