Thingiverse
Rotary encoder / Wheel encoder
di manticus
4
Download
7
Likes
0
Makes
Wheel speed
==========
Why ?
-----
Convert a binary information in a speed and with direction knowledged
### Requirement
1 GPIO (Raspberry pi)
2 endstop sensors
1 spring
3 nails
6 screws (2 by endstop and 2 for spring)
### Print parts
**Wheel**
Diameter : 50mm
4 holes so 4 states 0 and 4 states 1 for a complet revolution
** Main part **
To fix spring, wheel and sensors
** Holder **
To fix main part and spring
### What we want to get on the raspberry GPIO
number of change of state 0 -> 1 -> 0 -> 1 ... by rotation : 8
### Config
You can change settings:
- pin numbers used by 2 endstop sensors (23 & 24 by default)
- wheel diameter (5cm by default)
- number of holes in wheel (4 by default)
### Code part
Create a file "nb_turn_second.py"
Add permissions (chmod +x nb_turn_second.py"
Insert this script inside and run it with "./nb_turn_second.py"
```
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
print "starting..."
pin_id = 23
==========
Why ?
-----
Convert a binary information in a speed and with direction knowledged
### Requirement
1 GPIO (Raspberry pi)
2 endstop sensors
1 spring
3 nails
6 screws (2 by endstop and 2 for spring)
### Print parts
**Wheel**
Diameter : 50mm
4 holes so 4 states 0 and 4 states 1 for a complet revolution
** Main part **
To fix spring, wheel and sensors
** Holder **
To fix main part and spring
### What we want to get on the raspberry GPIO
number of change of state 0 -> 1 -> 0 -> 1 ... by rotation : 8
### Config
You can change settings:
- pin numbers used by 2 endstop sensors (23 & 24 by default)
- wheel diameter (5cm by default)
- number of holes in wheel (4 by default)
### Code part
Create a file "nb_turn_second.py"
Add permissions (chmod +x nb_turn_second.py"
Insert this script inside and run it with "./nb_turn_second.py"
```
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
print "starting..."
pin_id = 23
Hai stampato questo modello? Accedi e condividi il tuo make!
Accedi per lasciare un commento
AccediAncora nessun commento – sii il primo!