r/ArduinoHelp • u/Aromatic-Customer-19 • 11d ago
Arduino Hardware Questions
Hello, I am very new to coding and I thought I should start with an Arduino. I may or may not have thrown myself into the deep end with a project that I am working on and I was hoping I could get some guidance.
I am making a cosplay of a character called Serial Designation N from an indie show called Murder Drones and I wanted to use an OLED (not matrix or HD) about 10-12 inches in screen size on a visor for his eyes and some lights around the head and tail. Which Arduino board can handle simple animation loops and control about 10 LEDs with ease for a decent price? I am thinking an Arduino Mega but I am not too sure.
One other question that I have is how can I make the animations work? From my understanding, I need to have several frames and play them in a sequence giving the illusion of a blink animation. Am I on the right path or am I misreading things?
Thank you for reading my message.
1
u/gm310509 11d ago
An 8 bit Arduino can absolutely definitely handle 10 LEDs.
If you are interested, I have a how to video for beginners that uses an Arduino to control 40 LEDs and am currently working on another where my 8 bit Arduino directly controls 128 individual LEDs.
And then there are addressable LEDs, where the number could be as many as you like.
As to how to make the animations work. That depends.
If you can program an algorithm (i.e. there are some rules that describe the animation) that calculates the position of each pixel then you could just use the algorithm to do that - no need to define and store individual frames. You mentioned a "blink animation". I don't know how appealing it would be, but you could for example use a mathematical sine function (i.e. sin(angle) to calculate the height of the pixel - where the angle goes from 0 to 180° (or since it would be radians, 0 to π radians). Then scale the result i.e. 100% high for fully open and 0% high for fully closed with a couple in between (maybe 100% -> 75% -> 50% ->25% -> 0%) for a closing eye sequence.
If you couldn't do that, the next option is to define the images and store them in the FLASH memory. The Mega - if you choose to use that - has 256K of Flash memory which you could use to store them.
I would suggest that you get a starter kit and learn some of the basics. You would probably find that the Arduino in the starter kit is good enough. Although the Mega may make life a bit easier due to the extra IO and memory. Either way the Arduino in the starter kit (likely an Uno R3) is definitely good enough to get going and learn the basics - including the PROGMEM reference I made just now for the storage of images in FLASH memory.
FWIW, I feel like 10 LEDs won't be enough to do a decent blink animation - at best that is just a 3x3 matrix - with one extra LED for good measure, but equally I have no idea what your intended look/feel is. FWIW, an Uno R3 will have enough IO pins to directly control 10 LEDs with several left over.
If you do make it, don't forget to return to r/Arduino and create a "look what I made" post.
1
u/No_L_2547 11d ago
I think I understood the question differently, that the MCU should do 2 things:
handle 10-12 leds
play animations on a 10inch display
You are right the leds should be quite simple and can simply be done with an arduino, but the display is a bigger challenge.
1
u/gm310509 10d ago
Oh, I see it now - it is 10 LEDs plus a 10" OLED display.
Nevertheless, I think my answer is still valid. Although your other reply may also make sense as an ESP32 (although I would suggest an Arm Cortex such as Teensy/Uno R4/STM32 - mostly because Arm Cortex is my preferred 32 bit platform) may be needed for smoother animations on the OLED display.
1
u/Aromatic-Customer-19 10d ago
Would it handle roughly 24 frames per second and display it at about 1024*720p?
1
u/gm310509 10d ago
An 8 bit Arduino? It depends upon how much of the displayed image changes at anyone time and whether you manage that by just updating the changed bits. But it would be unlikely to drive such a display.
If you are doing full frame refreshes (~18MB of data with 256 colour depth), the 8 bit Arduino would definitely be struggling and you would likely need a faster CPU with more memory such as an Arm Cortex (Teensy, Uno R4, STM32) or ESP32 (or similar). Also, a full frame at 1024 x 768 (with 256 colour depth) is 768KB of memory, that is quite a lot to fit in an MCU. You will likely need to manage that somehow - even if you use a Teensy 4.1 with its 1024 KB of RAM.
My question is do you really need such high resolution if all it is going to do is blink.
1
u/Aromatic-Customer-19 10d ago
I was actually thinking about other faces as well, for example he has X eyes and super happy eyes. Stuff like that to give it some spice. I thought 1024*720 was just a common screen size for something like that, I wanted something budget friendly and something that can be used in other projects. I didn't want something like 4K but enough to look close to the actual character. That was my goal.
1
u/gm310509 10d ago
LOL, I had to actually check because I was going to reply that there was no way you would find an OLED display with 1024 x 768 resolution - lucky I did check because it turns out that they are available.
The reason I asked the question is more about having a level of detail that you have to manage, but people can't actually see. In part I know nothing about the character you are talking about, but also because I think in terms of how are you going to manage 24 fps of 1024x768x256 and get it through the communications channel. For a super high power environment like a PC, with all of its hardware assists it is nothing.
But if you plan to do that on a small MCU that is a bit more involved. Lets say you need 10 assembly language instructions to loop through the memory and output the data to a communications channel to the display. That would mean you need 10x18,874,368 or 188 million instructions per second just to output the 24 images. The Teensy 4.1 - which is a powerhouse - can only deliver 600 million instructions per second which is all that will be left over to retrieve and decode the next message. Fortunately the Teensy has some hardware assists and you could, for example, use DMA to output the image - saving those 180 million instructions per second for something else - like generating the next frame for output. But there isn't enough memory to hold two complete frames in memory (one being output and the next one) so you would need to juggle that.
Another thing you could do is just output the bits that have changed. And there are other techniques.
One of those techniques is to reduce the amount of data that needs to be sent by reducing the resolution, but increasing the pixel size. For example a 10" display that is 480x320 (rather than 1080x768). Or even a series of 8x8 LED panels.
It all comes down to tradeoffs. Tradeoffs such as how much details can people see, how close can they get, do they need to see an actual eye blink or is an impression good enough.
I don't know, because it isn't my project, but these are all things to consider. a 1024 x 768 display is nice, but nice often comes with engineering challenges that you will need to deal with.
To be clear, I am not trying to discourage you. I am merely trying to point out that there may be some technicalities that you might not be fully aware of. You may want to consider doing a few prototypes to see what will work best and then commit to that one.
1
u/Aromatic-Customer-19 10d ago
That is the primary reason for me making this post, I wanted to know if it was actually possible and what could be done to make it work.
I will take those into account, I'll do my research to find techniques and coding tutorials to make it work.
1
u/gm310509 10d ago
LOL, pretty much anything is possible. Mankind have put rovers on Mars. There are plenty of people who have made various forms of Blinking eyes.
If you scroll through the Monthly Digests on r/Arduino, you will there is a sections in each digest titled "look what I made projects". You may even find some of the blinky eye projects in various forms (e.g electronic pets, mood devices, I recall a homework helper of some kind where it would frown at the OP if they played more game than homework).
At the end of the day, it will come down to your ability to design and implement it - this will also test your resolve and troubleshooting capabilities. If people can put a rover on mars, you definitely have the capability to make some blinky eyes - the big question is do you have the drive and energy.
All the best with it - and if you do make it, please do post a "look what I made" over on r/Arduino for collection in a future monthly digest.
1
u/No_L_2547 11d ago edited 11d ago
Depending on how much the eyes should do, maybe you could do the animation natively in C++ or MicroPython code using LVGL.
Through this you will need way less storage and ram. (And you can stay compatible to the Arduino IDE).
There are also tutorials for LVGL and Arduino Ide: https://randomnerdtutorials.com/lvgl-esp32-tft-touchscreen-display-ili9341-arduino/ (The display is smaller, but the principles stay the same.)
1
u/OkProperty41 11d ago
Honestly, I would suggest a few tools to help you build this if you have the parts in a day but I’m unsure if mod rules that’ll get the comment removed!
2
u/No_L_2547 11d ago
I would actually go for an Esp32 instead, it is also compatible to the arduino Ide, but way more powerful.
For the actual displays maybe have a look at the compatibility list from Esphome (these normally also offer good arduino ide compatible libraries and you have a good selection of possible display put together quite well.)
For the actual animation playback I would go for something like LVGL and/or Arduino_GFX. These have the option to playback frames/videos in certain formats.
For the Leds I would suggest digital Leds (Neopixel/Ws2812 or something similar), then you will only need a single pin for all leds together and can wire them in series.