Тёмный

Arduino OLED 3D Compass 

upir
Подписаться 54 тыс.
Просмотров 28 тыс.
50% 1

PCBWay: www.pcbway.com/setinvite.aspx...
Source Files: github.com/upiir/arduino_oled...
WOKWI Sketch: wokwi.com/projects/3859878114...
-----------------------------------------------------
Links from the video:
- Starting wokwi project: wokwi.com/projects/3718520295...
- 10K Potentiometer: s.click.aliexpress.com/e/_Dk1...
- 128x32 SSD1306 OLED Display: s.click.aliexpress.com/e/_DBF...
- Solid Aluminium Knob: s.click.aliexpress.com/e/_DFP...
- Breadboard wires: s.click.aliexpress.com/e/_Dkb...
- Arduino UNO: s.click.aliexpress.com/e/_AXDw1h
- Arduino breadboard prototyping shield: s.click.aliexpress.com/e/_ApbCwx
- Image2cpp (convert array to image): javl.github.io/image2cpp/
- Photopea (online graphics editor like Photoshop): www.photopea.com/
- Arrays of strings: www.arduino.cc/reference/en/l...
- 128x64 display initialization: github.com/olikraus/u8g2/wiki...
- Used u8g2 font: github.com/olikraus/u8g2/wiki...
Related videos with Arduino UNO and OLED screen:
- Image to OLED in 60 seconds - • Image to OLED in 60 se...
- Arduino + OLED displays: • Arduino + OLED Displays
------------------------------------------------------
Learn how to create a simple compass using the Arduino UNO, 10K potentiometer and the SSD1306 128x32px IIC OLED display.
------------------------------------------------------
PCBWay is a service for manufacturing custom PCBs. If you click the link above, you will get a coupon for $5, which is exactly the price of 10 pieces of custom PCBs. In that case, you will only pay for shipping. Do you have any experience doing this? Please let me know in the comment section!
------------------------------------------------------
Do you have any questions? Suggestions for the next video? Please put those down in the comment section. I try to answer as many questions as I can. Thank you for watching, reading the video description and I hope to see you next time. Good luck with your projects!
------------------------------------------------------
#arduino #diy #OLED
------------------------------------------------------

Опубликовано:

 

