r/ArduinoHelp

Why my Arduino shuts down when I connect it to the Vcc of the sensor?pls

Why my Arduino shuts down when I connect it to the Vcc of the sensor?pls

My sensor is the SFR05 ultrasonic distance and the arduino uno

u/willa_28 — 1 day ago

SRF05 Ultrasonic distance sensor and Arduino

Each time that I try to connect the sensor Vcc pin with the Arduino it shuts down. Somebody can explain why please?

u/willa_28 — 1 day ago

What are " jumpers " and how do I acquire them?

https://preview.redd.it/bzj5ldzbdewg1.jpg?width=3024&format=pjpg&auto=webp&s=b8eb9aa9b33b1a02799ee967597def042acd6899

Hello!

So I am trying to do some Sony 9-pin communication, and I have been informed that in order for it to work, I need to set " jumpers " on the RS422-shield. However, how do I acquire those jumpers?

I'm sorry if I sound like a noob, because I am. I am still new to all this. So all help is appreciated.

reddit.com
u/Intrepid-Addendum-80 — 3 days ago
▲ 9 r/ArduinoHelp+1 crossposts

Help with the TFT LCD 2.8” 240x320

We tried to connect it for hours, but we couldn’t make it work. We’re using Arduino Uno R4 wifi.

Can anyone help?

u/EILA09 — 4 days ago

can anybody me what my arduino is doing here?

i recently got this and now its not allowing me to upload sketches to it anymore, and it connects and disconnects all the time

and now it just light up a little bit with the RGB led it would be super nice if i didnt have to buy a new one...

thanks for answering,

u/janky_NPC — 4 days ago
▲ 2 r/ArduinoHelp+1 crossposts

Arduino Uno clone VcV Rack connection failing

Hyy beautiful souls! thanks in advace for the kind help! a month ago I was able to connect my arduino one (clone) to vcv through hairless midi and loopmidi to convert the signal coming from plants in VCV (I found a post here explaining all the procedures and it worked!) It's been a month I didn't use it and now, trying to connect it again is not working anymore, hairlessmidi does not see the port I create on Loop Midi, but I think also Loop midi is not recieving the signal from arduino, althouth it itself is working properly ( setting up it first on IDe I can see the signal coming there). Cant uderstand what have happend because before it was working perfectly. Maybe some stupid windows updates? I am on Wind 11. And of course I am closing Ide when I open loop and hairless. Any suggestion? Pleasee I was so happy before now I am really upset!! Thanks and hugs from Italy

reddit.com
u/Yellowlemonmelon — 3 days ago
▲ 3 r/ArduinoHelp+1 crossposts

Joystick on Pro Micro moves mouse too fast / jumps – how to smooth relative movement?

Hi reddit,

I'm building a custom controller for a school project. I have an Arduino Pro Micro (ATmega32U4) with a dual-axis analog joystick (KY-023) and four tactile buttons that will be soldered onto a perfboard (currently still on the breadboard to try out which makes it more difficult to determine whether the problem lies in the code or the wiring). The goal is to use the joystick to control the mouse cursor (relative movement) to demonstrate different input strengths.

What I've already done:

  • The joystick is wired to A0 (X-axis) and A1 (Y-axis), both with 5V and GND.
  • Buttons are wired as digital inputs with internal pullups enabled.
  • I wrote a basic sketch that reads analog values, maps them, and calls Mouse.move(x, y).

What actually happens:

  • The cursor moves, but it feels "jumpy" and too fast, even with small joystick deflections.
  • There is also slight cursor drift when the joystick is physically centered.

What I expected:
Smooth, proportional movement – small joystick tilt → slow cursor movement, full tilt → faster movement.

I suspect the linear mapping plus the fixed delay is the problem. I've read about using acceleration curves (e.g., exponential) but I'm unsure how to implement one without introducing lag. Could someone point me to an example or explain how to apply a non-linear curve to the mapped values before calling Mouse.move()?

Thank you for any hints.

Here is my current code (just for the joystick im trying to keep it as simple as possible so i can understand what i actually did)

#include <Mouse.h>

int xAxis = A0;

int yAxis = A1;

int deadzone = 10;

void setup() {

Mouse.begin();

Serial.begin(9600);

}

void loop() {

int xRaw = analogRead(xAxis);

int yRaw = analogRead(yAxis);

int xMove = map(xRaw, 0, 1023, -10, 10);

int yMove = map(yRaw, 0, 1023, -10, 10);

if (abs(xMove) < deadzone) xMove = 0;

if (abs(yMove) < deadzone) yMove = 0;

Mouse.move(xMove, yMove);

delay(10);

}

