Problem statement

I need to obtain as fast as possible after power-up a reading from an accelerometer. The accelerometer is located in a car and is powered by the same rail of the rear braking lights, therefore it is powered only after I press the brake pedal. The idea is to obtain as fast as possible a clean reading of the initial gravity vector, before the car actually starts decelerating. Later I will subtract it to obtain the deceleration vector. If the first reading takes too much time (20 ms is already too late), I would be reading a combination of gravity + deceleration.

My intermediate solution

I used an Arduino Pro Mini (5V, 16 MHz) connected to a GY-61 accelerometer module. The module has a 3.3V low dropout regulator, an ADXL335, low-pass capacitors. The ADXL335 is ratiometric, therefore the Vcc of the ADXL335 is used as Aref for Arduino.

Arduino is set to wait 16k cycles + 0 ms upon power-up, the other options being 16K + 4 ms or 16K cycles + 65 ms. The setup is tested as working: I can obtain the first analog reading about <1.5 ms after application of input voltage.

The low-pass filter of the board was originally set to 50 Hz, but I changed the capacitor to have 200 Hz bandwidth, therefore the analog input (A0) takes about 5.5 ms to provide stable readings. This was also tested.


simulate this circuit – Schematic created using CircuitLab

The stable output voltage of the accelerometer can be (depending on mounting) between 1.43V and 1.77V for -1g to 1g. The ADXL335 does not tolerate more than about 3.5V on any pin (to be on the safe side).


I would like to stabilise the output of the accelerometer faster, without waiting the full 5.5 ms after power-up: this would allow me to sample more times the initial gravity value, before it changes due to deceleration. I would like to keep 200 Hz as bandwidth to reduce the noise later during the following measurements of braking deceleration.

The ADXL335 has a resonance frequency 5.5 kHz and a bandwidth of >550 Hz when no capacitors are used: before the low-pass capacitor the first reliable value is ready about 2 ms after power-up. That means more than 3 ms saved compared to my current case.

How can I do that?

Can I connect the output of the capacitor also to an additional pin, set as output for about 1 ms and then set as high-impedance input, through a resistor? or would I damage the ADXL335?

Is it maybe better to perform all the filtering in digital to change the bandwidth as needed? Even in this second case, would the setup I described work?


simulate this circuit

  • 3
    \$\begingroup\$ Have you considered going straight to a pure-digital accelerometer? \$\endgroup\$
    – pjc50
    Jan 20, 2017 at 16:32
  • \$\begingroup\$ I have some of these ADXL335 at home and not experience with digitial ones, so I used what I had. What would be the advantage of digital? setting a high bandwidth for the first readings and lower it for the following measurements? \$\endgroup\$
    – FarO
    Jan 20, 2017 at 16:35
  • 1
    \$\begingroup\$ What errors in terms of percentages are produced by a late null measurement? What I'm trying to say is "please justify that this needs to be done". It sounds like a none-problem potentially. \$\endgroup\$
    – Andy aka
    Jan 20, 2017 at 16:41
  • 2
    \$\begingroup\$ Is there no way to power the whole thing from a steady supply and only obtain a reading when the brakelights turn on? \$\endgroup\$
    – Christian
    Jan 25, 2017 at 7:59
  • \$\begingroup\$ @Christian it would require bringing there another cable, and that means lifting the interiors, and so on. Not easy. \$\endgroup\$
    – FarO
    Jan 25, 2017 at 9:47

1 Answer 1


IF some interim DC value was superior you could divide C1 into two caps from Vcc and ground. While voltage on a cap cannot change instantaneously, two across the supply will approach instantaneous as anything there can. Equal caps give Vcc/2 at A0. Voltage is set to ~~= the divider set by the inverse of the capacitances. eg 10 nF to Vcc and 20 nF to ground gives (1/20 / (1/10 + 1/20) x Vcc = Vcc/3.

If you want the cap to more accurately approach the 1st out output you could add a FET switch across the 32 k resistor. This is turned on a power on and turned off "after a while. Depending on the voltage swing at Vout you MAY be able to use a single FET but for a fill range of Vout you will probably need a polarity agnostic switch - so, two FETS in series (both N or both P Channel), sources joined, gates joined, drains to either side of the 32 K resistor. (You need a very high value resistor gates-sources only if the gates are to be floated.

Drive gates rail-rail with appropriate polarity for turn on/off for the FETs used. You MAY need a large value R from joined sources to ground to get switching going but quite possible not (based on my long ago playing).

Or use a reed relay of similar - operated at power up, turn off "soon".

A transmission gate may suffice depending on equivalent channel resistance and tolerable current.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.