r/arduino • • 1d ago

Calibrating a PSP thumbstick on ESP32 Arduino: unequal travel, center drift, and a circular dead zone

1 Upvotes

The analog stick in my Arduino-based handheld didn’t return to the same raw ADC count every time. A fixed center of 2048 would have been wrong even before considering the drift.

Bench readings (12-bit ADC counts, rounded): X ≈ 777 / 1585 / 2831 and Y ≈ 829 / 1900 / 3247, listed as minimum / center / maximum. The positive and negative spans differ on both axes. With the stick released, the center can shift by about 100 counts against short-term noise of roughly ±10–20 counts.

The useful normalization is piecewise: subtract the calibrated center, then divide by the measured travel from center to the endpoint on that side. For X that’s 808 counts left and 1,246 right. This makes the full movement on each side reach the same output scale instead of making one direction slower in a game.

On the prototype I average 16 samples, smooth the result, and apply a 15% circular dead zone after normalizing both axes. A circular dead zone tests the vector magnitude rather than suppressing X and Y independently. I only let the estimated center adapt slowly while the stick is in the idle region; otherwise a held input can get reinterpreted as neutral.

An easy exercise is to log the raw counts and normalized coordinates while tracing a circle. Watch the resulting trajectory before and after the piecewise scaling. If the corners still feel asymmetric, the log lets you see whether it is the stick’s physical gate, the calibration, or the dead-zone transform.


r/arduino • • 2d ago

Whats the best way to solder these tiny things

Post image
53 Upvotes

Im trying to solder wires onto it and i swear its impossible


r/arduino • • 1d ago

Look what I made! My first arduino project: Plasma orb + Arduino uno R4

3 Upvotes

Arduino controls the ball by draining it's ground via FET, while mobile companion allows using the ball for notifications, visualize the sound and create and play custom patterns. I call it heresy detector.


r/arduino • • 2d ago

Beginner's Project Joystick programming/parts

4 Upvotes

I have yet to start the project, but I’m trying to get as much information as possible before I spend any money on it. I’m looking to design and code a pair of joysticks to use as controllers for my pc. The issues I’m running into is a reliable cheap Hall effect sensor for the main x/y axis of the joystick. My current idea is to use ps5 or steam deck replacement joysticks but I don’t know how the programming aspect of that works or if it would work at all, I’d just like some insight on if anyone has used and programed standalone controller joysticks.
Edit: to clarify I’m looking to essentially recreate the thrustmaster farmstick, just more budget friendly and customized.


r/arduino • • 1d ago

School Project Arduino Meditation Biofeedback – Which Sensors Should I Use?

2 Upvotes

Hi everyone!

I want to build an acoustic biofeedback system for meditation.

The idea is that the more deeply I meditate, the more consistent the sound becomes. When I lose focus, the sound gets quieter, gently reminding me to return to my meditation.

I was thinking about using a breathing sensor to measure my breathing patterns as an indicator of my meditation state.

Does anyone have experience with this or recommendations for suitable sensors?

Looking forward to your tips!


r/arduino • • 2d ago

Getting Started Best Starter Kit Around 30$?

6 Upvotes

I’m a beginner, I’ve been looking at the Elegoo basic starter kit for the Uno r3. is this good enough or do I need to upgrade to the super starter kit for the best experience? What other suggestions do you have and what would be the best option at this price range?


r/arduino • • 2d ago

Look what I made! I built a sample deck, voice changer and bluetooth receiver with the UNO Q!

32 Upvotes
Sample deck in-situ
Sample Deck Closeup

This is a project I built for a party recently. It uses an Arduino UNO Q, a Media Carrier for Audio output, and a bunch of Modulino modules (buttons, knob, pixels, distance).
The main features are:

  • Plug in a microphone and get live voice FX (echo, reverb, HP/LP Filter, robot, radio, bitcrusher, pitch)
  • 18 sample buttons with 4 tabs, 72 sample slots overall
  • Upload samples and change settings via a web UI hosted on a local wifi hotspot (scan the QR code to connect)
  • Record samples via the microphone
  • Connect to it over bluetooth to play music
  • Apply live FX to bluetooth audio and sample audio
  • Live Theramin FX mode that changes audio pitch based on how far your hand is from the distance sensor!

Full writeup and all the files needed to build it here: https://projecthub.arduino.cc/jbruges/humdrum-a-modular-sampler-and-voice-changer-with-the-arduino-uno-q-dda250


