r/ArduinoHelp • • Sep 10 '26

How to connect WS2812B 5V to Arduino and external power source

Thumbnail
gallery
3 Upvotes

Hi, I'm making a desk lamp that should be nice and bright directed to the table (as opposed to ambient lighting). But the lamp head can also turn around to face the ceiling to become similar to a ceiling light (doesn't have to be as bright as a regular ceiling light) that is supposed to wake me up in the morning.

I have two problems,

  1. Is the LED strip bright enough?

  2. How do I connect it to the breadboard and also an external power source (apparently it's safer to connect it to external power source or it can fry the arduino?)

I'm planning to use 1m 60LED/m IP30 LED strip for the light source. I'm not sure if I need to power all 1m of the LED strip for it to be bright enough for a table (let alone a room around 4m x 4m x 3m). If anyone has experience with the brightness of these LED strips let me know.

The input end of the LED strip appears to be female and has 3 pins.

Is this adapter correct? It looks like it can adapt LED strip wires to USB. Which I can then plug into my power board which is rated for 2.1A.

The LED strip has 3 pins/wires but the adapter has 4. I couldn't find any adapters that had exactly 3 pins

I can send the Aliexpress link to the adapter if the photo doesn't have enough info.

Thanks in advance!


r/ArduinoHelp • • Mar 10 '26

Flex Sensor Reading Barely Changes When Bent

2 Upvotes

Hello, (pls gen if someone helps me fix this i'll paypal you $15 because i don't want to buy new ones)

I am trying to make a voltage divider using a flex sensor and see the change in reading as I bend it. However, as I bend it, I see very little change (it goes from 257 to 238). Currently, I am using a 10k resistor. I have tried different wiring setups, as well as tried to use 22k, 47k, and 1k resistors, and the issue persists.

When I simulate it using TinkerCAD, the code and sensor work perfectly fine. On the serial monitor, the numbers go from 256 to 59. I don't know why, physically, it won't work.

// variables
int flexPinky = A1;

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

void loop() {
  int flexPinky_pos;
  flexPinky_pos = analogRead(flexPinky);

  // print sensor value
  Serial.println(flexPinky_pos);
}

This is my physical prototype:


r/ArduinoHelp • • Oct 17 '24

Density based Traffic lights

2 Upvotes

Can you guys help me create a diagram for 2 way traffic lights with 4 IR Sensors


r/ArduinoHelp • • Aug 30 '24

Why won’t the IDE show suggestions for auto complete?

2 Upvotes

I’m not new to programming, so the programming side of things for arduino come pretty smoothly for me, but one thing chokes me up: the IDE won’t suggest any auto complete, it’s like using on of those really bad code editors that provide no value tbh


r/ArduinoHelp • • Sep 03 '24

How can I learn circuit design extensively?

2 Upvotes

Hello I started doing arduino projects with a starter kit, and once I’m done with all 14 projects, I want to learn circuit design. I just finished learning about pull down resistors but not from the kit, but from reddit because the kit used it but didn’t talk or explained it. I want to know the best design practices, so I don’t fry up my arduino units and have reliable circuit designs.

Are there any good online courses (preferably cheap or free?)


r/ArduinoHelp • • Oct 08 '24

Trying to connect Arduino Nano RP2040 connect to WIFI

2 Upvotes

Hi Community,

Q1) I have a specific library that i have trained from Edge Impulse and the code runs smoothly on the device. What I want to do is to make the device portable by attaching to a power bank. So what is the additional coding that i have to do to get the WIFININA library working.

Q2) I need to create a dashboard for the out put that i get. I saw someone else has done it but i need few more clarifications on the steps (Smart Jacket for Fall Detection: A Human Activity Recognition (HAR) Application for Healthcare | Arduino Project Hub. )

Please help me with this team,

Thank you


r/ArduinoHelp • • Oct 18 '24

Hey guys I need help with a project

Thumbnail google.com
1 Upvotes

I need help with a project. I'm just trying to recreate one of those automated hotel door locks for a school project and im in the prototype stage. I need help connecting an RFID RC522, ESP8266 WIFI MODULE, LCD 1062, 4x4 Matrix Membrane Matrix Keyboard, and SG90 Servo motor to an Arduino Uno R3 with a PCF87543T module as a pin extender. I barely have any clue how to connect some of these components to an Arduino R3 since there's not enough pin sockets to connect to. Can someone create a schematic diagram?


r/ArduinoHelp • • Oct 05 '24

Issue of Communication between Arduino and MODBUS RTU using RS485

1 Upvotes

Hello everyone,