reddit.com
u/NorthWin763 — 1 day ago

Should this RS422-shield be able to communicate with the help of an Arduino?

Hello! So a few days ago I have tried to simulate a Sony 9-pin communication by running code from the github: GitHub - hideakitai/Sony9PinRemote: RS422 Sony 9-Pin Protocol Remote Controller of VTRs for Arduino · GitHub in Arduino IDE. I had my PC connected to an Arduino, which was then connected to a RS422-shield, which was then connected to a male 9-pin cable through the terminal block, which then was connected further into a " slave device ". However, when I ran this code:

// #define SONY9PINREMOTE_DEBUGLOG_ENABLE
#include &lt;Sony9PinRemote.h&gt;


Sony9PinRemote::Controller deck;


void setup() {
    Serial.begin(115200);
    Serial1.begin(Sony9PinSerial::BAUDRATE, Sony9PinSerial::CONFIG);
    delay(2000);
    Serial.println("Running like that");


    deck.attach(Serial1);


    // get device status
    deck.status_sense();
    if (deck.parse_until(1000)) {  // wait until response comes (timeout = 1000ms)
        if (!deck.is_media_exist())
            Serial.println("ERROR: there is no media!");


        if (!deck.is_remote_enabled())
            Serial.println("ERROR: remote control is disabled!");


        if (!deck.is_disk_available())
            Serial.println("ERROR: removable media is not available!");


        if (!deck.is_stopping()) {
            deck.stop();
            deck.parse_until(1000);
        }


        deck.device_type_request();
        if (deck.parse_until(1000)) {
            Serial.print("device type = ");
            Serial.println(deck.device_type(), HEX);


            if (deck.device_type() == Sony9PinDevice::BLACKMAGIC_HYPERDECK_STUDIO_MINI_NTSC) {
                Serial.println("this device is BlackMagic HyperDeck Studio Mini NTSC");
            }
        } else
            Serial.println("ERROR: device type request failed!!");
    } else {
        Serial.println("ERROR: device status request failed!!");
    }
}


void loop() {
    // if previous command has completed (response has come)
    if (deck.ready()) {
        static bool b = false;
        if (b)
            deck.play();
        else
            deck.stop();
        b = !b;
        delay(2000);
    }
    if (deck.parse()) {        // if some reply has come
        if (!deck.ack()) {     // if the reply is not ack
            deck.print_nak();  // print nak
        }
    }
}

I received the error message:

ERROR: device status request failed!!

So it seems like my Arduino tried to send a message but was unable to receive any response from the slave device. I believe it's because the cables protruding from the RS422-shield's terminal block were connected to the wrong pins on the male 9-pin cable, so I reconnected them. I connected the cable protruding from the letter " B " on the terminal block to pin 2, the letter " A " cable to pin 7, " Z " cable to pin 8 and the " Y " cable to pin 3. The ground cable I connected to pin 4. I have tried attaching pictures on how my connection looks like, but I wasn't able to get a clear picture, so apologies if my pictures look blurry.

So now I want to ensure I am all set and I can run a successful simulation when connecting the Arduino. Do you think this should work?

...because I have heard it might be possible that the RS422-shield requires some extra " jumpers " to make it work, which I am not sure about. But do you think I am good to go, or do you see some problem here that I am not seeing?

I appreciate all help!

https://preview.redd.it/4pohjo3cwivg1.png?width=404&format=png&auto=webp&s=eeffb22eec6029a186a62066aed8f033067f2a79

https://preview.redd.it/a7bde91evivg1.jpg?width=3024&format=pjpg&auto=webp&s=f831affc16e602a5f485c5b7c9802a9398b2edcb

https://preview.redd.it/flo0461evivg1.jpg?width=4032&format=pjpg&auto=webp&s=268abab2a10493c6cf0268b9bdafa54bbe502986

reddit.com
u/Intrepid-Addendum-80 — 8 days ago

can anybody tell me if it is possible to download the esp32 boards to the arduino ide, but as a tar.gz file

its because i have a pretty bad wifi connection for my computer, so it would be nice if i could download the boards without the Library Manager

reddit.com
u/long_onion1 — 7 days ago
▲ 4 r/ArduinoHelp+1 crossposts

Connecting 6 Servo motors to an Arduino Uno with a Mac

So trying to connect 6 servos for a project but I have a Mac…

It worked for one servo but now it’s not accepting any input and giving me error codes

I searched online and read about the Ch340 but the only ones I have seen are from 2016-2022 which may be outdated

I tried one and it didn’t work even after resetting everything

