The Freescale MMA7660FC is not a chip you want to be soldering by hand, it has 10 “pins” but is only 3mmx3mm is size, and in fact the pins aren’t even pins – is is what is called a lead-less chip. So you will want to find a pre-soldered carrier board for this tiny accelerometer device.
Searching for “MMA7660” on eBay, I currently find about 8 variations from different sellers around the works. The one we used in the prototypes, as shown in the header photo, was from a Chinese seller “womarts”, and was about US$7 including shipping. We also got some from another Chinese seller “wideenm991”, which look pretty similar but without the mounting holes.
Of course there is nothing stopping you from making your own PCB if you have some experience. Here is a photo of the PCB I made for one of our earlier prototypes, showing the accelerometer IC. It worked, but due to some last minute design changes, I ended up using the womarts board in our final prototype.
To connect the accelerometer is pretty simple, as mentioned in an earlier blog post. You basically just need 4 wires between the accelerometer PCB and the Linux controller.
On the accelerometer PCBs are 5 connections
- VCC – this is the +3.3V power supply connection
- GND – this is the power supply ground
- SDA – this is the I2C data signal
- SCL – this is the I2C clock signal
- INT – this is the I2C interrupt signal – we won’t use this for now
For the Raspberry Pi – see pin out info at http://elinux.org/RPi_Low-level_peripherals
- Connect VCC to the first pin on the front row (near label P1)
- Connect SDA to the second pin on the front row
- Connect SCL to the third pin on the front row
- Connect GND to the fifth pin on the front row
For the OLinuXino Maxi – see pin out info in the Olimex docs
- Connect VCC to UEXT pin 1 (top right)
- Connect SDA to UEXT pin 6 (bottom middle)
- Connect SCL to UEXT pin 5 (top middle)
- Connect GND to UEXT pin 2 (bottom right)
For the OLinuXino Micro – see pin out info in the Olimex docs
- Connect VCC to CON2 pin 3 (third from top left)
- Connect SDA to CON2 pin 8 (eighth from top left)
- Connect SCL to CON2 pin 7 (seventh from top left)
- Connect GND to CON2 pin 4 (fourth from top left)
For the two OLinuXino boards, you also need to check that the I2C jumpers are set for the “_HW” position. The first run of boards from Olimex defaulted to the “_SW” position for software I2C, which will not work here. See the post on hardware mods for more detail.
To test your accelerometer, we have a small test program called mma7660.c
To compile it, run
cc -o mma7660 mma7660.c –lncurses
On the Pi, if you get an error that curses.h doesn’t exists, then run “sudo apt-get install ncurses-dev”, and try compiling again.
To run it:
./mma7660
If it is working correctly, you should be multiple updates per second on the screen, with X, Y, and Z values changing as you move the accelerometer board around. Hit any key to quit.
The accelerometer is quite sensitive, so the numbers will constantly change, but as you move it into different positions you should be able to get each of X, Y, and Z to get close to values of +/- 20, which corresponds to +/- 1g. With sudden movements, the values will hit the sensor limits of +/-31.
If the values only seem to update every few seconds, then your I2C connections are bad. Check your wiring, and also check the I2C selection jumpers.
…
And for Smiffy, here is a close up photo of the “hand soldered” accelerometer on the prototype PCB.
Yes, I actually used normal solder and a normal (pencil style) soldering iron, plus some flux paste – and just carefully placed the part, quickly tacked it into position on one side, checked alighnment, then let the solder flow into the joints by surface tension. It isn’t easy, because it is so fine. The trick is to use the kapton tape to stop the solder flowing too far on the non-solder masked board, use only a very small amount of solder, and use some flux. The flux reduces the solder surface tension, and I later cleaned it off with isopropanol. The final problem is that it is very hard to inspect for good joints, even with a microscope, due to the side angle you really need to look at. So you just have to try it and see if it works.
Overall, a perfectly fine method for a few prototypes, even if the datasheet says it shouldn’t be done. But it is time consuming. A solder paste stencil, a proper solder masked board, and a reflow process is the only way to speed it up and get a decent production yield.