3 axis Accelerometer board

rhaseman

New Member
I purchased a inexpensive 3-Axis low-g Accelerometer PCB of ebay that looks like it would be a good match to Picaxe. It is based on the MMA7260Q from Freescale but includes a 3.3 volt regulator so it can be run off a standard picaxe supply. The pcb format looks like it would interface rather easily - 3 adc connections and two or 3 digital connections to control it and the format should allow it to be plugged into a prototyping board.

While it would work well with a Picaxe running off 5 volts I can get better resolution if I used a Picaxe running at 3.3 volts to interface to it. I was thinking of using a picaxe 8 or 14m to interface to the accelerometer (running on 3.3 volts) but I would like to communicate to another Picaxe using a serial interface. Anyone with experience connecting two picaxes - one running on 3.3 volts and the other running on 5.0 volts over serial? I would appreciate any suggestions.
 

ylp88

Senior Member
Any problem in running both PICAXE chips from a 3.3V supply, even if you want a serial connection? I've got an 08M chip running on 2 x AA batteries (2.96V measured) with no problems communicating serially back to the computer (via SERTXD) using the PICAXE USB programming cable. I guess I suggest doing this since it simplifies the number of power rails you need.

ylp88
 

moxhamj

New Member
ylp88 is right but if you still do want to use two chips at different voltages, the problem is the definition of a High and a Low. There are all sorts of differences but in general a low might be 0-1V and a high 4-5V on a 5V supply. But for the 3.3V picaxe a high might be 2.7 to 3.3V which will not register as a high on the 5V picaxe. So for a 3V3 picaxe driving a 5V picaxe, one solution is a transistor such as a BC547 driven with any reasonable value resistor into the base (2k7 to 10k). Emitter to ground. Collector to the second picaxe and collector tied high (5V)with another resistor (2k7 to 10k). This inverts the signal but the general circuit can be used for any voltage translation lower to higher voltage supply. Serin and serout can be easily configered to invert the signal.

Comms the other way (higher voltage supply to lower voltage) can be done with 2 resistors as a voltage divider.
 

rhaseman

New Member
Picaxe Accelerometer interface

What I want to do is have a picaxe-8m dedicated to handling the accelerometer data and passing that information to a second picaxe-28a1 when requested. I have other sensors that require 5 volts connected to the 28a1 so I would prefer to keep the 28a1 at 5 volts. The accelerometer outputs are 0 to 3.3 volts so running the picaxe-08 at 3.3 volts would mean that I get the full voltage range of the adc's so I get higher resolution. I could use op amps to scale the accelerometer outputs to the 0 - 5 volt range but running the 8m at the lower voltage seemed a simpler solution.
 

rhaseman

New Member
Picaxe Accelerometer interface

Dr Acula - thank you for the suggestions. I think using a transistor for serial from the 08m and a voltage divider for control signals and serial to the 08m would work quite well - simple, inexpensive, and don't take a lot of space.

I had intended to interface the accelerometer to one of my picaxe 18x boards (running off 5 volts) just to test the accelerometer out and try out some code before trying to build the 2 picaxe circuit I had planned. My 18x prototyping board is already set up so it should be possible to do some checking rather quickly. If things work out I will let everyone know. The accelerometer board only cost about $16.00 US so it would be one of the cheapest solutions for a 3 axis accelerometer in a format that works with prototype boards that i have found.
 

BCJKiwi

Senior Member
I am a little mystified at the reason for such added complications.

Currently have in development/testing a 28x1 PICAXE with numerous sensors including a 3 axis accelerometer with onboard 3.3V regulator.

Using Readadc10 on the 28X1 I get all the resolution I need without this added complication. The DE-ACCM3D generates 0.333V per g which gives ~ 68 ReadADC10 values per g at a supply of 5V. It does +- 3g - a total of 1.99V. If I was going to scale it, I would move it's centre point to 2.5V and scale it by 1.5 to give 100 steps per g. This still only uses 3V in total but gives easy numbers to work with when analysing the output. I guess the need for scaling depends on the output the device you have delivers, and, what the output is used for. You do need some 'spare' at each end to allow for calibration when the unit is not installed exactly horizontal and to allow for where you are in the world. Also, with the unit just sitting on the bench, the ReadADC10 values fluctuate +-1 so additional resolution would not appear to achieve anything useful.

For my money, scaling via OpAmp would be far simpler than setting up another PICAXE and having it communicate with a second PICAXE.

As regards running a 28X1 at reduced voltage, this is OK at 4 or 8MHz but not at higher clock speeds which require 4.5V or more for stability - see;
http://www.picaxeforum.co.uk/showthread.php?t=8609
for details.
 
Last edited:
Top