Is there something I can do to make it compatible with a Mac?

reddit.com
u/Traditional-Pin3979 — 9 days ago

5 Channel IR sensor array Value got stuck on 981

My 5 Channel IR sensor array Value got stuck on 981 analog value and it's doesn't change until i completetly touch the ir sensor with the surface no gap between them. I thought the sensor it damaged so i changed to new one but problem not solved its showing same thing with new ir sensor array. So i think its not ir sensor problem maybe the code i wrote. So can anyone help me with this issue 😭

u/DotJazzlike4176 — 7 days ago

Downloaded sketch doesn't work

I downloaded an arduino project online, but the code won't compile. Can someone help me?I get an error message that says:

In file included from C:\Users\joshu\AppData\Local\Temp\.arduinoIDE-unsaved2026314-15064-1n28yyq.xhpef\sketch_apr14a\sketch_apr14a.ino:1:
C:\Users\joshu\OneDrive\Documents\Arduino\libraries\HID-Project\src/HID-Project.h:35:2: error: #error HID Project can only be used with an USB MCU.
   35 | #error HID Project can only be used with an USB MCU.
      |  ^~~~~
In file included from C:\Users\joshu\OneDrive\Documents\Arduino\libraries\HID-Project\src/HID-Project.h:39:
C:\Users\joshu\OneDrive\Documents\Arduino\libraries\HID-Project\src/SingleReport/SingleAbsoluteMouse.h:28:10: fatal error: HID.h: No such file or directory
   28 | #include "HID.h"
      |          ^~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

Here's the code

#include "HID-Project.h"
//NOTE!! You need to add the above HID-Project library for this code to work.
//https://github.com/NicoHood/HID
//The device will show up as a gamepad/joystick in windows called "Seeed"

const int pinEject = 2;
const int pinArm = 3;

void setup() {
  pinMode(pinEject, INPUT_PULLUP);
  pinMode(pinArm, INPUT_PULLUP);

  // Sends a clean report to the host. This is important on any Arduino type.
  Gamepad.begin();
}

void loop() {

  //check EJECT
  if (!digitalRead(pinEject)) {
    static uint8_t count = 0;
    count = 0;
    while (count&lt;=2) {
      count++;
      Gamepad.press(1);
      Gamepad.write();
      delay(50);
      Gamepad.release(1);
      Gamepad.write();
    }}
    else {
      Gamepad.release(1);
    }
  

  //Check ARM
  if (!digitalRead(pinArm)) {
    Gamepad.press(2);
    Gamepad.release(3);
  }
  else {
    Gamepad.release(2);
    Gamepad.press(3);
  }

  Gamepad.write();

    // Simple debounce
    delay(50);
    
  }
u/CaptainHunt — 9 days ago
▲ 2 r/ArduinoHelp+1 crossposts

So Im currently using the arduino shield rev 3 with my arduino uno. I’m trying to get my 12v computer fans to run with my sim rig. My problem is when I connect the 12v ground to the shield the uno loses power.

I’ve checked the wires, everything is correct. Nothing is touching. It’s only when the ground is in the terminal, even if the 12v psu is unplugged the gnd shuts the uno down. My uno is powered via usb. Any help?

reddit.com
u/chiefakridge — 10 days ago

Cannot use nrf24 on Seeed Xiao ESP32-C5

Hello everyone.

I just got a xiao mcu to use with a nrf24 as receiver. I spent the whole day trying to figure out how to set it up, to no avail.

So far, here is my code (below). I finally have SPI OK, after setting manually every pin. But I get Radio Fail and nRF FAIL as well. The wiring obviously is pristine and has been checked more times than I dare to say.

Any help or hint would be appreciated, thanks in advance !

Edit : Output is :

SPI OK

RADIO FAIL

nRF FAIL

DETAILS

SPI Speedz = 10 Mhz

STATUS = 0x00 RX_DR=0 TX_DS=0 TX_DF=0 RX_PIPE=0 TX_FULL=0

EN_RXADDR = 0x00

RF_CH = 0x00

RF_SETUP = 0x00

CONFIG = 0x00

DYNPD/FEATURE = 0x00 0x00

Data Rate = 1 MBPS

Model = nRF24L01+

CRC Length = Disabled

PA Power = PA_MIN

ARC = 0

===

#include &lt;SPI.h&gt;
#include &lt;RF24.h&gt;
#include &lt;nRF24L01.h&gt;



#define CE_PIN D6
#define CSN_PIN D5
#define SCK_PIN D8
#define MISO_PIN D9
#define MOSI_PIN D10