r/arduino • • 3d ago

Look what I made! Micro servo robot arm

95 Upvotes

It's a tiny ~120mm 4dof robot arm powered by 4 mg90's, 1 sg90 and an Arduino Nano ESP32.

I spent all my free time in the past few weeks modelling and remodelling robot arms in freecad, learning as I go. The first few designs didn't look very nice, it was too heavy or I just couldn't get everything to fit in my length/weight constraints. I finally decided to just model the most rudimentary arm I could finish — no wire management, no smooth flowing anesthetics like some of the robot arms I've seen on the internet... Just reach the finish line and make it move.

I quite like it now, and I think I'll keep working on it and see how that goes. It's open source too github (very incomplete)


r/arduino • • 3d ago

Look what I made! I made this Cocktail Machine with Arduino

Thumbnail
youtu.be
28 Upvotes

I hope you like it!


r/arduino • • 3d ago

Software Help Having trouble displaying a bitmap with u8g2 and ST7920

6 Upvotes

I'm using the programs that convert a pixel drawing into the array for the bitmap and using drawXMBP to display it.

It displays but there are always two pixels cut off the side. This is supposed to be 10 pixels wide, but it is 8. But the height is correct. I ave tried changing the canvas size but no difference. Always displays incorrectly:

const unsigned char wifiFull[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8C, 0x40,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

if (signalStrength < -1)
{
  u8g2.setFontMode(1);
  u8g2.setBitmapMode(1);
  u8g2.drawXBMP(0, 0, 128, 64, wifiFull);
}

It's just a small icon in the corner. Instead of being 10 pixels wide, two pixel colums are truncated on the left, no matter where I put the bitmap. I cant work it out. I've done this before with no problem.

Suggestions?


r/arduino • • 3d ago

Hardware Help LED and resistor

Post image
25 Upvotes

Does it look like it's in the right place?
Red LED
Long leg A10
Short leg A15
330Ω resistor B5 to B10
Red wire Arduino D13 to A5
Brown wire B15 to the 12th hole on the negative

Green LED
Long leg E25
Short leg E28
resistor E20 to D25
Green wire Arduino D12 to D20
Black wire D28 to the 10th hole on the negative


r/arduino • • 3d ago

Hardware Help Any idea why my lock isn’t working in this L298N module?

Post image
10 Upvotes

Im sorry in advance, Im way out of my depth here, im just an X-ray student that had to build some type of circuit related to xray physics for a project due this Thursday.

Im having a hard time getting my lock to move. The pushbutton works, the batteries work, and I can feel the spring inside the lock moving when I press the push button. However the lock doesn’t depress on its own without putting pressure on it first. It only needs light pressure, such as lightly holding a finger on top of it while you press the push button. I thought it could be a problem with the lock, so I bought a new one, but it works even worse. So I bought two more locks of different brands, and these don’t even move at all. So then I thought maybe the circuit needs more power? I plugged an additional 9V battery in, but that still didn’t work.

I have 2 9V batteries, a 12V/1A pushbutton, and a 12V/.43A battery attached. I also tried a 12V/.83A battery.
Any help is greatly appreciated. TIA!


r/arduino • • 3d ago

Getting RPM data out of these cheap 12v fan by using it single phase hall effect latch

Thumbnail
gallery
26 Upvotes

This is a pretty simple process if you have mess with them before, do beware that some have sealed hole.

Just connect the 2nd or the 3th pin to the your MCU digital pin, and make sure to use high value resistor like 1M ohm or somthing, my arduino crash if i connect it raw, and your may too, even death is possible.

I wasnt able to find that fan hall effect latch data sheat, but i figure they are the same anyway.

My fan hall effect latch, output high at 180 and 360, so the my code divide it by 2.

Doing some coding and thats it.

I did check it accuratecy using slowmo, they spit out the same number so that good enough.

Mine is in RPS but converting it to RPM is easy.
Serial.println(((fan1_rotation_accumulate / 2.0) / measure_time), 1);  //rps
Serial.println(((fan1_rotation_accumulate / 2.0) / measure_time) * 60.0, 1);//rpm

  //THIS ONE IS THE LATER CODE SNIPPET
  //THE WHOLE CODE IS BELOW
  static uint16_t fan1_rotation_accumulate = 0;
  static unsigned long start;
  static unsigned long end;

  static float measure_time = 5;  // rps every second
  static bool fan1_high_flag = false;
  static bool start_high_flag = false;

  //fixed time acumulation
  // edit: i made i small improvement to this code after posting, by adding an extras if statement,
  // this make the ouputed data very consistant, but it resolution is tide to how long the time window you're measuring

  if (digitalRead(2) == LOW || start_high_flag == true) {  //start as soon as it pass the hall effect and turning low. Not sure why it only output rounded number
    start_high_flag = true;
    if (digitalRead(2) == HIGH) {
      start_high_flag = false;
      start = micros();
      while (1) {

        if (digitalRead(2) == HIGH) {
          if (fan1_high_flag == false) {
            fan1_high_flag = true;
            fan1_rotation_accumulate++;
          }
        } else {
          fan1_high_flag = false;
        }

        end = micros();
        if ((end - start) / 1000000.0 >= measure_time) {
          Serial.print("fan_1:");
          Serial.println((fan1_rotation_accumulate / 2.0) / measure_time, 2);  //rps
          fan1_rotation_accumulate = 0;
          break;
        }
      }
    }
  }

//THE WHOLE CODE

void setup() {
  Serial.begin(9600);
  pinMode(2, INPUT);
  pinMode(3, INPUT);
}



void loop() {
  static uint16_t fan1_rotation_accumulate = 0;
  static uint16_t fan2_rotation_accumulate = 0;
  static unsigned long start;
  static unsigned long end;
  static float measure_time = 1;  // rps every second
  static bool fan1_high_flag = false;
  static bool fan2_high_flag = false;


/*
  //fixed time acumulation
  start = micros();
  while (1) {
    //fan 1
    if (digitalRead(2) == HIGH) {


      if (fan1_high_flag == false) {
        fan1_high_flag = true;
        fan1_rotation_accumulate++;
      }
    } else {
      fan1_high_flag = false;
    }
    //fan 2
    if (digitalRead(3) == HIGH) {


      if (fan2_high_flag == false) {
        fan2_high_flag = true;
        fan2_rotation_accumulate++;
      }
    } else {
      fan2_high_flag = false;
    }


    end = micros();
    if ((end - start) / 1000000.0 >= measure_time) {
      Serial.print("fan_1:");
      Serial.println(((fan1_rotation_accumulate / 2.0) / measure_time), 1);  //rps
                                                                        //  Serial.println(((fan1_rotation_accumulate / 2.0) / measure_time) * 60.0, 1);//rpm
      fan1_rotation_accumulate = 0;
      Serial.print("fan_2:");
      Serial.println(((fan2_rotation_accumulate / 2.0) / measure_time), 1);
      fan2_rotation_accumulate = 0;
      break;
    }
  }


*/
  
  //avg by time
  // fit for stable ouput
  // instead of waiting 60s to see result, you can see the result get more narrowed down with time
  // run longer time frame by changing the time_frame measuring window
  // it wont be good for fast changing rpm


  static uint8_t acum_time = 1;
  static uint8_t time_frame = 60;  //in second


  start = micros();


  while (1) {
    //fan 1
    if (digitalRead(2) == HIGH) {


      if (fan1_high_flag == false) {
        fan1_high_flag = true;
        fan1_rotation_accumulate++;
      }
    } else {
      fan1_high_flag = false;
    }
    //fan 2
    if (digitalRead(3) == HIGH) {


      if (fan2_high_flag == false) {
        fan2_high_flag = true;
        fan2_rotation_accumulate++;
      }
    } else {
      fan2_high_flag = false;
    }


    end = micros();
    if ((end - start) / 1000000.0 >= measure_time) {
      //Serial.println(acum_time);


      Serial.print("fan_1:");
      Serial.println(((fan1_rotation_accumulate / 2.0) / (measure_time * acum_time)), 2);


      Serial.print("fan_2:");
      Serial.println(((fan2_rotation_accumulate / 2.0) / (measure_time * acum_time)), 2);
      acum_time++;
      if (acum_time >= time_frame) {
        fan1_rotation_accumulate = 0;
        fan2_rotation_accumulate = 0;
        acum_time = 1;
      }
      break;
    }
  }
  
}

r/arduino • • 3d ago

Fast FFT class for LGT8F328P Arduino

4 Upvotes

FFT class to take different sizes eg 128, 64, 32, 16, 8 bins.

Speeds: 128: 6.1ms, 64: 2.7ms, 32: 1.12ms.

https://github.com/beaka/uDSU_DSP


r/arduino • • 4d ago

Look what I made! I made a thing for people that lost one of their arms so they can still use a pc.

73 Upvotes

It does't work that well cuz I used very cheap components but still. :))

It can simulate mouse movement and some kind of edge scrolling, when the pointer leaves an imaginary circle it keeps going, then simulate clicks and some keyboard presses.

Overall I should have used an esp instead of arduino or make use of a wifi module with arduino and make use of the wifi instead of using a very cheap radio transmiter.
And I should have used more accelerometer/gyroscopes, the more expensive ones for better precision, and so I can have more ways to detect and calculate input.

The glove has one arduino nano, one radio transmiter, one accelrometer gyrscope, the usb dongle has one arduino micro pro and a radio receiver.


r/arduino • • 3d ago

Beginner holiday build: 30-LED WS2812B Christmas light strip on an Arduino UNO (wiring, power tip, and starter code)

5 Upvotes

Sharing a quick 25-minute breadboard holiday build for anyone looking for a simple weekend project with an Arduino UNO and a strip of addressable LEDs.

Parts used:

  • 1x Arduino UNO Rev3 (or clone)
  • 1x WS2812B addressable LED strip (30 LEDs, 5 V)
  • 1x 470 ohm resistor (in series on the data line)
  • 1x 1000 uF electrolytic capacitor (across the 5 V supply rails)
  • 1x 5 V / 3 A external power supply
  • Breadboard and jumper wires

Wiring:

  1. Connect the 5 V external supply positive and ground to the breadboard power rails, with the 1000 uF capacitor across +5 V and GND (watch the polarity stripe on the negative leg).
  2. Power the WS2812B strip from the external 5 V and GND rails.
  3. Connect Arduino GND to the same breadboard GND rail (common ground is essential so the data signal has a reference).
  4. Connect Arduino pin 6 through the 470 ohm resistor to the strip's DIN (data in) pad, checking the arrows printed on the strip so data flows in the right direction.

The one trap beginners hit: do not power 30 LEDs straight from the Arduino's 5 V pin. At full white each pixel can pull around 60 mA (up to 1.8 A total), which will brown out or overheat the board. Giving the strip its own 5 V supply and tying grounds together keeps everything rock solid.

Starter sketch (using the FastLED library):

#include <FastLED.h>

#define DATA_PIN 6
#define NUM_LEDS 30
CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(80);
}

