This is my Cargobikometer demo solution for the ADFC Berlin fLotte project, which is currently under development. The hub dynamo can be driven by hand or by a DC motor. The signal from the hub dynamo will be converted from a sine wave into a rectangle signal by a schmitt trigger. To avoid an always running hub dynamo during programming, I use a simple ESP32 based signal generator with touch sensors for switching the frequency. For fun I drive a little motor from the hub dynamo voltage with an AC-DC converter.
The program for counting the distance works very well, but now I have to transmit the distance value via LoRaWAN. The program for sending a fixed distance value via TTN http integration works also very well, but if I put both parts together, the pulseIn function returns always zero.
I already posted the code examples 2 days ago in the forum.
It would be nice, if somebody can help me to fix the problem. When the problem is fixed, I can move to the next step in my project, finding a suitable battery backed hardware device and a waterproof case, which should be placed on the bottom side of the cargobike.