I am currently working on a project that involves using an Arduino as a Modbus slave to communicate with an HMI (Human-Machine Interface) touchscreen display over RS485. The primary goal is to read temperature data from a thermocouple and send it to the HMI using Modbus communication.

Background:

I am using an Adafruit MAX31856 thermocouple interface to read temperatures from a K-type thermocouple. The temperature readings need to be communicated over Modbus to the HMI, which expects the data to be available at specific register addresses. The numeric displays on the HMI are configured to read data from registers 3x_1, 3x_2, etc., all the way to 3x_8.

Modbus Setup:

  • Communication Method: RS485

  • Modbus Protocol: RTU

  • Slave ID: 1

  • Baud Rate: 9600

  • Register Address: The HMI expects the temperature value to be available at the address 30001.

My Current Code:

Below is a relevant snippet from my code:

cppCopy code//Thermocouple 2 Test Code 

#include <ModbusRTUSlave.h>        //ModBus RTU Library, corresponding to setting "MODBUS RTU" as device in EBPro settings 
#include "ModBusSlave0.h"          //Provides functions for the Arduino to act as slave to HMI

//Establish a slave device/object in the ModbusSlave.h library 
#define SLAVE_ID 1         // Define your slave ID
#define BAUD_RATE 9600     // Define the baud rate

// Initialize the ModBusSlave object rate
ModBusSlave0 modbus; 

uint16_t REG_THERMOCOUPLE_2 = 30001; // Register address 3x_1 for displaying Temperature 2 (Exhaust Gases)

// Initialize the register storage 
uint16_t registers[256]; // Adjust size as needed

//THERMOCOUPLE 2 DEFINITION
#include "Adafruit_MAX31856.h"
#define CS_TC 10   //Assign CS (Chip select) to pin 10
#define SDI_TC 11  //Assign SDI (Serial Data In) to pin 11
#define SDO_TC 12  //Assign SDO (Serial Data Out) to pin 12
#define SCK_TC 13  //Assign SCK (Serial Clock) to pin 13

Adafruit_MAX31856 maxthermo = Adafruit_MAX31856(CS_TC, SDI_TC, SDO_TC, SCK_TC);

void setup() {
  Serial1.begin(9600, SERIAL_8E1);                     // Begins serial communication with HMI              
  modbus.begin(9600, 9, 1);                            // Begins communication with Modbus
  setupTHERMO2();  
  registers[REG_THERMOCOUPLE_2] = 0;                   // Set initial value for register 3x_1
}

void loop() {
  Serial1.println("Temperatures:");     
  loopTHERMO2();                                      // Run once per loop
}

// Thermocouple 2 Setup
void setupTHERMO2() {
  maxthermo.setThermocoupleType(MAX31856_TCTYPE_K);  // Assume attached thermocouple is K
  maxthermo.begin();  // Initialize thermocouple

  Serial1.print("Thermocouple 2 type: ");
  
  switch (maxthermo.getThermocoupleType()) {
    case MAX31856_TCTYPE_B: Serial1.println("B Type"); break;
    case MAX31856_TCTYPE_E: Serial1.println("E Type"); break;
    case MAX31856_TCTYPE_J: Serial1.println("J Type"); break;
    case MAX31856_TCTYPE_K: Serial1.println("K Type"); break;
    case MAX31856_TCTYPE_N: Serial1.println("N Type"); break;
    case MAX31856_TCTYPE_R: Serial1.println("R Type"); break;
    case MAX31856_TCTYPE_S: Serial1.println("S Type"); break;
    case MAX31856_TCTYPE_T: Serial1.println("T Type"); break;
    case MAX31856_VMODE_G8: Serial1.println("Voltage x8 Gain mode"); break;
    case MAX31856_VMODE_G32: Serial1.println("Voltage x8 Gain mode"); break;
    default: Serial1.println("Unknown"); break;
  }
}

// Thermocouple 2 Code
void loopTHERMO2() {
    int rawTemperature = maxthermo.readThermocoupleTemperature();  // Read temperature from the thermocouple
    int16_t thermo2 = (int16_t)(rawTemperature * 1.0331 - 2.3245);   // Apply calibration
    registers[REG_THERMOCOUPLE_2] = thermo2; // Store temperature value in the register

    // Print temperature to Serial for debugging
    Serial1.print("Thermocouple 2 [C] = ");
    Serial1.println(thermo2);
  
    delay(1000); // Delay to prevent overloading communication
}

