1 Introduction
2 ------------
3
4 The ben-pololu-imu distribution provides some programs that run on the Ben
5 NanoNote and control the Pololu MinIMU-9 board which provides a 3-axis
6 gyroscope, a 3-axis accelerometer, and a 3-axis magnetometer. To connect the
7 module to the Ben, the 8:10 port which is typically employed to access microSD
8 cards is instead used to hold a suitable breakout board that exposes the 8:10
9 port's connectors to other circuits. These connectors are in turn connected to
10 specific connectors on the MinIMU-9 as follows:
11
12 Sniffer UBB MinIMU-9
13 ------- ---- --------
14 DAT2 DAT2
15 CD DAT3 SCL
16 CMD CMD SDA
17 VCC VDD VIN
18 CLK CLK (3V)
19 GND GND GND
20 DAT0 DAT0 (1V8)
21 DAT1 DAT1
22
23 The 3V and 1V8 pins play no role in the communication, but a six pin header
24 exposing these pins on the IMU can be used to connect the IMU with the
25 Sniffer/UBB without any complications.
26
27 Building the Software
28 ---------------------
29
30 Before building the software, it will probably be necessary to edit the
31 Makefile to specify the locations of the cross-compilation toolchain and of
32 libubb. Obtaining a toolchain and libubb is currently beyond the scope of this
33 document.
34
35 The programs are built as follows:
36
37 make
38
39 Connecting the Hardware
40 -----------------------
41
42 Given that the Ben normally expects to find something resembling a microSD
43 card connected via the 8:10 port, it is best to leave the Sniffer/UBB with the
44 MinIMU-9 board disconnected until the following command has been issued:
45
46 echo jz4740-mmc.0 > /sys/bus/platform/drivers/jz4740-mmc/unbind
47
48 This tells the MMC driver to free the 8:10 port for other applications.
49
50 Running the Software
51 --------------------
52
53 On the Ben, the programs can be deployed together with libubb in a particular
54 directory and invoked as described below.
55
56 As an alternative to deploying libubb and the programs together, the library
57 search path can be configured properly and the programs installed in such a
58 way that merely typing the name of the program is enough to run them.
59
60 The calibrate program just prints out readings from a particular component on
61 the MinIMU-9 board. For the gyroscope, accelerometer and magnetometer, it can
62 be run with the respective commands as follows:
63
64 LD_LIBRARY_PATH=. ./calibrate -g
65 LD_LIBRARY_PATH=. ./calibrate -a
66 LD_LIBRARY_PATH=. ./calibrate -m
67
68 The itest program is a graphical program which should be run when the Ben is
69 showing a console (and not any graphical environment); it is run as follows:
70
71 LD_LIBRARY_PATH=. ./itest
72
73 (It supports an argument -f which enables the high-pass filter on the
74 accelerometer, but this is generally useless.)
75
76 The imu program can be run as a textual or graphical program as follows:
77
78 LD_LIBRARY_PATH=. ./imu
79
80 The imu program accepts the following options:
81
82 -g Run in graphical mode. This should be done when the Ben is showing a
83 console and when other graphical programs are not using the
84 framebuffer. If omitted, the program will run in text mode.
85
86 -c Calibrate before attempting to interpret readings from the gyroscope
87 and accelerometer. This is highly recommended because uncalibrated
88 measurements will produce an inaccurate impression of the device's
89 rotation and motion.
90
91 Hardware: Pololu MinIMU-9
92 -------------------------
93
94 This board provides the L3G4200D 3-axis gyroscope and LSM303DLM 3-axis
95 accelerometer/magnetometer components from STMicroelectronics and is described
96 at the following location:
97
98 http://www.pololu.com/catalog/product/1265
99
100 Note that a different version of the board used the LSM303DLH component and is
101 described here:
102
103 http://www.pololu.com/catalog/product/1264
104
105 There are subtle differences between the LSM303DLM and LSM303DLH components,
106 and it is important to know which one is being used. Both of these boards have
107 now been superseded by the following MinIMU-9 v2 board which uses other
108 components:
109
110 http://www.pololu.com/catalog/product/1268
111
112 No support for the MinIMU-9 v2 board or the LSM303DLH variant of the MinIMU-9
113 is present in the software, currently, but other projects do provide support
114 for these other boards and can be studied to see what the differences are
115 between the different components involved.
116
117 Hardware: 8:10 Port Breakout Board
118 ----------------------------------
119
120 To connect the Ben NanoNote to the IMU board, a suitable breakout board is
121 required to expose the connections inside the 8:10 slot. To achieve this, the
122 Sparkfun microSD Sniffer has been used:
123
124 https://www.sparkfun.com/products/9419
125
126 This board is apparently intended for eavesdropping on communications between
127 a "host" device with a microSD slot and a microSD-based device that can be
128 inserted into a slot mounted on the board (instead of being inserted directly
129 into the host device). However, the board-mounted slot can be ignored and the
130 exposed connections routed to the display board instead.
131
132 Another board that achieves the same purpose is the Universal Breakout Board
133 (UBB):
134
135 http://en.qi-hardware.com/wiki/UBB
136
137 The UBB is somewhat more difficult to work with as its connectors are very
138 small and, compared to the microSD Sniffer, awkward to attach things to. The
139 microSD Sniffer employs connectors situated around holes with 0.1 inch
140 spacing, meaning that commonly available connection headers can be soldered
141 onto the board.
142
143 Although the labelling of the connections is different between the microSD
144 Sniffer and UBB (see above), the layout appears to be identical.
145
146 Contact, Copyright and Licence Information
147 ------------------------------------------
148
149 The author can be contacted at the following e-mail address:
150
151 paul@boddie.org.uk
152
153 Copyright and licence information can be found in the docs directory - see
154 docs/COPYING.txt and docs/gpl-3.0.txt for more information.