Yo! This project is still a Work In Progress. Instructions, board layouts and BOM might change!
NModule ADXL accelerometer sensor shield
License:
CERN Open Hardware License
Created:
8 years ago
Updated:
8 years ago
Views:
4127
0 Collect
0 Comments
Share
17 Download (690.8 kB)
Make a donation to Nca78

This shield uses low power axelerometers and RTC to allow making (for example) the following sensors :

  • detect vibrations, movements, orientation of objects
  • detect end of cycle or usage for washing machines or other home appliances
  • switch function with tap or double tap (with ADXL345)
  • free fall detection (with ADXL345)
  • anything your imagination can produce related to accelerometers, please suggest any use case you have

ADXL345 is extremely cheap (around 1$/board on AliExpress) and still relatively low power (20uA in the lowest power mode). It has nice features like free fall and tap + double tap detections.

ADXL362 is more expensive at around 3$ on AliExpress, but ultra low power (can run with less than 1uA in motion activated wake up mode, and 2uA at 100Hz).

Both have 2 programmable interrupt pins so the atmega can sleep until "interesting" events are happening.

SCRIPTS ARE IN TEST PHASE NOW SO NOT YET PUBLISHED, PLEASE WAIT A FEW DAYS :)

Preparing the NModule

Necessary pins to keep on NModule:

Pins 6,7,8,9 and 10,11,12,13 are necessary if you want to use ADXL362. If you are planning to use only ADXL345 and want to use the CR2032 holder I advise you to keep some or all those pins to have better mechanical resistance for the sensor.

You should cut the RAW pin from the NModule connector if you are using ADXL345 else it will be on the way when you will want to put the sensor close to the shield PCB.

Battery types to use

If you are using ADXL362 which is ultra low power, you can use a CR2032 battery, either with SMD holder on this module or with through-hole holder on the NModule.

If you are using ADXL345, it's using around 20uA in low power mode so you can't expect more than 6 months of battery life, I suggest to use 2*AAA to have a very long battery life.

Put tape to avoid shortcuts

To avoid any possibility of shortcuts while I put the shield as close to the NModule as possible to reduce thickness, I put some electric tape on the full surface of the NModule. enter image description here It's ugly but it's efficient :D

CR2032 battery and LEDs

Top Bottom

CR2032 battery

Soldered on the red color pads. It will not run without capacitors to backup the battery during high loads, and I only had space for SMD capacitors. So if you're allergic to SMD, use the through-hole battery holder & capacitor on the NModule board.

You should first solder the battery holder, it's a bit difficult because the holder is a big piece of metal and will absorb heat from your soldering iron. So I suggest the following process :

  • increase temperature of your soldering iron
  • put a blob of solder on the "legs" of the holder, as the holder is alone and not on the board you don't need to be afraid of excessive heat ...
  • put back your soldering iron to normal temperature
  • put solder on ONE pad of the board, be generous
  • move holder in place with plyers, at the same time melt the solder on the pad with your soldering iron so the holder legs are tight on the PCB pad and not floating in the solder. When holder is in place remove soldering iron to let solder solidify while keeping holder in place with your plyers
  • on the other side you will just need to put solder on the pad and melt it, while pressing on the holder with your plyers so that it's legs stay firmly on the pad. Keep pressing after removing the soldering iron until solder solidifies.

After holder is in place, solder the reserve capacitor(s)

You can put some SMD (1206) ceramic capacitors or an electrolytic through hole capacitor.

SMD capacitors are on the blue pads. You should have at least 100µF but the closer you are to 200uF the better it is. I suggest to use ceramic capacitors of 100µF each, if possible X7R, with the voltage bias with 2*100uF it gives me a real capacity of 130µF so there's not much margin. You can find up to 220uF in 1206 size so in that case one is enough.

Through hole capacitor in pink color. I've been happy with 10V / 220uF capacitors so I advise you to use the same. Using a low voltage rating means a reduced size and 220uF ensures a good reserve to help the battery during high load.

LEDs

You have 3 options here:

  • no leds
  • SMD leds
  • Through hole led

For the 1st and 2nd choices, you don't need the upper part of the PCB so you can save a bit of sensor space by cutting it with scissors along the red dashed line.

On most of the NModule shields, green led is A1 pin, red led is A2 pin. These are analog pins but they can also be used as digital pins, just set the pin mode as output and then use digitalWrite.

SMD LEDs

These are clearly labelled on the PCB with "green" and "red" texts. For both the led is on the top, and the resistor on the bottom. So red led is on red color pads, its resistor is on clear red pads. Green led is on green color pads, its resistor is on clear green pads.

Through hole LED

For this I am using a 3mm Green + Red led with common cathode. It will go in the holes circled in clear blue. Cathode is the longest leg in the middle, and you can't mix between green and red as I put some lines on the board next to green and led texts: short line for green color which has the shortest leg, longer line for red color. I had space for only one resistor (Yellow on the pictures) for both colors, so you will have to chose a value that will fit both colors, 330 or 220 Ohms are ok.

Sensors

Top Bottom

Real Time Clock

I have decided to use the DS1302 RTC on this board, for the following reasons :

  • it's available in through-hole version so easy to solder
  • it's ultra cheap
  • it's low power: I wired it so it believes it's on the backup battery all the time. In that mode it's using just a few uA
  • it can run down to 2V, perfect for CR2032 and still very good to use most of the capacity of 2 AAA
  • it only needs one external component, a 32KHz crystal which is also very cheap
  • it's not very precise, but my goal is not to keep track of time/date. It's to easily keep track of duration between events while the atmega is sleeping and for that it's precise enough.

It's of course not mandatory to put the RTC and its crystal on the PCB, it's needed only to keep track of duration between events. RTC is Yellow color on the pictures, it should be put on the top and be careful to put it in the righ orientation. Crystal is pink color, it has no polarity and you can put it either on top or at the bottom of the board. My suggestion is to put it at the bottom. If you are using the SMD capacitors it's better to solder them first. You should be able to bend the crystal's pins so that it can lays along the PCB without touching the capacitors. If it's too close/touching, use the good old electric tape :)

ADXL accelerometers

ADXL362 is in red color. ADXL345 is in blue color. For this one I have not put holes for the SPI pins as we are using it in I2C mode only. This is to avoid any mistake with ADXL362. Their pin layouts are different so if put in the wrong location it could kill the sensor.