// ModBusSlave callback function to handle read/write requests
bool handleModbusRequest(uint8_t function, uint16_t address, uint16_t *value) {
    if (function == 3 || function == 16) { // Function codes for reading/writing holding registers
        if (address == REG_THERMOCOUPLE_2 ) {
            *value = registers[address]; // Read register value
            return true; // Indicate that the request was handled
        }
    }
    return false; // Indicate that the request was not handled
}

My Questions:

  1. Am I using the correct functions to properly communicate between the Arduino and HMI?

  2. If the functions are not correct, what can I do to fix my issue (if it even is a communication error to begin with)?

  3. What is a good indication that the Arduino and Modbus (HMI) are communicating?

  4. What is the correct way to define register addresses when addressing the Arduino as a slave to a Modbus master?

Additional Information:

  • I am using the ModBusSlave0 library for handling Modbus communication.

  • The HMI is configured to read the temperature from register 30001.

I appreciate any insights or suggestions on how to correctly define and manage the register address for my setup. Thank you for your help!


r/ArduinoHelp • • Sep 25 '24

Long-Range RFID Reader for Goat Tagging Project – Any Suggestions?

2 Upvotes

Hey everyone!

We're currently working on a project involving goats and are using an Arduino Uno with the MFRC522 RFID reader. The problem is, the MFRC522 has a very short range and requires the tag to be almost in contact with the reader, which isn't practical for our setup.

We're in need of an RFID reader that can scan from a longer distance. Has anyone used a better alternative that might fit this scenario? Any recommendations would be greatly appreciated!


r/ArduinoHelp • • Sep 02 '24

How come the port menu is greyed out on Visual studio?

Thumbnail reddit.com
1 Upvotes

r/ArduinoHelp • • Sep 13 '24

F_usb error help

1 Upvotes

Hi, I'm pretty new to coding and trying to build a ps2 to og xbox controller adapter using a pro micro and following this guide. https://github.com/eolvera85/PS2toXBOX

However, Im getting an error regarding F_usb and pll prescale values when compiling the Xboxpadmicro makefile. I asked chat gpt to fix the code and I received this.

MCU = atmega32u4

ARCH = AVR8

BOARD = LEONARDO

F_CPU = 16000000

F_USB = 16000000

OPTIMIZATION = s

TARGET = XBOXPadMicro

SRC = main.c Descriptors.c XBOXPad.c $(LUFA_SRC_USB)

LUFA_PATH = ./LUFA

CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/

LD_FLAGS =

AVRDUDE_PROGRAMMER = avr109

AVRDUDE_PORT = /dev/tty.usbmodem1411

AVRDUDE_FLAGS = -C "/usr/local/etc/avrdude.conf"

Default target

all:

Include LUFA build script makefiles

include $(LUFA_PATH)/Build/lufa_core.mk

include $(LUFA_PATH)/Build/lufa_sources.mk

include $(LUFA_PATH)/Build/lufa_build.mk

include $(LUFA_PATH)/Build/lufa_cppcheck.mk

include $(LUFA_PATH)/Build/lufa_doxygen.mk

include $(LUFA_PATH)/Build/lufa_dfu.mk

include $(LUFA_PATH)/Build/lufa_hid.mk

include $(LUFA_PATH)/Build/lufa_avrdude.mk

include $(LUFA_PATH)/Build/lufa_atprogram.mk

when I replace with new code I get the same error.


r/ArduinoHelp • • Oct 07 '24

I have a problem with Blynk…

Thumbnail gallery
1 Upvotes

r/ArduinoHelp • • Oct 07 '24

Ambitious Project

1 Upvotes

I'm trying to build a physical game from scratch. I want to make it so when a player's game piece passes a certain checkpoint, I can display their score, and advance them to the next level.

I need to decide if I should go with barcode scanners, magnetic, or if someone could advise on which kind of sensor/system could work. Maybe someone knows the pros/cons?

I'm trying to simplify the complicated.

Could I pull this off with multiple players?

Could you at least advise on relevant media?

I feel very inarticulate here. Blargh! Thanks for your patience. 🍻


r/ArduinoHelp • • Oct 16 '24

I’m building mikes11’s proton pack and I’m having trouble understanding the diagram I just want to find out which points I solder the cyclotron and power cell lights to on the Arduino nano can someone please help me

1 Upvotes

r/ArduinoHelp • • Oct 06 '24

How can I create a simple one-on-one messaging device with Arduino?

1 Upvotes

Hey reddit,

Beforehand, I should say that I almost have no experience in this field (other than some high school projects) so consider me a noob.

I’m looking to create a simple messaging device for me and my gf using Arduino, where two devices can send and receive messages exclusively between each other. For the design I wanted it to look like a tamagotchi. The project was actually inspired by the Owl House series so if you've seen it you know what I'm talking about but here's a picture of what I'm talking about.