const byte thisSlaveAddress[6] = "00001";


RF24 radio(CE_PIN, CSN_PIN);


char dataReceived[12]; // this must match dataToSend in the TX


SPIClass spi(FSPI);
//===========


void setup()
{


   pinMode(CE_PIN, OUTPUT);
   pinMode(CSN_PIN, OUTPUT);
   pinMode(MOSI_PIN, OUTPUT);
   pinMode(SCK_PIN, OUTPUT);
   pinMode(MISO_PIN, INPUT);
   
   Serial.begin(9600);
   delay(3000);


   bool okspi = spi.begin(SCK_PIN, MISO_PIN, MOSI_PIN, CSN_PIN);
   Serial.println(okspi ? "SPI OK" : "SPI FAIL");


   bool ok = radio.begin(&amp;spi);
   Serial.println(ok ? "RADIO OK" : "RADIO FAIL");


   bool okchip = radio.isChipConnected();
   Serial.println(okchip ? "nRF OK" : "nRF FAIL");


   radio.setPALevel(RF24_PA_MIN);
   radio.setDataRate( RF24_1MBPS);


   radio.openReadingPipe(1, thisSlaveAddress);
   radio.startListening();


   Serial.println("DETAILS");
   radio.printDetails();
   Serial.println("===");
}


//=============


void loop()
{
   if (radio.available()) {


    radio.read(&amp;dataReceived, sizeof(dataReceived));
    //Serial.println(dataReceived);
    delay(1000);
   }
}
reddit.com
u/JeinStobeck — 6 days ago

Coding Help w/ Arduino Nano and LED Matrices

I am working on creating u/edisonsciencecorner LED Hourglass project. In the original project there are two matrices which use a Nano and an ADXL335 accelerometer to illustrate the "grains" of sand falling as LED's. I created that project and it ran super smoothly. Shout out to Edison for sharing that code.

I'd like to modify the code to allow for a second set of matrices to be run from a different set of pins on the Nano/

I created an initial Wowki project that has the code and a rough idea of how the components are wired. Wowki Project. I had to use the MPU-6050 as a place holder as there was no ADXL335.

I was hoping to see if anybody had any ideas on how to modify the code for a second set of LED matrices. I am a super beginner so this might be out of the realm of possibility for me. Any help would be greatly appreciated!

u/razmalriders — 2 days ago

Why Can't my Arduino IDE find a file that is LITERALLY THERE?!

https://preview.redd.it/zh2jto1arwwg1.png?width=1764&format=png&auto=webp&s=2d73d359b20f30376a2e52de32c9a403a5a39c57

Hello! So I received an error message when verifying code in the Arduino IDE that the header-file " Commands.h " can't be found. ...but IT IS LITERALLY HERE:

https://preview.redd.it/bivh81kgrwwg1.png?width=1168&format=png&auto=webp&s=d92dc2803a2447cb55fec5cf55f357cb78037722

It's in THE SAME PLACE AS EVERYTHING ELSE! Why can my program easily find everything else ( like " Sony9PinRemote.h " ) but not this?!

Here is " Commands.h ", btw. Perhaps the problem lies in the code...

#include <Sony9PinRemote.h>

#ifdef SONY9PINREMOTE_DEBUGLOG_ENABLE

#include <DebugLogEnable.h>

#else

#include <DebugLogDisable.h>

#endif

Sony9PinRemote::Controller deck;

namespace command {

void ONE() {

deck.play();

}

void TWO() {

deck.stop();

}

void THREE() {

deck.shuttle_forward(10);

}

void FOUR() {

deck.shuttle_forward(10);

}

void FIVE() {

deck.shuttle_reverse(10);

}

}

reddit.com
u/Intrepid-Addendum-80 — 14 hours ago

Using an arduino to setup an ESC for Brushless Motor

Hello, I am in the process of building a arduino RC plane. I just bought an ESC for my motor (Roxxy 715 S-Bec).

My plan (for starters) is to control it using my arduino, and so far i've used the setup and code available here :

https://howtomechatronics.com/tutorials/arduino/arduino-brushless-motor-control-tutorial-esc-bldc/

My problem is setting up the ESC for its first time. The user manual states :

- Programmable RC system set servo travel for throttle / motor to 100% in both directions

- Move transmitter throttle stick to the motor OFF position

- Connect a fully charged flight battery (-> beeps tones etc should occur)

The full manual is available here.

I do not understand how, plugging the battery last, the ESC could possibly understand that the throttle is at max then min, given no power source is supplied.

Sorry if my question does not fit here, and thank you for answering !

u/JeinStobeck — 8 days ago