void loop() {
  for (int i = 0; i < NUM_LEDS; i++) {
    leds[i] = (i % 2 == 0) ? CRGB::Red : CRGB::Green;
  }
  FastLED.show();
  delay(600);
  for (int i = 0; i < NUM_LEDS; i++) {
    leds[i] = (i % 2 == 0) ? CRGB::Green : CRGB::Red;
  }
  FastLED.show();
  delay(600);
}

If you want a printable wiring diagram and live supplier pricing for the parts list, the full step-by-step guide is here: https://usefootprint.app/projects/ws2812b-neopixel-strip?utm_source=reddit&utm_medium=post&utm_campaign=reddit&utm_content=arduino_neopixel


r/arduino • • 3d ago

Uno Q Can we install N-map in the Arduino UNO Q

4 Upvotes

just trying to set up an home lab for the penetration testing and network security stuff is anyone has and idea to download the external packages from apt like n-map to download in the Arduino-OS


r/arduino • • 3d ago

Beginner's Project Pro micro button box

Post image
8 Upvotes

Hey all, looking for a bit of help and direction. Making a button box for sim racing. Pretty basic and just emulates ignition wipers lights.
- it has 4 toggles and 1 button all led and using vcc on the board for power

- The left most toggle controls the button. Meaning when it is off the button is off. When on ignition turns on. Then pressing the button will start the car.

