Arduino OLED 3D Compass

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ม.ค. 2025

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

  • @upir_upir
    @upir_upir  ปีที่แล้ว +8

    All the source files are on GitHub: github.com/upiir/arduino_oled_3d_compass

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

      I'm glad I came here as soon as I saw the video, this was amazing. Keep up the great work!

  • @tom95076
    @tom95076 ปีที่แล้ว +11

    I can't believe how important you have become to me. The videos are always 150% more than what I can understand. but, I know you are using all the tools to allow me to follow and put my new knowledge into my own projects. I have a very simple form of this and struggled to get that going. putting the Value of the encoder into a string seemed so simple for you. Thank you so much for taking the time to get these videos up and out others like me.

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

      Thank you for your nice words, I´m glad you like my videos and that you are learning something new and valuable. I´m sure with time, that 150% number will decrease. Good luck with your projects and thanks again!

  • @theagileaardvark
    @theagileaardvark ปีที่แล้ว +10

    For remapping the scale on the x-axis, a sin or cos could have been used to create a "rounder" looking stretch effect, I think :)

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

      That´s right, but you cannot change the appearance too much. With the power function, you can play with the exponent and get the look you like the most.

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

      true but the compute power needed to do that might be a bit overkill especially on projects that are performing extra calculations outside of using the display

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

      Nice idea! We can go with the lookup table!

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

      @@ithaca2076 In this case you might want to do it with a sin lookup table (like we did in the old days). Store an array of sin values you would need for half your display and use mirrored values for the other half. No computation needed at all (so from a computational expense point of view even cheaper than the original pow() version), at the expense of a bit of storage space.

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

      Refer to the Maclaurin expansion of cos(x), then you may understand why the auther uses x=y^2 ;-)

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

    this is the most underrated channel. btw i love screens too!

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

      I´m glad you think that, but I´m pretty happy where I am with the channel. I have just barely started :)

  • @dnlarts
    @dnlarts ปีที่แล้ว +4

    Awesome tutorial. Quite fastinating what you achieved with such a limited res display

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

      Thank you, but the 128x32px is still quite a decent resolution :)

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

    Actually dope man. Really cool stuff.

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

      Thank you, I´m glad you like it!

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

    WOW all I can say is you're flying @10000 ft over my head but well done I love this video learning new items is GREAT! Thank you

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

      Glad you enjoyed it! Hope you have learned something new.

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

    Wokwi, Photopea, and Desmos, You make good use of advanced web tools!

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

      Yep, there are quite so many web tools free to use, it’s great, since you don’t have to purchase expensive tools in the beginning.

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

      @@upir_upir Let me know if you have tips to find those web tools or if you know good portal site to find them.

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

    I've become hooked on your videos. Always wondered how graphics like this were handle in code.

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

      Well, in that case, I´m glad you found those! Feel free to suggest any other effect you might be interested in, I will consider it for my future videos.

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

    Wicked! Caught your upload just as it came out!

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

      Perfect timing!

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

    Awesome looking display that realy does trick the mind very well...cheers and Happy New Year!

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

      Thank you for your nice comment and of course, happy new year to you as well!

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

    Sooo cool and impressive what you did with u8g2. Amazing and informative. Thanks!

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

      Glad you liked it! Thank you for your nice words.

  • @goldrojak
    @goldrojak 17 วันที่ผ่านมา +1

    better explanation than chatGBT. thank you sir

    • @upir_upir
      @upir_upir  16 วันที่ผ่านมา

      Thank you, I´m glad it was helpful!

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

    You could stick this in a rear view mirror like those smart mirror projects and have a compass for your car.

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

      That´s an interesting idea. I always wanted to make a "smart" mirror project.

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

    As always: *Very* nice project.

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

    Beautiful compass and good explanation. Thanks

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

      You are welcome, I´m glad you like it!

  • @rontheglider
    @rontheglider 10 หลายเดือนก่อน +1

    Hi, great project and I like the display with the virtual 3D ring. If i am correct the potmeter drives the compass to demonstrate the 3D compass heading ring. Would be great if you could connect a magnetic compass sensor and turn it it in a real compass. Possibly with calibration option.

    • @upir_upir
      @upir_upir  10 หลายเดือนก่อน

      Yes, correct, it´s just a simulation for now. And I do plan to connect it to the real compass module and try it that way as well.

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

    bro, i ve been looking for this one for a long long time

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

      I’m glad you have finally found it!

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

      can u make a version with a compass??@@upir_upir

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

      i am using #include
      #include as the library, what should i change???@@upir_upir

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

    That looks so cool. I'd love to see a virtual compass on a GC9A01 round display.

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

      Thank you. I do actually plan to do the same project with a color display!

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

    Funny how the other day I thought "I should ask Upir to make something compass-related"

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

      You are in luck, because I have another compass-related video in progress...

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

    this Arduino project could be good with that potentiometer ring that you showed last time in video, but it would need 4 red LED for showing north, south, east and west or just simple markings, but OLED display is good too

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

      That´s an interesting idea! Unfortunatelly the LED ring light was not a full circle.

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

      oh sorry, i totally forget about that :(@@upir_upir

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

    Very nice! Thanks for the explanation!

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

      You are surely welcome!

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

    Nice 👌
    Keep up the good work ♥

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

    Nice project ! But I'd prefer seeing it using a rotary encoder instead of a potentiometer for a continuous rotation without stops. An update would be much appreciated ! Thanks

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

      Great suggestion! I´m using a potentiometer because of its simplicity, but I will indeed include some rotary encoders in my future projects. If you need some examples in the meantime, WOKWI has a support for rotary encoder with some examples.

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

      @@upir_upir Thanks a lot ! An idea would be to increment the compass of 5° for each step of the rotary encoder (or any other value in the code). Looking forward to see it soon ;)

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

      ​ @upir_upir I was thinking to use your awesome solutions to create a clock where the seconds "rotate" on a wheel between the hours and the minutes. Braun had something like that back in the day.
      Thanks for the amazing knowledge!

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

      Or rather the compass sensor such as HMC5883L.

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

      @@beavisul Sounds very interesting, do you have a link/ product name? I always loved the Braun products, they just look awesome. Also, thank you for your nice words!

  • @lohikarhu734
    @lohikarhu734 8 หลายเดือนก่อน +1

    i was thinking that it should be possible to do the scaling of the direction characters mathematically, if i use stm32, that have floating point math, and use a trigonometric function to "scrunch the characters as they 'rotate'...seem like a possibility?
    certainly, the 'canned' pixel blocks work fine, just trying to complicate things 😁

    • @upir_upir
      @upir_upir  8 หลายเดือนก่อน

      You can definitely scale images in the code. I have tried that but the result was slow and not quite convincing. The speed should not be a problem on STM32, but I have found it easier to use images since I can tweak pixels here and there if I need to. Good luck with your projects!

  • @electronicswithzee2565
    @electronicswithzee2565 6 หลายเดือนก่อน +1

    Good day Upir. How can the code be modified to show a "permanent" heading/marker on the rotating portion of the compass. The idea is to have a visual indication to keep the marker on the rotating portion on the degrees shown on the top display. Hope this make sense. I would like to use your code to steer a small RC tank to a way-point via a predefined heading setting on the rotating portion of the compass, using the compass on the Oled, and then by keeping the marker and the compass reading aligned keep the tank in the correct direction.

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

      Thank you for your comment. You should be able to draw a new bitmap on the position of the desired tickmark. Just say that if the tickmark angle equals your marker angle, draw also the marker.

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

    That's an awesome tutorial! But ever since I discovered your channel I was wondering why are you using u8g2 library and not adafruit one?

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

      Thank you for your nice comment. The library has more fonts, more functions and it supports more displays, but there is not much difference between adafruit one when it comes to those "standard" OLED displays. I have actually used Adafruit library in a few videos as well. Once you learn how to use u8g2, the adafruit library is almost identical.

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

      @@upir_upir Thanks for your answer:)

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

      @SMO_KWEED you are welcome, have a nice day!

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

    Cool guide!

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

    This is a great project! Is there a way to eliminate the degree value jumping when the potentiometer is not moving?

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

      There are many ways, depends on what kind of problems you see. A simple solution would be to smoothly jump to the next value by adding only a fraction of the new value to the old value. I.e. new_value = old_value + ((new_value - old_value) / 2)

  • @TSDcustom
    @TSDcustom 7 หลายเดือนก่อน +1

    Off-topic question, but I'm desperate. Where can I find help writing code for a pedometer on an OLED screen and with the GY-521 board?

    • @upir_upir
      @upir_upir  7 หลายเดือนก่อน

      A quick google shows some sample codes for using this unit. What part are you struggling with?

    • @TSDcustom
      @TSDcustom 7 หลายเดือนก่อน

      @@upir_upir The problem is that nothing works for me. I found almost the same project as mine, but only the library logo glows on my screen (((And I can’t adapt the sketch to my project because I have very little understanding of Arduino

  • @srsct123
    @srsct123 11 หลายเดือนก่อน +1

    Great work
    Want to try with neo pixel ring

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน

      Thank you, yep, I’m sure it would look nice with neopixels!

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

    Hey, can you make a video on how can I generate a signal that varies from 1hz to 1054hz, to run a car speedometer.
    I have a spare 1988 Toyota Cressida digital cluster that I'm currently experimenting with, i found that the car uses old style spinning wire from transmission to the back of the cluster, and from there it digitalizes the signal using a Optical interruptor sensor.
    The sensor loves to stop working mid driving just because a small dust. And I'm getting tired to disassemble the cluster over and over again just to clean the dust.
    So my idea is to use GPS module with Arduino to get vehicle speed, and then pass the signal to the cluster by connecting a digital/pwm pin to the sensor's signal wire. The original sensor is using 5v so it's compatible with Arduino.
    I've tried using tone(9,100); and the speedometer responds OK, but tone() cannot generate under 31hz (under 9km/h) so it just jumps between 50kph to 299kph if my code applies less than 31hz frequency to the tone() function

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

      Try searching for "arduino pwm frequency library". The library allows for a frequency range from 1Hz - 2MHz on 16 bit timers and 31Hz - 2 MHz on 8 bit timers. Hope that helps!

  • @a-toxa
    @a-toxa ปีที่แล้ว +1

    Огромное спасибо. Отличная работа. Море информации. Очень познавательно. :)

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

      English please :)

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

      Это не компас. Только шкала и энкодер

    • @a-toxa
      @a-toxa ปีที่แล้ว

      @@diversitynone431 Конечно. Я понимаю. На Ардуино нужно подавать требуемый сигнал. Для MSFS 2020, думаю, это не проблема.

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

      @@diversitynone431 Please use english so anyone can understand. Thank you.

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

      @@a-toxa так это тоже будет лишь индикация. Надеялся увидеть под таким названием магнитометр и обработку его сигналов, а не индикатор. Откуда MSFS будет знать что вы там на ардуине подключает? У меня есть плата от симулятора и некоторые приборы от кокпита, но без драйверов это все мусор и с драйверами без софта тоже.

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

    What is the accuracy of azimuth measurement?

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

      Depends on the used compass module, this tutorial is only about the graphics and OLED. From a quick googling, most Arduino-compatible compass modules will give you at least 5° precision, all the way up to 2°. Still not too much.

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

    Hello, it was very nice and descriptive. Before I read the title of the video, I thought from the cover photo that it was a radio project :) Thank you very much.

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

      Thank you for your comment. Actually, I think that updating the display for tuning a radio station would look nice as well. I might try that :)

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

      @@upir_upir great news :)

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

      ​@@upir_upir You could have some fun with that one, including adding radio station call signs to the dial. Replace the potentiometer with an encoder jog wheel for easy scrolling across the broadcast band.

  • @stefano.a
    @stefano.a ปีที่แล้ว +1

    Where did you found that knob?

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

      I have updated the video description with the link to the knob.

    • @stefano.a
      @stefano.a ปีที่แล้ว +1

      @@upir_upir thank you!

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

      @stefano.a you are welcome!

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

    Хоть польза от максимальной локализации переменных не особо видна в игрушечном проекте из 50 строк кода, эти compass_degrees, buffer, xpos_offset можно было бы объявить внутри функции loop(). Даже переменные, что должны сохранять состояние между вызовами, тоже можно объявлять внутри, как статические. А то, так можно дооптимизироваться до того, что и переменные циклов начать объявлять снаружи функций.

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

      English please :)

  • @mranthony1886
    @mranthony1886 8 หลายเดือนก่อน +1

    Shame it's done without a proper sensor

    • @upir_upir
      @upir_upir  8 หลายเดือนก่อน

      I just though that there are already a lot of tutorials showing how to use the digital compass module with Arduino, so I focused on the graphics instead. That said, I might use a proper sensor the next time.

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

    🧭

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

      I need to start using emojis in video titles :)

  • @cyklop1977
    @cyklop1977 6 หลายเดือนก่อน +1

    Thx

    • @upir_upir
      @upir_upir  6 หลายเดือนก่อน

      You are welcome!