Extension board · Sensors and inputs

3-axis accelerometer

A small board that measures acceleration along three axes, for tilt, taps and machine vibration. It connects to an I2C socket or a Qwiic cable. Reading it needs your own driver.

Top view of the accelerometer board: a ten-contact socket on the left and right edges, a small sensor in the middle and a Qwiic connector near the bottom.
Top view, drawn from the board’s design files. This is a drawing, not a photograph.
3 axesST LIS3DH
±2 to 16 gselectable range
0x18 / 0x19I2C address
2 interruptscontacts 3 and 6
I2C + Qwiic3.3 V only
40 × 40millimetres, four M3 holes

Tech specs

PurposeDetecting tilt, taps or knocks, or measuring machine vibration at low rates. Not a safety sensor
SensorST LIS3DH, ranges ±2, 4, 8 or 16 g, 1 to 12 mg per digit in high resolution
InterfaceI2C, address 0x18, or 0x19 with JP4 closed; two interrupt outputs
Supply3.3 V only on power and every signal, about 2 mA including pull-up current
Pull-ups3.3 kΩ on SDA and SCL, removable
ConnectorsTwo Gadgeteer type I sockets (Samtec SHF-105, 1.27 mm) and one Qwiic
Size40 × 40 mm, four M3 holes on a 30 mm square
Works withSmoothieboard V2 Prime header GG electrically; no firmware driver
LicenceOpen hardware, CERN-OHL-S-2.0

Every figure with its basis is in the electrical specifications appendix; hole positions are in the mounting dimensions appendix.

Board tour

The numbers on the drawing match the list below it. The board is shown from the component side.

  1. 1
    Input socket I IN (J1) — SDA on contact 8, SCL on 9, interrupts on 3 and 6.
  2. 2
    Chain socket CHAIN (J2) — Continues the bus.
  3. 3
    Qwiic connector (J3) — The same I2C bus on a four-way cable, 3.3 V.
  4. 4
    Accelerometer (U1) — Mount the board rigidly: the sensor measures what the board does.
  5. 5
    Bus pull-ups (R1, R2) — 3.3 kΩ resistors.
  6. 6
    Pull-up links (JP1, JP2) — Closed as delivered; open both if another board already provides pull-ups.
  7. 7
    Address link (JP4) — Close it to change the address from 0x18 to 0x19.
  8. 8
    Interrupt chain links (JP3, JP6) — Open as delivered.
  9. 9
    Bus chain links (JP8, JP9) — Closed as delivered.
  10. 10
    Supply capacitors (C1 to C3) — Decoupling for the sensor.
  11. 11
    Mounting hole — One of four M3 holes. Use all four.
Point at a number, or tap it, to read what the part is; the same text is in the list. On a small screen, scroll the drawing sideways.

Pinout

Everything on this board is 3.3 V. Check contact numbering with the power removed.

J1: input socket (I IN)

ContactSignalUsePrime header GG
13.3 VBoard supply3.3 V
25 VPassed to the chain only5 V
3INT1Interrupt 1PH2
4, 5, 7Passed throughNot usedPH4, PC0, PH3
6INT2Interrupt 2PF15
8SDAI2C dataPF0 (I2C2_SDA)
9SCLI2C clockPF1 (I2C2_SCL)
10GNDGroundGND

J3: Qwiic

PinSignal
1GND
23.3 V
3SDA
4SCL

What you need

An I2C portPrime header GG, or any 3.3 V Qwiic host.
A cableGadgeteer ten-way or Qwiic four-way.
Rigid mountingAll four screws.
Your own driverNone is supplied.

Get started

Minimum wiring: contact 1 to contact 1, 3.3 V; PF0, contact 8 to contact 8, SDA; PF1, contact 9 to contact 9, SCL; contact 10 to contact 10, ground. Prime header GG (J38) Accelerometer J1 contact 1contact 13.3 V PF0, contact 8contact 8SDA PF1, contact 9contact 9SCL contact 10contact 10ground
Four connections for I2C. The interrupt wires are optional.
  1. Mount the board

    Fix it rigidly to the part to be measured and note which way it faces.

  2. Connect with the power off

    Use J1 or the Qwiic connector, not both to different hosts.

  3. Find the device

    With your driver or a host I2C scan tool, read the WHO_AM_I register (0x0F).

    By the data sheet the device answers at 0x18 and the register reads 0x33.

Configuration

You wantModuleExample
Read accelerationNoneNo SmoothieV2 driver for this sensor

There is nothing to add to config.ini.

How it works

The sensor digitises acceleration and answers over I2C. Motionthree axes U1 LIS3DHmeasure I2CSDA, SCL Your driverread data
One digital path.

The LIS3DH contains the sensing element, converter and registers. Tying its chip-select pin high selects I2C. Its two interrupt outputs can signal events such as a tap or new data. The axis directions are drawn in the data sheet; confirm them by tilting the board.

Solder links

Keep only one set of pull-ups on a bus when you can: open JP1 and JP2 on additional boards.

