Tuesday, October 16, 2012

V3–Reading Sensors, Transmitting Power Data


If you are good at reading between the lines you’ll understand that the title alludes to two separate tasks, but they have not been combined.

So the short is, the AP2 module, after a lot of fighting, is talking to the microcontroller. I was concerned when I couldn’t get the AP2 Module surface mount soldered (with only a soldering iron). It was very discouraging but I eventually solved it. This was already mentioned, and a dummy program was loaded up to transmit meaningless data on the basic power profile. See below.


So the next thing was soldering on all the MSOP and SOIC components which turned out to be very easy by comparison. I guess I’m getting good at soldering tiny components by hand. So I loaded up my dummy program that reads the raw sensor data from the ADS8321 16 Bit ADC. It works fine and at a gain of 250 (using 2.5 dollar 0805 resistors instead of 15 dollar through hole resistors) gives great sensitivity.

This is going to be a bit technical but bare with me; the ADS8321 is a differential ADC so it gives –32768 to +32765. My instrumentation amp, the AD623, is a single supply differential instrumentation amp, so a reference voltage is used to raise the voltage. So we could have +/- 4mv differential, for example, but once amplified it could be +/- 1v. Since we have a single supply this needs to be raised as we can only go from 0 to +vcc. Imagine we have a 2v supply voltage, we would want to lift the 0mv differential after amplification to 1v so that we have a full range for the +/- 4mv swing corresponding to +/- 1v after the amp. This gives a range of –1v corresponding to –32768 and +1v to 32765 all from the original input of +/-4mv.

I’m using a 3.3V regulator to provide the supply voltage, but I only really care about one direction of the force so what I was expecting was the voltage to always go in one direction. HOWEVER, a strain gauge has a tolerance so you might have an offset electrically. This is more of a problem because if you don’t use a reference voltage to raise the level sufficient and it’s hanging out at –1mv and you are only reading positive voltages, you have a dead sensor area and then a massive offset when it kicks in. So it still needs to be raised, but not necessarily by the whole range. In my case I’m raising it 1.024v with the LM4140 precision reference voltages.

If you are still there this all culminates in one of my bridges has the supply and ground swapped as it’s going in the reduced range direction when I apply a force that wouldn’t freewheel the bike.DSC_8990

The next steps are mounting the PCB more securely and switching to coin cells. I currently have concerns regarding coin cells as my drain might be too high in which case I would switch to my Li-ion cells I have already. Power Management will be a very important part of development from here on out. Power reduction hasn’t been at the top of the list and I still wish to change to the nRF51422 Soc when the evaluation kits become available.

Once I can get a handle on the current consumption I’ll post the results.


  1. Very interesting project.. Well done and thanks for sharing..
    Just one question.. What is the time resolution of acquired data.. Thanks

    1. Thanks.

      That's actually a slightly more complicated question. This primarily is the answer for V2. V3 is getting it's code rewritten. The two strain gauges setups are sampled at 16000 times a second approximately, so 32000 samples a second total. The ANT+ signal transmits data at a rate of approximately 4hz. This is a defined spec so I can't change it. However I'm working on a pedal stroke metric that will be calculated on the power meter and transmitted on a second channel. Rotor is working with the ANT+ Alliance on a similar metric for their prototype which will be open to others to use.

  2. Keith, hello from Russia! :) Carefully watch the development of your project. I wish you continued success and achieve the final result!