loading

A professional manufacturer of measuring & testing equipment.

diy rotary encoder

Sorry for not having pictures, I didn\'t decide to do a tutorial on this until I was almost finished.
Overview: The rotary encoder uses two or more sensors to detect the position, direction of rotation, speed, and number of turns of the device.
This special use Hall sensors and magnets.
Waterproof by wrapping the sensor or in another way, this special type can be easily waterproof.
Some of the vehicles used some flavor Hall rotary encoders for the wheel speed sensor and the crankshaft position sensor for the engine, and also for some anemometers.
There are three main types of rotary encoder: 1.
Use a conductive track and brush 2.
Optical, using light and Sensor 3.
Magnetic, using some kind of magnetic sensor and magnetic material such as Hall sensor and magnet.
The actual rotating part can also be magnetized.
The linear encoder is made in a very similar way to the rotary encoder.
I tested the encoder I made with python code on Raspberry pi at speeds up to 1500 RPM.
The link to the code and schematic will be at the end.
The manufacturer specification on the drill I used to test said that the maximum speed is 1500 RPM, the speed I got from the encoder is 1487 RPM, both forward and backward are 1485 RPM.
This may be due to the fact that the battery is not fully charged, or it may be an inherent bad time for Raspberry pi.
Arduino will work better, but I don\'t like the 12 v on the analog pin, haha, oops.
Materials/tools: 1.
Spinning things (
Chuck I use electric drill)2.
Two or More Hall sensors (
Depending on the resolution you want)3. Four magnets (
Depending on the resolution you want)4. Glue 5. Wire (
I used some connectors for my bad servo system)6. Solder 7.
Soldering Iron 8.
Heat Shrink tube for your taste 9, electrical tape or other wire insulation material.
Marking devices, such as marking or scriberStep 1: Mark the equal points around the outside of the rotating part and glue the magnet to these points in the appropriate direction.
It helps to mark the polarity of the magnet.
In my case, every 90 degrees (
0 degrees, 90 degrees, 180 degrees, 270 degrees)
For the resolution of 4/rotation, this is enough for my app, but depending on the resolution you shot, it may vary.
A good way to find out the spacing is :(
360 degrees/number of magnets)
If you go by degrees, or (
Circumference/quantity of magnet)
If you were measured
In my case, the separation of the handle is well spaced for my application, so I don\'t have to measure anything.
Weld the wire to the sensor for insulation and heat shrinkage.
Be careful not to make the sensor too hot, be sure to test it and see if it still works after you\'re done.
The test is easy, just turn on the power and connect the LED to the data cable.
If the LED is opened next to the properly oriented magnet, it is closed when it is pulled (non-latching type)
, Or another pole that applies a magnet (latching type)
Then you can go.
The particular sensor I use is
Lock and connect to the ground (-)when activated.
Mark where the sensor should go.
For this special arrangement, this is at 1/16 times the circumference (0, 1/16th).
The reason for this is that one sensor has to trigger before the other, but to some extent the controller can distinguish between the timing difference between forward and backward.
I tried it initially at 1/8th mar k, but I don\'t know which direction it will go because the time difference is the same.
Before you position properly, it helps to fix the sensor tape down for the time being and then mark it.
You can do 1/8 division and you don\'t have direction sensing, but your resolution will double.
One thing that can be done is to use the second group of two sensors, offset 5/16 division spacing on the other side on the 7/16 th and 1/8 th other sensors can get the resolution of 16 pulses/loops, but I don\'t need such a good determination.
There is a timed demo in the video.
Stick the sensor at the Mark and paste it in place until the glue is cured.
Make sure there is a gap between the magnet and the sensor so that they are not hit and make sure that the sensor is aligned with the magnet in the right direction.
You do it when the glue is dry.
To get a schematic of the Raspberry pi and python code to measure the RPM, direction of rotation, and number of turns in the RPM, go here or here to get the PDF.
The reason I charge for the code is that it took about 4 days to get everything to work, while the rest of the project, including all the documentation, took only about 7 hours (
5 of them are documents)
Also, the $1 is not much, it helps to support larger, more complex projects, in fact, this is the only one I haven\'t charged for yet, and of course, it was released at that time.

GET IN TOUCH WITH Us
recommended articles
200 FAQs WHAT' S NEW APPLICATION
How to keep the hydraulic universal testing machine clean



Hydraulic universal testing machines have very high accuracy requirements.
Connection of hydraulic system of tensile testing machine



The hydraulic system is the power drive mechanism of the tensile testing machine.
Application of electronic universal testing machine in automobile industry



The specific application of the electronic universal testing machine in the automobile manufacturing process: The electronic universal testing machine needs to be used for automobile parts.
Wave soldering workflow



Wave soldering refers to the molten solder (lead-tin alloy), sprayed by electric pump or electromagnetic pump into the solder wave required by the design, can also be formed by injecting nitrogen into the solder pool, so that it is pre-loaded The printed board of the component realizes the soft soldering of the mechanical and electrical connection between the solder end or the pin of the component and the pad of the printed board through the solder wave.
Protection of frequency converter of hydraulic universal testing machine



The frequency converter is a power control equipment that uses frequency conversion technology and microelectronics technology to control AC motors by changing the frequency of the motor's working power supply.
Common failures of electronic universal testing machine



Electronic universal testing machine is a necessary equipment to control the quality of products.
Calibration method of electronic universal testing machine



The calibration operation of the electronic universal testing machine is still relatively unfamiliar to friends who use it for the first time.
Brief introduction of selective wave soldering defects and prevention



Selective wave soldering defects and their prevention.
Some precautions when using the testing machine



Testing machine, broadly speaking, is an instrument that verifies the quality or performance of a product or material according to the design requirements before it is put into use.
How to measure the tensile force of the testing machine



The tensile force is not an accurate value after being measured by the testing machine, and subsequent calculations are required to get the desired value.
no data

  Tel: 0086-0769-2318 4144

  Mobile: 0086-137 2828 8444

no data
CONTACT US

Copyright © 2025 Sinowon | All Rights Reserved.

Customer service
detect