High-Res AS5048 Magnetic Rotary Encoder DIY

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024

ความคิดเห็น • 70

  • @atomic14
    @atomic14  3 ปีที่แล้ว +2

    Interested in ESP32 Audio: th-cam.com/play/PL5vDt5AALlRfGVUv2x7riDMIOX34udtKD.html
    Looking for all my ESP32 projects: th-cam.com/play/PL5vDt5AALlRdN2KyL30l8j7kLCxhDUrNw.html

    • @lincolnyousef6973
      @lincolnyousef6973 3 ปีที่แล้ว

      Sorry to be offtopic but does anyone know of a method to log back into an Instagram account..?
      I stupidly lost my password. I love any help you can offer me

    • @andersonjude3342
      @andersonjude3342 3 ปีที่แล้ว

      @Lincoln Yousef instablaster =)

    • @lincolnyousef6973
      @lincolnyousef6973 3 ปีที่แล้ว

      @Anderson Jude i really appreciate your reply. I found the site on google and I'm trying it out atm.
      I see it takes quite some time so I will reply here later with my results.

    • @lincolnyousef6973
      @lincolnyousef6973 3 ปีที่แล้ว

      @Anderson Jude It did the trick and I now got access to my account again. Im so happy:D
      Thank you so much you saved my account :D

    • @andersonjude3342
      @andersonjude3342 3 ปีที่แล้ว

      @Lincoln Yousef happy to help =)

  • @telegraph_hill
    @telegraph_hill 3 ปีที่แล้ว +1

    This is what being a Maker is all about. Bravo!

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      Thanks! I'm glad you liked it.

  • @bratwizard
    @bratwizard 3 ปีที่แล้ว +2

    Very nicely done. I've experimented with using magnets for rotary encoders before, but in a different configuration. I really like your idea. Very slick!!!!

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      Thanks - I was really pleased how nicely I was able to reuse the bits from the mechanical rotary encoder.

  • @Hugatry
    @Hugatry 3 ปีที่แล้ว +1

    I found this video interesting, alright. I will order some magnetic angle sensors and play around with them. Seems very useful technology and will no doubt come handy some day.

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      I think there's a lot of interesting things you can do. Report back on anything you make!

  • @bratwizard
    @bratwizard 3 ปีที่แล้ว

    Another tip is to solder the end pins first and then you've got everything mechanically sound and can finish up the rest. This tip works well with or without the breadboard.

    • @atomic14
      @atomic14  3 ปีที่แล้ว +1

      That's a good tip. Also works very well with header pins in an awkward place. Solder one of the pins and then you can adjust it easily to get it square before soldering the rest.

  • @calebm5656
    @calebm5656 3 ปีที่แล้ว

    This is really neat. I've been wondering how to interact with a hermetically sealed device for a dive light project I've been working on, and I think this magnetic sensor configuration might be the answer. I applaud your ingenuity for repourposing the encoder shaft with a simple 3d printed addition👏🙌👌. A+

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      Sounds like a great project. You would probably need to do some experiments to see how far away the magnet can be and if there's any impact from having some material in between the magnet and the sensor.

  • @ChrisHalden007
    @ChrisHalden007 3 ปีที่แล้ว +1

    Great video. Thanks!

  • @550stanley
    @550stanley 2 ปีที่แล้ว

    Thank you for a great video. Was looking for an alternative way to decode an angle for a DIY joystick with a finer resolution than the standard potentiometer. This will be the ticket I think.

  • @cornevandijk9190
    @cornevandijk9190 3 ปีที่แล้ว

    Nice, great hack of the rotary encoder

    • @atomic14
      @atomic14  3 ปีที่แล้ว +1

      Thanks!

  • @ДенисЗайцев-э1ф
    @ДенисЗайцев-э1ф 2 ปีที่แล้ว

    DESoldering any part is very easy. You need to hold the board with pliers, and gently pull it with others, holding it all over a regular electric stove.

  • @vnagaravi
    @vnagaravi 3 ปีที่แล้ว +1

    2:00 don't use breadboard as stand some times heat will melt the breadboard
    It's from experience... 😁😁...😭

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      That sounds like a nasty experience - a good tip for anyone watching - don't melt your breadboard!

  • @sharpbends
    @sharpbends 3 ปีที่แล้ว

    Wireless control is quite easy to do between 2 ESP32's using Bluetooth serial - one as master the other as the client. I made a handheld game recently that used Bluetooth Serial to communicate between a pair of controllers, it works quite well.

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      That's really interesting - I'll have to give it a go. Do you have any pointers to sample code anywhere or is it obvious from the docs?

    • @sharpbends
      @sharpbends 3 ปีที่แล้ว

      @@atomic14 I just started with the example code github.com/espressif/arduino-esp32/blob/master/libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino and github.com/espressif/arduino-esp32/blob/master/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino then I got the master to connect to client device. They each sent shared game state messages to each other over the BT serial connection. The connection between two esp32 devices worked ok up to about 10 meters and the connection was stable for over 24hours in my testing.

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      @@sharpbends Very interesting - I'm working on an ESP32 walky-talky but will probably use ESP-NOW for the longer range.

    • @sharpbends
      @sharpbends 3 ปีที่แล้ว

      @@atomic14 I think ESP-NOW has quite limited message size but I will be interested to see what you can do with it.

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      @@sharpbends 250 bytes I think - but - if I can get it to build and run fast enough - I'm going to try using a codec from the days of GSM that compresses speech down really aggressively.

  • @AntonioMartinez-xt7gg
    @AntonioMartinez-xt7gg 3 ปีที่แล้ว +1

    Esta solucion me parece muy interesante. Felicidades.

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      Muchas gracias. Estoy feliz de que lo hayas disfrutado.

  • @BozoLazovic
    @BozoLazovic 5 หลายเดือนก่อน

    Nice! Could you please tell me where you got that little magnet. Is it from a device or did you buy it online somewhere

    • @atomic14
      @atomic14  5 หลายเดือนก่อน +1

      The search phrase you are looking for is "Diametrically Magnetised Magnets". Something like these: amzn.to/3PUhzBp and here's a breakout board to match: amzn.to/3PUhzBp

  • @jackevans2386
    @jackevans2386 3 ปีที่แล้ว

    It could also be built into an old potentiometer, without the need for any 3D print item. The pcb may need cutting down a bit on the corners to fit into the pot's can.

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      That's a really interesting idea - might have a look and see how easily they come apart.

  • @bratwizard
    @bratwizard 3 ปีที่แล้ว +1

    Another quick question- how expensive are those rotary IC chips? I presume they're an internal arrangement of hall-effect sensors?

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      They are relatively expensive compared - around £7 depending on how many you want to buy. There are some evaluation boards but they seem to be around £14-20. I was quite lucky that Rob Dobson (th-cam.com/channels/ScxC8mTWRU_ARb4nC3vIUw.html) had one spare from another project he was able to give me. You are correct they are hall-effect sensors - there are a few alternatives at different price points and quite a few from other manufacturers.

  • @cts8332
    @cts8332 3 ปีที่แล้ว

    Nice work fine tuning the code for the AS5048. I am curious how did you resolve the angular position data from the AS5048 to incremental movement in the Asteroids game control? More to the point, I am interested in converting angular position to quadrature motion because the AS5048 has finer resolution than many other encoders with quadrature output.

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      I'm just reading the angle from the AS5048 and using that to set the angle of the space ship. So its direction the ship is pointing is directly connected to the angle the AS5048 is sensing. I think what you want to do is use the AS5048 but output a quadrature output? Definitely doable, with a bit of coding. A simple approach would be to periodically check the angle reported by the AS5048 and compare it with the angle you got last time. You could then output the appropriate quadrature pulses to count up or down to the new angle. You would have a bit of latency but I don't think it would be noticeable.

  • @alessandrobaglivi4569
    @alessandrobaglivi4569 3 ปีที่แล้ว

    You can use HK28012DMG

  • @rodrigo_dm
    @rodrigo_dm 3 ปีที่แล้ว

    That is a really good idea. How good would this be as a angle sensor for wind? I would need a very loose and lubricated axis, but other than that, your project covers everything, I have to try that! thanks for the video

    • @atomic14
      @atomic14  3 ปีที่แล้ว +1

      I think it could work well, presumably for wind direction rather than for speed?
      There are also cheaper magnetic sensors as well - not as accurate (1 degrees), but I think for most applications sub degree accuracy is probably not really needed.

    • @rodrigo_dm
      @rodrigo_dm 3 ปีที่แล้ว

      @@atomic14 I didn't know COTS magnetic angles sensors, and yes, for wind measurement 1 degree accuracy is really good. Thanks again!

    • @atomic14
      @atomic14  3 ปีที่แล้ว +1

      Someone suggested the TLV493D as an alternative www.infineon.com/cms/en/product/sensor/magnetic-sensors/magnetic-position-sensors/3d-magnetics/tlv493d-a1b6/

  • @perfoperfo9910
    @perfoperfo9910 3 ปีที่แล้ว

    Hello Atomic14. Good video , thanks for the detail. A question a little off topic that I hope you wont mind. Was that a laser projected Asteroid game ? Did you make it ? where can i get details about that ? Thanks again.

    • @perfoperfo9910
      @perfoperfo9910 3 ปีที่แล้ว

      Ah, I've seen it now on hackaday. Nice project.

    • @atomic14
      @atomic14  3 ปีที่แล้ว

      @@perfoperfo9910 Thanks! Apologies for not replying to your original message - the code for the game is all on GitHub - details on the video here: th-cam.com/video/LXDwGygCokU/w-d-xo.html

    • @perfoperfo9910
      @perfoperfo9910 3 ปีที่แล้ว

      @@atomic14 hey no apologies Atomic14 there was about 20 minutes between my question and my own update. I don't think it would have been reasonable to have expected a reply in between :-) . Looking at the other video now.. I would really like to make on of these if I find a cheap enough galvos..what kind of KPPS are yours

    • @perfoperfo9910
      @perfoperfo9910 3 ปีที่แล้ว

      Though what about using a laser projector? They seem to be the same price or even cheaper than a Galvo kit and would have everything ou need already in a nice box. Some are even RGB for £60. As they aren't generally programamble. I guess it would require hacking to see if the signals to the galvos could be intercepted with those from the ESP. But doable I bet.

  • @sevdev9844
    @sevdev9844 2 ปีที่แล้ว

    I had trouble to understand this video. Are the contact brushes still being used for some reason? Or was this just about using the same knob and overall design, but with a magnet and magnetic sensor? I'm new to this, so only read how this normally works, I'll look into a video next.

    • @atomic14
      @atomic14  2 ปีที่แล้ว

      Just using the same knob and overall design and replacing everything with the magnet and sensor.

  • @andymouse
    @andymouse 3 ปีที่แล้ว +1

    I've made an encoder from a hard drive motor but never did anything with it, I'll wait until my programming skills improve ! neat video and yeah make it wireless...cheers.

    • @atomic14
      @atomic14  3 ปีที่แล้ว +1

      That's really interesting - I'd love to learn more about how you did that.

    • @andymouse
      @andymouse 3 ปีที่แล้ว

      @@atomic14 Hi, I got the idea from Greatscott, it just uses the motor and the disk mechanically then comparato'rs and Schmidt triggers to get a clean pulse from the three phases, and the rest handled by an Arduino. I had it control an LED ring, so as I turned the motor the LED tracked it..great fun..maybe you could have a go and see if it would be suitable for your Asteroids ?..great work and cheers !

  • @sto2779
    @sto2779 ปีที่แล้ว

    How does the chip knows the position?

    • @atomic14
      @atomic14  ปีที่แล้ว

      If a magnetic sensor - there's a magnet in attached to the shaft of the encoder and the magnetic sensor IC can measure very accurately the orientation of that magnet.

  • @fathead7
    @fathead7 3 ปีที่แล้ว

    Did you have the magnets laying around or did you buy them especially for this?

    • @atomic14
      @atomic14  3 ปีที่แล้ว +1

      They were given to me with the sensor board. You need a diametric magnet - so one that is magnetised across its diameter.

  • @ricardobinas5005
    @ricardobinas5005 3 ปีที่แล้ว

    Where do you get the magnet? what kind is it?

  • @absolute___zero
    @absolute___zero ปีที่แล้ว

    I don't know why youtube recommends me this, but once I stopped by, just fyi: the ENC35 encoder from US Digital has 60,000 pulses, so if you put a ballscrew with 4mm displacement you are going to have 66 nanometer precision. Only 200 bucks.

  • @Smashachu
    @Smashachu 2 ปีที่แล้ว

    alright having a 3d printer has become non negotiable for doing anything. I can't think of any other tool that would get more use.

    • @atomic14
      @atomic14  2 ปีที่แล้ว

      It's a frustrating and rewarding hobby. Not sure where the balance is though, can be extremely frustrating when it doesn't work... But it does open up a whole world of fun things.

  • @gathnobrain8024
    @gathnobrain8024 3 ปีที่แล้ว +1

    That's exactly what I was looking for ! Do you think that would work with Raspberry PI ?

    • @atomic14
      @atomic14  3 ปีที่แล้ว +1

      Yes, definitely. Though I might consider using the I2C version as I had to mess around a bit to get it working consistently using ESP-IDF instead of Arduino. I think the timings on the SPI interface might be off, but I'm not sure exactly why.

    • @gathnobrain8024
      @gathnobrain8024 3 ปีที่แล้ว

      @@atomic14 Yay ! Thanks ! As I am not very good at coding, do you have an idea of where I can found the code for AS5048B ? :)

    • @gathnobrain8024
      @gathnobrain8024 3 ปีที่แล้ว

      @@atomic14 Otherwise I was planning to use it with Arduino. I guess I can use the Arduino library for AS5048B from AMS code from github ?

    • @atomic14
      @atomic14  3 ปีที่แล้ว +1

      @@gathnobrain8024 The code I've put in my repo should work with Arduino no problem.

  • @AkashManish
    @AkashManish 3 ปีที่แล้ว

    Awesome video.
    I am working on the same encoder AS5048. wanted to ask you some doubts.

    • @atomic14
      @atomic14  3 ปีที่แล้ว +1

      You can contact me via the channel page - or feel free to open an issue on the GitHub repo.

    • @AkashManish
      @AkashManish 3 ปีที่แล้ว

      @@atomic14 I have explained my doubts in LinkedIn inmail message.