Unfortunately, over the years the popular RPM sensor we have used on our DC electric motors are not longer in production. This has led me to be forced to create a solution to this important issue. A more cost effective solution is on the way. It is important to know that a physical RPM sensor needs to make pulses on the motor shaft, those pulses are then transmitted to the motor controller interface, and then it is the interface of the motor controller that actually drives the vehicle tachometer.
The idea is based around this small ring that is attached to the end of the shaft, which will spin when the shaft does. This ring has 4 magnets embedded inside it. Something was needed to detect when each of the four magnets came around to a point. This device is called a hall effect sensor, and more common known as a hall effect transistor. This transistor connects the signal wire to ground when there is presence of a magnetic field. This change can then be measured by a microcontroller that is monitoring the signal pin.
According to the manual, the interface of the motor controller states that the RPM sensor must "pull the signal wire low four times per revolution with approximately a 50% duty cycle" (Manzanita Micro Zilla Motor Controller Package and Hairball 2 Interface Owner's Manual). What this means is that exactly 12V must be pulled low (0V) 50% of the time via a square wave signal.
This can be accomplished through the help of a microcontroller that can output PWM, or Pulse Width Modulation. PWM is simply a square wave that is high (in this case 12V) a part of the time and low (in this case 0V) another part of the time. So in this case, it is simply high, or on, half of the time, and low, or off, the other half of the time.
Looking at the diagram below, you can get an idea about how Pulse Width Modulation works and the relationship the duty cycle plays in that. Also note, in the diagram below 'T' is labeled as the Period, which is one complete cycle.
The final design of this RPM sensor is as follows. The hall effect will monitor the magnetic field to detect whether one of the four magnets comes around on the shaft to the sensor. Next, when the microcontroller that is monitoring this hall effect sensor receives a signal that there is a magnet, the microcontroller will produce a PWM signal with a duty cycle of 50% and use an n-channel MOSFET transistor to connect the other signal wire (from the interface of the motor controller) to ground in accordance to the set duty cycle. Transistors allow us to switch circuits on and off incredibly fast, and in this case it will have to send this PWM signal out each of the 4 times the magnets come around on the shaft within one revolution of the motor. The motor can reach speeds of 5000+ RPM, so this little sensor will have to work extremely fast and efficiently.
Once the interface of the motor controller starts receiving this signal from our custom RPM sensor, it will send out another signal wire that will drive the tachometer sitting on the dashboard of the vehicle. This will allow the driver to easily glance over to monitor the RPM of electric motor.