Introduction

This project explores designing a speedometer to measure and display the speed of a bicycle wheel using a magnetic sensor. The system should be able to interpret measurement in meters per second. To achieve this system, a sensor device is attached to the bicycle. The Dialog GreenPAK design then performs logical operations to update the output periodically, or simultaneously, to interpret measurement results using four binary digits. This application is designed to be precise up to 1 m/s. 

The input of the system is a digital signal from a magnetic switch. The magnetic switch is used because, though both magnetic and optical sensors are known to be used in tachometers, magnetic switches are favorable for applications that have ambient light. This is critical for a solution that can be easily-affixed to a bicycle. In this application, every full rotation of the wheel represents 2 meters traveled (roughly the circumference of the wheel). 

This project describes two designs, both of which have their pros and cons. The first design utilizes the frequency detector of the SLG46536 to determine the rotational speed of the bike. The second uses the typical RPM method of incrementing the number of pulses (full rotations) over a given period. 

The key advantages to using GreenPAK are that it is smaller, lower cost, simpler, and easier to develop than most other solutions. Furthermore, the GreenPAK design for the bike speedometer can be modified into complicated projects, such as the internal speedometer for an electric bike or a moped. A microcontroller could be used instead, but the size and power consumption of the microcontroller can make it less appealing to a customer. 

The system can be tested by inspecting the digital output signal. For this application, we use between four and six LEDs for visual representation of the data. Each LED represents a single bit of a binary sequence. The application has been tested by comparing the digital output of GreenPAK to various radial speeds of a wheel. To show this solution is appealing for the biking industry we can evaluate dimension, development capability, and other parameters of comparison.

Below we described steps needed to understand how the bike speedometer has been programmed. However, if you just want to get the result of programming, download GreenPAK software to view the already completed GreenPAK Design File. Plug the GreenPAK Development Kit to your computer and hit the program to design the solution.

First Design: Frequency Detector

In terms of components, the SLG46536 is one of the more complex GreenPAK ICs with a large number of counter/delay/frequency detector blocks. The frequency detector of the counter blocks acts like a frequency filter and can be configured by set counter data. From the counter data, a signal is generated that determines if the incoming pulses occur more or less frequently than the given period. For this IC, there are 8-bit and 16-bit frequency detectors. The 16-bit frequency detectors generate more precise measurements. This application uses both types. 

If the input frequency of the block is higher than the configured frequency, the frequency block will output a digital high. Two 16-bit CNT blocks, utilized as a frequency detector, are shown in Figure 1.

The application’s wheel circumference is 2.06 m. When the wheel of the bike rotates at least once in 2.060 s, the horizontal speed of the bike is more than 1 m/s. Because of that, the counter data is set to 803 with clock source OSC0 CLK/64. Using these calculations, the period of the block is 2.05824 s, as this is the closest configurable value to 2.060 s.

Similarly, to configure the second frequency detector to detect speeds of more than 2 m/s, the wheel of the bike should rotate at least once in 1.030 s. The counter data is therefore set to 401 with clock source OSC0 CLK/64, to make the period of the block 1.02912 s. This methodology will be implemented...

Read more »