adxl330 and orangutan

I have the adxl330 3-axis accelerometer from Sparkfun. I did the voltage regulation to 3v. I can see -3 <-> 3 volt data with my meter.

When plugged into the orangutan, all x,y,z data reports values of 0.

Do I need to change the 3v data from accelerometer to 5v before passing into orangutan?


The Orangutan’s digital I/Os are 5V lines (the AVR microcontroller on the Orangutan is only guaranteed to treat signals above 3 V as high, according to the datasheet), so you should convert your accelerometer’s digital outputs to 5 V before passing them on to the Orangutan. You should also make sure that your accelerometer’s inputs can tolerate the 5 V it will get from your Orangutan.

- Ben

I don’t have one of those beasties, but looking at the Sparkfun site, it looks like they’re 0-?V analog devices. The ADCs on the Orangutan should be able to read them, but at a reduced resolution, right? (0-5V at 10bit = 0-1024, 0-3.3V at 10bit = 0-676) Or did I get the output of the device wrong?


P.S. OHO!!! No, I read that wrong… The ADXL330 puts out -3 to +3V? Yeah, the AVR’s ADCs only read 0-5V, so it’s chucking half your signal. (What does putting a negative voltage on one of the ADCs do? I’ve never tried it.)

Sorry to double-post. I’m missing something. Looking at the datasheet for the ADXL330, it looks like it should be putting out just above ground to just below Vss. So with a 3.3V supply, it should be putting out something around 0-3.3V with the zero point right around Vss/2, or 1.65V. It looks like having a regulated supply is probably a good idea since it’s ratiometric, meaning the zero point is Vss/2, and the full-swing range is 0-Vss, so if your supply voltage is moving around, so’s your zero point, etc.

(I’m digressing a LOT.)

But it looks like it outputs 0-3.3V for -3g to +3g of acceleration. The ADCs on the Orangutan should be able to read that without any problems, right? Something sounds funky…


Yeah, based on the specs on page 3 of the Data Sheet, this accelerometer should be outputting between 0 and VCC for each axis, with ~VCC/2 when an axis isn’t accelerating at all (horizontal, or free fall). Are you really seeing plus and minus 3 volts from one axis output as you tilt it?

You should be able to measure the whole range of this voltage with the Orangutan, just not with the full 10 bit resolution, since it won’t go up to five volts. Timing A to D conversions can be a little painful, as can switching between channels. I recommend you try to get one axis working first, then worry about multiplexing all three.

Can you describe in more detail the connections you’re making between the accelerometer and the Orangutan, and maybe post the code (and which Orangutan) you’re using?


P.S. It’s not a real solution to your problem, but when I can I always go with analog sensors that digitally sample themselves, that way I don’t have to. I’ve had good luck with this accelerometer from Sparkfun.

ascii art connections:

6v ----> vin orangutan
-------> vin VR

VR vout —> vin 3.6v adxl330

adxl330 analog out

At the 6v split, I also split ground (to orangutan and to voltage regulator). Also ground from voltage regulator to adxl330.

Using my meter:

I know vout from VR is 3.6v. When I check VIN on adxl330, it is also reporting 3.6v. The confirmation that I think is bad, is that when I test each of the XYZ, they are also reporting 3.4, 3.5, 3.6. And no movement. I indeed was expecting ~1.5 for non-moving. (I wrote my original post incorrect - I dont think I ever was seeing neg voltage on my meter).

So, maybe its nothing to do with orangutan and my accelerometer is dead. Maybe its something in my wiring that I just can’t see.

It sounds like there’s something fishy with your accelerometer, but you can rule out your Orangutan as a problem source fairly easily. Just connect a known voltage (between 0 and 5 V) to the Orangutan ADC pin you’re using and display the voltage you’re detecting as a result of the AVR’s analog-to-digital conversion.

- Ben