- the other toggles will be off or on. And just be used to control lights or wipers in the game.

As the game uses key presses I’m unsure if I should be using the keyboard library or joystick library.

Can someone help point me in the right direction on the correct way to go library wise, maybe a basic toggle example


r/arduino • • 4d ago

Safe prototype

31 Upvotes

So ive been working on this for a day now and got a prototype and eventually am going to 3d print a frame and desing a pcb,yall got any other ideas that i should add to it


r/arduino • • 3d ago

Why would a print statement solves an input or timing problem?

3 Upvotes

I built a very simple system with a momentary switch that activates a linear actuator, which then goes through a sequence of motions (hence the Arduino instead of a simple switch).

My main loop has a variable that tracks the previous status of the switch and then I assign a digitalRead() to a second variable. By comparing the digitalRead to the previous status, the code only responds once to status changes (I don't know how long the user will hold the button down).

It worked, but had unexpected problems - the actuator would only complete part of its sequence and then branch into other parts or re-start its sequence. I figured the mechanical switch was bouncing or something like that, so I added in delays and so forth, but nothing solved the problem.

To try to figure it out, I added a print statement immediately after where I assign the digitalRead() status so I could see what status was being read. This was just a debug attempt, but it completely solved the problem and everything worked properly. I thought that was a coincidence, I must have made some other change somewhere so when everything was working properly, I commented out the print statement, and the timing problems came back.

I tried other variations like just doing a second digitalRead() after the first one (without printing anything) and assigning the second digitalRead() to a dummy variable, but none of those fixed the problem; the print statement seemed to clear some buffer or something.

Can anyone explain this, or is there a better way to fix the problem? Thanks.

void loop() {

buttonPush = digitalRead(buttonPin);

Serial.println(digitalRead(buttonPin)); <--- This is the debug line that fixed everything

if (buttonPush == HIGH && buttonState == LOW) { // Button released

// Go through button release sequence

}


r/arduino • • 3d ago

I'm turning an old phone into a rover that will cross 3.9 km of fields to the next village. Day 0

6 Upvotes

Hi all! This is Kevin – an old Android phone that spent years in a drawer. Now he's getting a second life.

The plan: build a small rover around the phone and send it 3.9 km across fields and dirt roads to the next village here in Slovakia. Alone.

Current parts:

- old smartphone (brain, camera, face)

- Arduino

- 4x yellow TT gear motors + wheels

- motor driver

- power: the phone's own battery + a power bank

Big unknowns so far:

- will the power bank last for a 4 km trip

- how the motors will handle mud and grass

- how the phone should talk to the Arduino (USB OTG vs Bluetooth)

What would you change before I start building? Any tips for driving through fields with TT motors are very welcome 🙏

I'll post updates as Kevin progresses.

YouTube: https://youtube.com/@kevintherover

Website: www.kevintherover.com


r/arduino • • 4d ago

Beginner's Project My First College Engineering Project An Arduino-Based Line Follower Robot

Thumbnail
gallery
25 Upvotes

r/arduino • • 3d ago

need help for maze solving robot

4 Upvotes

hi guys, second year cs student here. we are trying to make a maze solving line tracking robot using an arduino uno r3 and a l293d microcontroller. heres the maze we need to traverse through:

the main challenge here is how to prioritise the robot so it does the specified action we need it to, ie keep going forward, go right/left, hit the obstacle outside. we are using 5 IR sensors, for front, left, right, and 2 to keep the bot on the line. the qs is, to keep wall sensing the first priority then the line tracking as second, how many more sensors will be required, how will the sensors be mounted, ie downward facing or facing the wall, and is it optimal to use a simple if/else system for the turns or a FSM to determine which action to take at a particular junction?


r/arduino • • 3d ago

How many copies of the ESP32 core do you have? Wrong answer, there's one more.

2 Upvotes

The installed Arduino (CLI) Univere is a f******* mess and far away from 'Keep It Simple'.

Quick inventory of my machine because its running out of space.

  • AppData\Local\Arduino15: cores, download cache, indexes. Shared by IDE 1.8, IDE 2 and arduino-cli, so of course they step on each other
  • Documents\Arduino\libraries: libs. Not next to the cores. Why would they be
  • AppData\Roaming\arduino-ide: IDE 2 settings, a browser cache, and an arduino-cli.yaml (+ .bak)
  • ~\.arduinoIDE: another IDE 2 folder. Just because
  • AppData\Roaming\Arduino IDE: a log file for every day I dared to open it since 2024
  • ~\.platformio: its own toolchains, its own libs, its own universe
  • VS Code extension of the week: "point me to your IDE install" or "I'll download my own cli, thanks"

And where does all of this live? Not in a directory you picked. 20GB buried in AppData, hidden by default, somewhere you'd never look. Your user profile just quietly grows. Disk cleanup won't touch it. Backup tools happily copy it every night.

Result: the same core several times at ~1.5 GB each, two versions of a library fighting over which one gets picked, and a sketch that compiles in one tool and dies in the other.

New PC? Good luck. Backing up "your Arduino setup"? Which one?

All I want is one folder. Boards, libs, config. Copy it, zip it, done.

Is it just me, or does everyone have an Arduino-old-DONT-DELETE lying around?