0
\$\begingroup\$

We have a cadence/pace sensor for a bike, and we want to retrieve the "sin" by plugging it to a GPIO Pin of a Raspberry PI. The signal "sin" has a voltage that varies between 0 and 5V. We used a 2/3 dividing bridge to lower the max voltage to 3.3. Everything works, but when plugging the "sin" onto the GPIO Pin the max voltage value drops to around 0.5 - 0.9V. We've tried a lot of different things and the voltage always drops...

This stops us from measuring a high tick since the voltage for a GPIO Pin's logical high is 1.8V.

Edit : The problem with our sensor is that it's a Chinese rip off. Therefore we have little to none information about it. Our assumptions were the following concerning how the sensor works :

Possibilities of pace meter

The "sin" input in the RPI corresponds to the sinus output of our pace. Basically what we understood is that our pace meter has 18 slots all around its wheel, and every time the wheel rotates it outputs a "high" value voltage whenever it goes through one of these slots. To measure the RPM we measure the tick difference it takes for 18 rising edges to happen thus giving us the time it took for a whole rotation. With the pace output unplugged, a high value output hovers at 4.30V but when plugged to the RPI it falls to 0.5 - 0.9V

Concerning the 2/3 dividing bridge, we tried using very high resistance values (330 - 700k ohms) as well as low values (330 ohms) and it changed nothing. The current values were always at around 2 - 0.5mA which is below RPI limit.

\$\endgroup\$
6
  • \$\begingroup\$ What is a "sin" input? Is the Raspberry Pi pin set as an input? Are internal pull resistors turned off? Is your resistive divider having sane resistance values and can the sensor outputing it drive the resistances? For example having 3.3/1.7 ohms or 33/17 megaohms won't work. \$\endgroup\$
    – Justme
    Commented Oct 15, 2021 at 9:38
  • \$\begingroup\$ I would say the problem is most likely with your voltage divider. Probably too high of a resistance. Try cutting every resistor by a factor of 10 - it will preserve the ratio and thus the voltage levels, but will make it more stable. Probably. The least you can do is to include your resistor values in the question at least \$\endgroup\$
    – Ilya
    Commented Oct 15, 2021 at 10:39
  • \$\begingroup\$ @Ilya, that doesn't sound right - you must increase the resistances in the divider to reduce their load on the sensor output. \$\endgroup\$ Commented Oct 15, 2021 at 12:07
  • 2
    \$\begingroup\$ Insufficient information. Show us the details of your "2/3 dividing bridge". There's different ways this could go wrong. \$\endgroup\$
    – brhans
    Commented Oct 15, 2021 at 12:34
  • 1
    \$\begingroup\$ also what is the sensor? \$\endgroup\$ Commented Oct 15, 2021 at 12:48

3 Answers 3

1
\$\begingroup\$

The real question is: what's the output impedance of your sensor?

If you load it too much (example, 10 ohm+22 ohm for a total of 33 ohms) the required current would be excessive and it will give an extremely low voltage (it could even damage it). What values are you using for reducing the level?

Another thing: a standard GPIO has a CMOS input stage which is not really suitable for analog input signals: it's designed to only accept voltages around ground and VDD.

If possible configure the port as comparator or at least as a schmitt trigger (no idea on the port capabilities of the rasp). The best course of action of course would be an external comparator if you can.

\$\endgroup\$
0
\$\begingroup\$

Because the GPIO of the microcontroller is set as input have an high impedence so we can assume that is not sinking current (theoretically) so the problem is on your voltage divider.

A voltage divider is not a good choice, what you want is a level shifter from 5V to 3.3.V.

very fast pulses of the sensor could appear at the output of your voltage divider as a low voltage, maybe is better that you draw a schematic with components value.

\$\endgroup\$
0
\$\begingroup\$

Our solution that solved it is the following :Solution

It inverts the signal and our "high" voltage value goes from 0.8V for the "sin" of the pace meter to 2.36V read by the RPI, therefore solving our issue.

\$\endgroup\$

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.