Reading and Programing an Angel encoder

Hi there,

I am new to programing and was learning the Arduino’s IDE and then I came across XOD and thought it will be a lot easier to learn, and I think it is but I having a hard time.

Can anyone help. I am trying to convert a rotation of the angle encoder (picture and data sheet attached) shaft into degrees. basically I want to rotate the magnet and be able to know the by how many degree I manually rotated the magnet.

I will be out putting the readings to and OLE display.

I hope someone can get me out this hole that I can get myself out of it.

I again I am completely new at programing and I know this is elementary for most people but is being a change for me and is driving crazy. I already spend many hours or days going through tutorials in YouTube without any success.

Best regards,

Victor.


OSEPP 3141 THRU 3144.pdf (143.4 KB)

Based on PDF you included, it looks like sensor grounds the output pin when magnet is present. If magnet is not present, the pin floats and needs a pull-up resistor. This is great for things like confirming windows and doors are closed, but not going to help determine the angle of your shaft. The best it can do is help you count rotations (or determine when the shaft is at “home” position).

thank you so much for the response. will a Potentiometer work for what I am need?

Depends on what you are doing with it. Few potentiometers will allow full rotation. If you only need about 270 degrees of rotation, a potentiometer might very well work. If you only need a little more than 270 degrees, you might be able to use gearing between your shaft and the potentiometer, but that still won’t give you continuous rotation. The higher the gearing (giving you more rotation), the less accurate your angle detection will be.

Another alternative is to use encoders like light-sensors reading light/dark strips, but you need more advanced encoder to determine direction of rotation since light/dark strips will only let you know that something has moved. If rotation will only happen in one direction, your job becomes much simpler. Even with light/dark strips & a single direction, counting changes can be an issue in Arduino if it happens too quickly. There are a couple encoder libraries that might help, but I don’t know which hardware they are designed for and have never used any of them Libraries — XOD.

Hay muchas soluciones posibles para su problema.

Primero le voy a dar una opción más para su sensor.

El sensor que tiene y en la forma que lo está usando, puede ser útil como tacómetro o medidas de velocidad angular, que estén en revolución permanente, contadores, caudalimetros de todo tipo, etc.
Para empezar, opere a 1Hz a 70Hz para que sea efectivo Si supera los 70Hz,

XOD y Arduino no administran muy bien el tiempo para períodos más cortos de trabajo,
Con un poco más de experiencia esto tiene soluciones fáciles. pero todo a su tiempo y de aun paso por vez.

Su caso es muy típico, usted tienen muchas y buenas ideas y pocos conocimientos para implementar tan rápido como quiere y necesita. ¡Esto es bueno! No deje que la frustración le gane. Tenga paciencia, el conocimiento es un árbol que crece necesariamente lento cuando va a tener larga vida.

Como resolver mejor su problema.

Trabaje primero en el Qué, Como y Con Qué

  • Defina primero que es lo que necesita hacer.
  • Comparta esa necesidad
  • Piense y escuche activamente la mejor forma de Como hacerlo.
  • Elija su mejor estrategia Con qué hacerlo, pensando en los beneficios.
  • Haga sin temer a los errores y con una tolerancia muy alta a la frustración.
  • Sea amigo de sus Errores, ellos son los mejores maestros.

Si no lo hace por este camino es muy probable que usted tenga sí una solución a lo que esté planteando, pero eso no le garantiza que tendrá la mejor solución para su problema.

Para que la comunidad pueda ayudarlo en forma mas efectiva a su problema y pueda darle mas opciones y alternativas.
Un saludo
Guillermo

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.