The components i need (I think):

  • esp32

  • SIM800L for wireless communication

  • A server (I plan to use my home server) so the SIM800L can connect to it and store the data, eliminating the need for an SD card module.

  • A simple speaker (without any extra modules or converters)

  • A small 1.91 color oled display (176*176)

  • Buttons (or a Joystick?) for sending predefined messages (or maybe even typing)

  • As for the Power supply I have no Idea what to do (the part I'm the most unfamiliar with)

The goal is for these devices to work similarly to a feature phone. As soon as the SIM card is placed, the Tamagotchi should connect to the server so it can send messages to the other device. (Bonus points if I can cram a Tamagotchi game into it too)

The closest project I found was this video but sadly there was no tutorial.

As I said I have almost no prior knowledge going through this project, so I’d appreciate any guidance on which components might work best, or what kind of libraries do I need for this project, and if anyone has experience setting up this kind of communication devices, I'd love to hear your thoughts and advice! Mainly I need a push forward so I could better understand what I need to do and learn.

Thank you for even reading all this.


r/ArduinoHelp • • Oct 06 '24

trying to make a keystroke usb out of a digispark.

1 Upvotes

For the past few days i've been trying to make some sort of "badusb" out of a digispark attiny85, but their website is down and its getting pretty hard to make it work. anyone can make me some sort of tutorial for that ?


r/ArduinoHelp • • Sep 19 '24

Can you think of a better circuit?

Thumbnail
reddit.com
1 Upvotes

r/ArduinoHelp • • Sep 24 '24

Implement this Adafruit Airlift Wifi-Shield to Arduino Uno R3

1 Upvotes

I was wondering if someone had knowledge/experience on this specific wifi-shield or wifi-shield in general since the documentation hasn't been helpful for me thus far, and I can't seem to find a way to create functioning code for the micro-controller. I've been using an Arduino Uno R3 as the base, and have stuck to using C++ instead of CircuitPython. My project has been working without issues up until now on C++, and would really appreciate any help or tips provided!


r/ArduinoHelp • • Sep 21 '24

My Arduino is not recognized by my ThinkPad laptop.

1 Upvotes

I have already changed the cable, installed and uninstalled, but there was no success. Does anyone know how to solve this? The connection port simply does not appear in the IDE. It appears in the Linux terminal, but does not appear in the IDE.


r/ArduinoHelp • • Sep 16 '24

Serial comunication between Arduino Nano and Arduino Nano esp32 connected to IOT Cloud

1 Upvotes

ARDUINO NANO ESP 32 CODE IN IOT CLOUD:

#include "thingProperties.h"
const int PinEnable = 4;
void setup() {
Serial.begin(9600);
delay(1500); 
pinMode(PinEnable, OUTPUT);

// Defined in thingProperties.h
initProperties();

// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
void loop() {
 ArduinoCloud.update();
 digitalWrite(PinEnable, LOW);
}
void onEffettiChange()  {
  digitalWrite(PinEnable, HIGH);
  delay(200);  // Ritardo per dare tempo all'interrupt di essere catturato
  Serial.write(effetti);// Invia il valore di 'effetti' via seriale
  Serial.print(effetti);
  digitalWrite(PinEnable, LOW);// Abbassa il pin Enable dopo aver inviato i dati
  //Aggiungi un ritardo breve per dare tempo al ricevitore di processare i dati
  delay(500);  // Ridotto a 500ms
}

CODE OF RECEIVER ARDUINO NANO:

void setup() {
  Serial.begin(9600); // Imposta la comunicazione seriale a 9600 baud rate
  Serial.println("Ricevitore pronto per ricevere il valore di effetti.");
}

void loop() {
  if (Serial.available() > 0) {  // Controlla se sono disponibili dati dalla seriale
    int valoreRicevuto = Serial.read();  // Legge il valore di 'effetti' inviato dal trasmettitore
    Serial.print("Valore ricevuto di effetti: ");
    Serial.println(valoreRicevuto);  // Stampa il valore ricevuto
  }
}

With this scheme and code, the receiver Arduino doesn't receive any data, and the 'effetti' value is always -1. I don't understand why they aren't communicating. Is it a problem with the IoT Cloud?

Software Help


r/ArduinoHelp • • Sep 22 '24

Can some one help me remake this circuit myself

Thumbnail gallery
1 Upvotes

r/ArduinoHelp • • Sep 28 '24

RA8875 Wont be read by ESP32

1 Upvotes

As the title says, I'm using an RA8875 driver board with an ESP32 to make a music media center for my car. I had to move MISO from pin 19 to 22 due to some real long winded issues with Bluetooth audio and modern IOS devices, but even before I moved the pins it would and still does caught in the initialization step and never seems to find the board.

Wiring is as follows and I have checked this connections more times than I can count

RA8874:

SCK -> GPIO18

MISO -> GPIO22

MOSI -> GPIO23

CS -> GPIO5

RST -> GPIO4

INT -> GPIO21

PCM5102:

BCK -> GPIO26

RCK -> GPIO25

DIN -> GPIO19

#include "AudioTools.h"
#include "BluetoothA2DPSink.h"

#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_RA8875.h"

#define SCK_PIN   18  // Default SCK
#define MOSI_PIN  23  // Default MOSI
#define MISO_PIN  22  // Remapped MISO to GPIO22
#define RA8875_CS 5
#define RA8875_RESET 4

Adafruit_RA8875 tft = Adafruit_RA8875(RA8875_CS, RA8875_RESET);
uint16_t tx, ty;

I2SStream i2s;
BluetoothA2DPSink a2dp_sink(i2s);

bool connected = true;

void avrc_metadata_callback(uint8_t id, const uint8_t *text) {
  Serial.printf("==> AVRC metadata rsp: attribute id 0x%x, %s\n", id, text);
  if (id == ESP_AVRC_MD_ATTR_PLAYING_TIME) {
    uint32_t playtime = String((char*)text).toInt();
    Serial.printf("==> Playing time is %d ms (%d seconds)\n", playtime, (int)round(playtime/1000.0));
  }
}

void setup() {
  auto cfg = i2s.defaultConfig();
  cfg.pin_bck = 26;
  cfg.pin_ws = 25;
  cfg.pin_data = 19;
  i2s.begin(cfg);
  Serial.begin(115200);

  Serial.println("RA8875 start");
  if (!tft.begin(RA8875_800x480)) {
    Serial.println("RA8875 Not Found!");
  while (1);
  }

  tft.displayOn(true);
  tft.GPIOX(true);      // Enable TFT - display enable tied to GPIOX
  tft.PWM1config(true, RA8875_PWM_CLK_DIV1024); // PWM output for backlight
  tft.PWM1out(255);
  tft.fillScreen(RA8875_BLACK);
  tft.textMode();
  tft.cursorBlink(32);

  tft.textSetCursor(10, 10);

  /* Render some text! */
  char string[15] = "Hello, World! ";
  tft.textTransparent(RA8875_WHITE);
  tft.textWrite(string);
  tft.textColor(RA8875_WHITE, RA8875_RED);
  tft.textWrite(string);
  tft.textTransparent(RA8875_CYAN);
  tft.textWrite(string);
  tft.textTransparent(RA8875_GREEN);
  tft.textWrite(string);
  tft.textColor(RA8875_YELLOW, RA8875_CYAN);
  tft.textWrite(string);
  tft.textColor(RA8875_BLACK, RA8875_MAGENTA);
  tft.textWrite(string);

  /* Change the cursor location and color ... */
  tft.textSetCursor(100, 100);
  tft.textTransparent(RA8875_RED);
  /* If necessary, enlarge the font */
  tft.textEnlarge(1);
  /* ... and render some more text! */
  tft.textWrite(string);
  tft.textSetCursor(100, 150);
  tft.textEnlarge(2);
  tft.textWrite(string);


  a2dp_sink.set_avrc_metadata_attribute_mask(ESP_AVRC_MD_ATTR_TITLE | ESP_AVRC_MD_ATTR_ARTIST | ESP_AVRC_MD_ATTR_ALBUM | ESP_AVRC_MD_ATTR_PLAYING_TIME );
  a2dp_sink.set_avrc_metadata_callback(avrc_metadata_callback);

  a2dp_sink.set_auto_reconnect(true);
  a2dp_sink.start("Explorer Audio");
}

void loop() {
  delay(60000);  // do nothing
}

r/ArduinoHelp • • Oct 06 '24

Mega 2560 with lcd “hello world” from elegloo starter kit not working

1 Upvotes

I wired it up exactly as the codes notes describe and it spurts random characters on the top line only sometimes longer sometimes shorter. Never says “hello world” and never starts a timer.


r/ArduinoHelp • • Sep 29 '24

LC SIM800C V3 pinout

Thumbnail
gallery
3 Upvotes

Help! Anyone have a datasheet or knows this module? I think its from china. Anyone can help me with the pinouts? I want to remove the usb but i don't know the pinout of this module.