Replace MEGA with cheaper microcontroller

Hello. Recently I was able to take an Arduino MEGA home, and I found a use for it.

The volume controls on my keyboard are annoying, so I plugged a potentiometer and an LED right into the Arduino, then I made an Arduino script that writes the potentiometer to the serial monitor. Then I wrote a python script that reads the serial monitor and changes my PC volume to match it. The LED also dims based on the serial monitor value.

Here's the thing. I might want to use the MEGA on something else. So, I want to buy a really cheap microcontroller that has an analog port, at least one digital port, and can talk with the computer over the serial monitor. The three chips I found are Arduino Nano, ESP8266, and ESP32. But I wanted to ask someone before I throw money at one.

Do you have any recommendations?

All the alternative you mention work - neither the Nano or ESP8266 or ESP32 have a great Analog Input (ADC component) but for what you describe it should be enough

you can find really cheap boards esp. if you are not in a rush and you buy from the Far East ...

That's good to know, thanks. Could you give any specific names of some knockoff boards or just somewhere to start looking?

The official Arduino store even if you buy clones later. I'd suggest a Micro or Nano.

1 Like

The cheapest, and smallest, controller you'll find to do this is probably the Seeed XIAO RP2040.
I think it was about 5US$ last time I got some.

Be careful with some of the smaller versions of "arduinos" like the micro, pro micro, nano etc, some of them can be tricky to flash.

Suggest looking into using the HID/keyboard emulation capabilities of a Pro Micro.

1 Like

I would suggest the Nano, I have been using them for years and generally treat them like a through hole IC and simply plug it into my project that is a custom PCB. I usually put a 0.1 uF MLCC cap on Vref, that appears to stabilize the A/D.

1 Like

I am agree with @gilshultz and I’ll add that the Nano clone on Ali is one of the cheapest Arduinos - it costs less than $2

My advise would be to stick to AVR based boards (Nano, Micro, Pro Micro); the only thing you might have to adjust is the PWM pin but further it will be straight forward.

When using a board that can act as a HID (Micro or Pro Micro and lots of others), you might be able to get rid of the python script.

1 Like

My vote would be for a Pro Micro. Not expensive, a decent ADC and can act as an HID - so you may be able to provide more functions than just a volume control.

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