3 янв 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 97   
@upir_upir
@upir_upir 4 месяца назад
All the source files are on GitHub: github.com/upiir/arduino_oled_3d_compass
@thepythoncodez
@thepythoncodez 4 месяца назад
I'm glad I came here as soon as I saw the video, this was amazing. Keep up the great work!
@tom95076
@tom95076 4 месяца назад
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 4 месяца назад
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 4 месяца назад
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 4 месяца назад
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 4 месяца назад
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 4 месяца назад
Nice idea! We can go with the lookup table!
@theagileaardvark
@theagileaardvark 4 месяца назад
@@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 4 месяца назад
Refer to the Maclaurin expansion of cos(x), then you may understand why the auther uses x=y^2 ;-)
@mohamedbakelli
@mohamedbakelli 4 месяца назад
this is the most underrated channel. btw i love screens too!
@upir_upir
@upir_upir 4 месяца назад
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 4 месяца назад
Thank you, but the 128x32px is still quite a decent resolution :)
@randalltockes2247
@randalltockes2247 4 месяца назад
I've become hooked on your videos. Always wondered how graphics like this were handle in code.
@upir_upir
@upir_upir 4 месяца назад
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.
@phakalanep7241
@phakalanep7241 4 месяца назад
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 4 месяца назад
Glad you enjoyed it! Hope you have learned something new.
@andymouse
@andymouse 4 месяца назад
Awesome looking display that realy does trick the mind very well...cheers and Happy New Year!
@upir_upir
@upir_upir 4 месяца назад
Thank you for your nice comment and of course, happy new year to you as well!
@sayatly
@sayatly 4 месяца назад
Beautiful compass and good explanation. Thanks
@upir_upir
@upir_upir 4 месяца назад
You are welcome, I´m glad you like it!
@chexo3
@chexo3 4 месяца назад
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 4 месяца назад
That´s an interesting idea. I always wanted to make a "smart" mirror project.
@NavySturmGewehr
@NavySturmGewehr 4 месяца назад
Wicked! Caught your upload just as it came out!
@upir_upir
@upir_upir 4 месяца назад
Perfect timing!
@peterdangelo2707
@peterdangelo2707 4 месяца назад
Actually dope man. Really cool stuff.
@upir_upir
@upir_upir 4 месяца назад
Thank you, I´m glad you like it!
@ucglib530
@ucglib530 4 месяца назад
Sooo cool and impressive what you did with u8g2. Amazing and informative. Thanks!
@upir_upir
@upir_upir 4 месяца назад
Glad you liked it! Thank you for your nice words.
@MeineVideokasetten
@MeineVideokasetten 4 месяца назад
As always: *Very* nice project.
@upir_upir
@upir_upir 4 месяца назад
Thank you!
@mojo_jojo
@mojo_jojo 4 месяца назад
Very nice! Thanks for the explanation!
@upir_upir
@upir_upir 4 месяца назад
You are surely welcome!
@thomasleftwite
@thomasleftwite 4 месяца назад
Wokwi, Photopea, and Desmos, You make good use of advanced web tools!
@upir_upir
@upir_upir 4 месяца назад
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 4 месяца назад
@@upir_upir Let me know if you have tips to find those web tools or if you know good portal site to find them.
@rontheglider
@rontheglider 3 месяца назад
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 3 месяца назад
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 4 месяца назад
bro, i ve been looking for this one for a long long time
@upir_upir
@upir_upir 4 месяца назад
I’m glad you have finally found it!
@lautungho1
@lautungho1 4 месяца назад
can u make a version with a compass??@@upir_upir
@lautungho1
@lautungho1 4 месяца назад
i am using #include #include as the library, what should i change???@@upir_upir
@lukihagen
@lukihagen 4 месяца назад
That looks so cool. I'd love to see a virtual compass on a GC9A01 round display.
@upir_upir
@upir_upir 4 месяца назад
Thank you. I do actually plan to do the same project with a color display!
@bimokayoba
@bimokayoba 4 месяца назад
Nice 👌 Keep up the good work ♥
@upir_upir
@upir_upir 4 месяца назад
Thank you!
@dilirink9222
@dilirink9222 4 месяца назад
Cool guide!
@upir_upir
@upir_upir 4 месяца назад
Thank you!
@analogheaven3835
@analogheaven3835 4 месяца назад
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 4 месяца назад
That´s an interesting idea! Unfortunatelly the LED ring light was not a full circle.
@analogheaven3835
@analogheaven3835 4 месяца назад
oh sorry, i totally forget about that :(@@upir_upir
@karlohorcicka7388
@karlohorcicka7388 4 месяца назад
Funny how the other day I thought "I should ask Upir to make something compass-related"
@upir_upir
@upir_upir 4 месяца назад
You are in luck, because I have another compass-related video in progress...
@SMO_KWEED
@SMO_KWEED 4 месяца назад
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 4 месяца назад
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 4 месяца назад
@@upir_upir Thanks for your answer:)
@upir_upir
@upir_upir 4 месяца назад
@SMO_KWEED you are welcome, have a nice day!
@janbuck90
@janbuck90 4 месяца назад
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 4 месяца назад
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)
@fredericfitaire2073
@fredericfitaire2073 4 месяца назад
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 4 месяца назад
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 4 месяца назад
@@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 4 месяца назад
​ @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 4 месяца назад
Or rather the compass sensor such as HMC5883L.
@upir_upir
@upir_upir 4 месяца назад
@@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!
@srsct123
@srsct123 4 месяца назад
Great work Want to try with neo pixel ring
@upir_upir
@upir_upir 4 месяца назад
Thank you, yep, I’m sure it would look nice with neopixels!
@a-toxa
@a-toxa 4 месяца назад
Огромное спасибо. Отличная работа. Море информации. Очень познавательно. :)
@upir_upir
@upir_upir 4 месяца назад
English please :)
@diversitynone431
@diversitynone431 4 месяца назад
Это не компас. Только шкала и энкодер
@a-toxa
@a-toxa 4 месяца назад
@@diversitynone431 Конечно. Я понимаю. На Ардуино нужно подавать требуемый сигнал. Для MSFS 2020, думаю, это не проблема.
@upir_upir
@upir_upir 4 месяца назад
@@diversitynone431 Please use english so anyone can understand. Thank you.
@diversitynone431
@diversitynone431 4 месяца назад
@@a-toxa так это тоже будет лишь индикация. Надеялся увидеть под таким названием магнитометр и обработку его сигналов, а не индикатор. Откуда MSFS будет знать что вы там на ардуине подключает? У меня есть плата от симулятора и некоторые приборы от кокпита, но без драйверов это все мусор и с драйверами без софта тоже.
@plazmax
@plazmax 4 месяца назад
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 4 месяца назад
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 4 месяца назад
@@upir_upir great news :)
@gorillaau
@gorillaau 4 месяца назад
​@@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.
@putraadriansyah8082
@putraadriansyah8082 4 месяца назад
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 4 месяца назад
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!
@lohikarhu734
@lohikarhu734 Месяц назад
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 Месяц назад
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!
@diversitynone431
@diversitynone431 4 месяца назад
What is the accuracy of azimuth measurement?
@upir_upir
@upir_upir 4 месяца назад
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.
@stefano.a
@stefano.a 4 месяца назад
Where did you found that knob?
@upir_upir
@upir_upir 4 месяца назад
I have updated the video description with the link to the knob.
@stefano.a
@stefano.a 4 месяца назад
@@upir_upir thank you!
@upir_upir
@upir_upir 4 месяца назад
@stefano.a you are welcome!
@janedoe6182
@janedoe6182 4 месяца назад
Хоть польза от максимальной локализации переменных не особо видна в игрушечном проекте из 50 строк кода, эти compass_degrees, buffer, xpos_offset можно было бы объявить внутри функции loop(). Даже переменные, что должны сохранять состояние между вызовами, тоже можно объявлять внутри, как статические. А то, так можно дооптимизироваться до того, что и переменные циклов начать объявлять снаружи функций.
@upir_upir
@upir_upir 4 месяца назад
English please :)
@mranthony1886
@mranthony1886 Месяц назад
Shame it's done without a proper sensor
@upir_upir
@upir_upir Месяц назад
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 4 месяца назад
🧭
@upir_upir
@upir_upir 4 месяца назад
I need to start using emojis in video titles :)
Далее
Arduino ATtiny85 OLED Menu
34:46
Просмотров 18 тыс.
Arduino + OLED = 3D ?
28:45
Просмотров 673 тыс.
🎙Пою Вживую!
2:59:56
Просмотров 1,2 млн
Super sport😍🔥
00:14
Просмотров 1,6 млн
Building a haptic input knob from scratch!
11:29
Просмотров 1,1 млн
I found PERFECT display
51:32
Просмотров 204 тыс.
Optimizing Arduino Code: no setup(), no loop() ⛔
9:27
What's the difference? Arduino vs Raspberry Pi
6:21
Просмотров 1,8 млн
DIY sonar scanner (practical experiments)
14:30
Просмотров 1 млн
🎙Пою Вживую!
2:59:56
Просмотров 1,2 млн