Solder links as delivered: JP1 closed; JP2 closed; JP3 open; JP4 open; JP6 open; JP8 closed; JP9 closed. JP1 · closedSDA pull-up JP2 · closedSCL pull-up JP3 · openchain contact 3 JP4 · openaddress 0x19 JP6 · openchain contact 6 JP8 · closedchain SDA JP9 · closedchain SCL
The links as delivered. Close one with a small blob of solder across both pads; open it by removing the solder or cutting the copper between the pads.
LinkWhat it doesAs delivered
JP1Connects the SDA pull-upClosed
JP2Connects the SCL pull-upClosed
JP3Joins interrupt 1 to the chainOpen
JP4Selects address 0x19Open
JP6Joins interrupt 2 to the chainOpen
JP8Continues SDA to the chainClosed
JP9Continues SCL to the chainClosed

Chaining

Further I2C devices can follow on J2 or Qwiic, each with its own address.

The controller's ribbon cable goes to the connector I IN of the accelerometer board. Inside the board each of the ten pins runs through a solder link to the connector CHAIN, where a second ribbon cable continues to the next board. A closed link passes its pin on, an open link stops it. Controller one ten-pin port accelerometer board I IN CHAIN pin 3, interrupt stops here pin 8, SDA passed on pin 9, SCL passed on one solder link per pin Next board sees what is passed on
Chaining: one port of the controller serves two boards. Pin 1 of I IN leads to pin 1 of CHAIN, pin 2 to pin 2, and so on, each through its own solder link. The three lines stand for the ten pins and show the links as delivered. Two boards must never drive the same pin, and a pin that one board uses for a signal is not free for the next. The bus continues; the interrupt stops here.
ContactSignalOn CHAIN
1, 2, 10Power and groundPassed on
3, 6InterruptsStopped by open links
4, 5, 7FreePassed on
8, 9I2CPassed on through closed links

Troubleshooting

SymptomLikely causeWhat to check
No answer on the busWrong socket, swapped SDA and SCL, or no pull-upsTest points 3.3 V, SDA, SCL; JP1 and JP2
Answers at the other addressJP4 stateClosed gives 0x19
Bus unreliable with several boardsToo many pull-ups or long wiresLeave one set of pull-ups; shorten cables, lower the clock
Noisy readingsLoose mountingUse all four screws

The board has no indicator lights; use the test points.

Still stuck? Read how to ask for help or see the general troubleshooting guide.

Downloads

FileWhat it is
Schematic (PDF)The circuit diagram
Parts list (CSV)Every component with its value, footprint and part number where one is chosen
Board drawing (PNG)The top view used on this page
3D view, top (PNG)Rendered from the design files
3D view, angled (PNG)Rendered from the design files

Appendix: mounting dimensions

For drilling a mounting plate or designing an enclosure. Positions are hole centres, in millimetres, measured from the top-left corner with the board seen from the component side.

Mounting drawing of the accelerometer board, component side: outline 40 by 40 millimetres with 4 mounting holes. Hole positions are listed in the table below. COMPONENT SIDE · millimetres 40 40 0, 0 X Y 1 5.00, 5.00 2 35.00, 5.00 3 5.00, 35.00 4 35.00, 35.00 Numbered rings are mounting holes. Positions are hole centres, X then Y, from the marked corner.
Board outline 40 × 40 mm, corners rounded to a 1 mm radius, board thickness 1.6 mm. Drawn from the design files, component side up, in the same orientation as the board tour.
HoleX (mm)Y (mm)DiameterUse
15.005.003.2 mm, not platedMounting, M3 screw
235.005.003.2 mm, not platedMounting, M3 screw
35.0035.003.2 mm, not platedMounting, M3 screw
435.0035.003.2 mm, not platedMounting, M3 screw

Appendix: electrical specifications

Every figure is a design value, a calculated or simulated value, or a manufacturer’s data sheet value, as the last column says. A dash means no figure is given.

ParameterApplies toLowerNominalUpperBasis
Supply and signalsAll1.71 V3.3 V3.6 VST data sheet
Sensor current at 50 HzU1—11 µA—ST data sheet
Pull-up current, both lines low3.3 V—2.0 mA—Calculated
Rise time, one pull-up set, 100 pFSDA, SCL—280 ns300 nsSimulated; limit for 400 kHz
Low level, two pull-up setsSDA, SCL—0.12 V0.4 VSimulated

Component stress limits

PartLimitUse on this board
Any signal3.6 V maximumDo not connect 5 V logic
Capacitors10 V and 16 V3.3 V

Appendix: simulation

The I2C bus loading was simulated with ngspice with 100 pF of bus capacitance.

Each simulated value (yellow mark) against its allowed range (green band). Rise time 30 to 70 %, one pull-up set, 100 pF (40...280 ns Rise time with two pull-up sets140 ns Low level with two pull-up sets116 mV
Simulated value (yellow) against the limit used for it (green). Each bar has its own scale.
ResultSimulated valueLimitOutcome
Rise time 30 to 70 %, one pull-up set, 100 pF (400 kHz limit 300 ns)280 nsat most 300 nsWithin
Rise time with two pull-up sets140 nsat most 300 nsWithin
Low level with two pull-up sets116 mVat most 400 mVWithin

Not simulated: the sensor itself and the effect of mounting.

Appendix: datasheet

The first page of the sensor data sheet, a distributor copy of the ST document. Click the page to open the PDF.

First page of the LIS3DH three-axis accelerometer datasheet
LIS3DH three-axis accelerometer — STMicroelectronics, 42 pages.

See all boards on the extension boards page.

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.