/r/arduino

Photograph via snooOG

An unofficial place for all things Arduino!

We all learned this stuff from some kind stranger on the internet. Bring us your Arduino questions or help answer something you might know! 😉

/r/arduino

651,541 Subscribers

2

Error with esp32

I am testing a very simple IOT code using an esp32 and a telegram bot, but when compiling the code I get the message "Error compiling for the ESP32 Dev Module card", I already installed all the libraries and updated the esp32 library, and nothing, does anyone know what I could do?

1 Comment
2024/06/22
02:38 UTC

2

Anyone here have an ESP32 Trinity?

Anybody have an ESP32 Trinity? Seeing if mine is defective

Anyone have one of these and use them? For some reason WiFi will not work when I use the HUB75 I2S DMA library as specified on esp32trinity.com

My IO2 light will randomly flicker like crazy when running my code, happens every 10-20 flashes it seems like. I also have random garbled text in my serial monitor everytime I click reset, which only started a few days after I was using the board. So it definitely seems like something is wrong with the board/firmware. Anyways, does anyone have one of these and have any issues?

Someone said an S3 board be better anyway, If I have to I’ll wire it up manually to one, but I’d much rather have a cool prebuilt board like the Trinity to do the hard work. It’s made to do this, so I’m pretty sure my board is bad, but I wanna see if anyone else has any troubles. The discord and creator are no longer active.

0 Comments
2024/06/22
02:17 UTC

2

Help arduino uno on PIR motion sensor

So my school project was a motion sensor connected to a light bulb, the problem is the sensor keep sending the yes signal to the relay thus keeping the light bulb always on.
This was the video i was copying but it doesnt seem to work: https://youtu.be/UUIAMvLilb0?si=8IvXn7Kxh-SjxC8Y

Pls help this project is due in 3 days

5 Comments
2024/06/22
01:35 UTC

1

Calibrate 2 stepper motors

I'm making a new project and I have 2 nema17 motors from different manufacturers with different speed how to make them run at the same speed ?

3 Comments
2024/06/21
22:17 UTC

1

Moving 2 stepper motors simultaneously

I ‘m making a coreXY system for a project and I need to move 2 stepper motors at the same time in different speed I cannot move one then the other because my project needs precise movement so anyone knows how to achieve that using a single core microcontroller like arduino uno / nano

2 Comments
2024/06/21
21:58 UTC

3

First project, soldering or breadboard? (Deej)

This is my first approach to Arduino, i wanted to build and audio mixer for my pc using Deej. I have 0 experience in soldering and i saw that you can use a breadboard instead in a Linus' video, but it wasn't very precise. I also wanted to keep it as cheap as possible. Should i use a breadboard first? If yes, how?

Thanks in advance.

6 Comments
2024/06/21
21:28 UTC

3

Arduino cloud does not take the values of my variables.

Hi, I have a problem with arduino cloud, I am using two sht30 sensors, both attached to an I2C multiplexer and connected to an ESP32, the measurements of the sensors are given normally if I print the values on the serial monitor and the connection to wifi of the esp32 is correct where it shows me the message ( Connected to Arduino IoT Cloud), the problem occurs when I look at the variables within the cloud and all are at 0 as if they had no value. anyone has any idea what may be happening? (I attach code).

thank you very much in advance for taking the time to look at my problem.

https://preview.redd.it/jd9y4aofcz7d1.png?width=1435&format=png&auto=webp&s=8a5672ca458af257be39e614ee6803e79e4e3822

It should be clarified that if the sensors are measuring correctly, I tested them in the serial monitor and it does show the values and even in arduino IDE, but the variables are still 0 for arduino cloud.

https://preview.redd.it/bf8obkoudz7d1.png?width=514&format=png&auto=webp&s=4a45acabf845fb81ba1edfeb22ae6ddabe5939ee

https://preview.redd.it/45dn42ghcz7d1.png?width=897&format=png&auto=webp&s=3dd9284c76288279e6a2d92274c50bb20f481c7a

Sketch CODE

#include <WireData.h>

#include <Wire.h>

#include "Adafruit_SHT31.h"

#include "thingProperties.h"

Adafruit_SHT31 sht31_1 = Adafruit_SHT31();

Adafruit_SHT31 sht31_2 = Adafruit_SHT31();

#define TCAADDR1 0x70 // Dirección del primer TCA9548A

#define TCAADDR2 0x71 // Dirección del segundo TCA9548A

void tcaSelect(uint8_t tcaAddr, uint8_t i) {

if (i > 7) return;

Wire.beginTransmission(tcaAddr);

Wire.write(1 << i);

Wire.endTransmission();

}

void setup() {

// Inicializar serial y esperar a que el puerto se abra

Serial.begin(9600);

delay(1500);

Wire.begin(21, 22);

// Inicializar sensor en el canal 0 del primer TCA9548A

tcaSelect(TCAADDR1, 0);

if (!sht31_1.begin(0x44)) {

Serial.println("No se encontró el sensor SHT31 en el primer TCA9548A, canal 0, dirección 0x44");

} else {

Serial.println("Sensor SHT31 inicializado en el primer TCA9548A, canal 0, dirección 0x44");

}

// Inicializar sensor en el canal 1 del segundo TCA9548A

tcaSelect(TCAADDR2, 1);

if (!sht31_2.begin(0x44)) {

Serial.println("No se encontró el sensor SHT31 en el segundo TCA9548A, canal 1, dirección 0x44");

} else {

Serial.println("Sensor SHT31 inicializado en el segundo TCA9548A, canal 1, dirección 0x44");

}

// Inicializar propiedades y conectar a Arduino IoT Cloud

initProperties();

ArduinoCloud.begin(ArduinoIoTPreferredConnection);

setDebugMessageLevel(2);

ArduinoCloud.printDebugInfo();

}

void loop() {

ArduinoCloud.update();

// Leer datos del sensor en el canal 0 del primer TCA9548A

tcaSelect(TCAADDR1, 0);

float Temperatura1 = sht31_1.readTemperature();

float Humedad1 = sht31_1.readHumidity();

// Leer datos del sensor en el canal 1 del segundo TCA9548A

tcaSelect(TCAADDR2, 1);

float Temperatura2 = sht31_2.readTemperature();

float Humedad2 = sht31_2.readHumidity();

delay(2000);

}

thingProperties CODE

https://preview.redd.it/3p6mybxeez7d1.png?width=1275&format=png&auto=webp&s=a0baa180a0399a991db3f2ed5d749b1fd665309a

Thank you very much for taking the time to look at my problem.

0 Comments
2024/06/21
20:04 UTC

1

12v toggle switch

wanna get a toggle switch, like the one from fighter jets for a project, but on allie i can only find them for 12v 30a. theoreticly this wil still work right? 5 v to one of these?

2 Comments
2024/06/21
19:18 UTC

0

building own custom gaming keyboard

For my first arduino project i am going to program a keyboard I can use for the game War Thunder, but i have a few questions

-first of all, can you use a uno for a nano for a keyboard? i have seen diffirent kind of tutorial, all using a difirent microcontroller

-can you make "custom buttons"? like are you limited to the keys your pc has, or can you make like a "D2" as a custom key? this would be great, but will a game reconise it?

-does anti-cheat attach it? maby it wil thing of a tirdt party hack, or something.

-can you only do digital keys? like a throttle, can i controll that with a pot meter?

-can you send info from your pc to your arduino? game info like kills or something is gonna be hard, but like time, battery ets, i can put on a lcd

sorry for the bad english

2 Comments
2024/06/21
17:37 UTC

2

Water tank gauge

Hi everybody,

I'm trying to find the best way to measure the water level into a water tank. The tank is about 6 meters high. I was thinking to use a water pressure sensor.

Now, programming wise I have no big issue but I'm a bit stuck in selecting the right sensor, there are so many on aliexpress and I don't want to get the wrong one.

Would you help me in selecting one that's easly usable with an arduino uno?

Thank you!

4 Comments
2024/06/21
15:40 UTC

0

School project ideas

i have the stuff listed below

LCD screen (With everything required for it)
Servo motor (ALONG WITH SERVOS)
Jumper cables
Breadboard
Ultrasonic Sensor
Arduino UNO
Dot matrix displays
step motor
leds

ca you guys suggest me any eco-friendly science projects that are sustainable.

1 Comment
2024/06/21
13:33 UTC

3

Could this accelerometer shortcut work for my application?

I am making a removable G-meter for my car (a dot that moves around in a circle depending on the cars lateral or longitudinal acceleration). I want to be able to "zero out" the accelerometer to home the dot to the center of the circle with a push of a button. I have found information about doing this and it involves multiple accelerometers and calculating the angle between them. Instead of doing this, could I just subtract the values at rest from the read values of the accelerometer? I'm thinking I can because the accelerometer will always be mounted right side up +/-5° and only measuring acceleration up to 1G. So nothing close to the limits of the accelerometer. Also I am using an Adafruit LIS3DH meter

3 Comments
2024/06/21
18:41 UTC

50

Arduino piano!!

Also performed intro of metallica-one on it!

7 Comments
2024/06/21
16:44 UTC

7

Do I need to build a dedicated 5v supply leg for sensors?

A bit of background - I am calculating the active and standby power consumption for my project. My calculations show that if I isolate off a few sensors (Cell board, AQI, and MQ bank), the MCU can handle supplying power to the rest because the remaining total active power consumption is in the uA range.

The PMS7003 AQI sensor I have requires 100mA during when it's active, which even with my Mega, that's apparently a no-no. My M2560 powered it just fine, but that was the only thing I had hooked up to the MCU.

I still have some boards to add in to the calculation, but so far, I'm figuring it's safer to set up an isolated 5v leg for the sensors that have higher current requirements.

I have a 5V / 3A supply that is coming from the power supply that powers the MCU. I could simply split the power at the output and have an entire 5v leg with plenty left to power the arduino. Is this an approach that makes sense? Am I missing something along the way in my thinking?

1 Comment
2024/06/21
16:19 UTC

2

ESP32C3 boards can't connect to wifi when plugged into a breadboard, but can when not plugged into a breadboard?

This is a new one for me. I've got a bunch of ESP32C3 "supermini" dev boards that struggle to connect to wifi when they're plugged into a breadboard. They just sit there blinking for minutes, never connecting.

But if I remove them from the breadboard and power them on again, they all connect within seconds.

I've tried different breadboards, from cheap chinese little tiny ones to a massive Radioshack branded one. Same effect on all of them.

This is really frustrating because I use breadboards to prototype - is there any kind of Arduino code or setting I could choose to prevent this?

EDIT: Apparently this issue only occurs when using a USB battery bank, but not wall power. Again regardless of which USB power bank lol. I tried adding a capacitor, that didn't help, I don't think it's a current issue I think it's a grounding issue.

EDIT2: Fixed with WiFi.setTxPower(WIFI_POWER_8_5dBm);

2 Comments
2024/06/21
15:09 UTC

1

A actually good semi drop in replacement for the tp4056

I'm making a project involving 3 3200mah batteries connected in parallel and a tp4056. But this kinda sucks. The mosfet can't handle the Amps I need to draw and it only charges for 1A/hr so charging will be slower than it takes to die. Is there any alternatives that have 2A/hr charging, built in OUT pins and USB-C or will I have to go about the route of a ip2312/tp5100, usb breakout board and load sharing?

2 Comments
2024/06/21
14:49 UTC

8

0.1 uF capacitors

I'm looking to buy some capacitors for future projects, but I have the option to get a 0.1 uF capacitors either 50 V or 100V . Should I just buy the 100 V one and use it for all projects ( that require less than and equal to 100 V 0.1 uF capacitors) ?

9 Comments
2024/06/21
13:39 UTC

0

How do I stop the Green LED from blinking and keep the Red LED and the Buzzer from turning on and off repeatedly?

if (isnan(Temperature)){
    Blynk.logEvent("dht_sensor_disconnected");
    digitalWrite(redPin, HIGH);
    digitalWrite(buzzerPin, HIGH);
    digitalWrite(greenPin, LOW);
    delay(100);
    digitalWrite(buzzerPin, LOW);
    delay(100);
    digitalWrite(buzzerPin, HIGH);
    delay(100);
  } else {
    digitalWrite(buzzerPin, LOW);
    digitalWrite(redPin, LOW);
    digitalWrite(greenPin, HIGH);
  }
10 Comments
2024/06/21
12:05 UTC

1

Buck converter in parallel to achieve 2x current

Hello, I use the attached 5v 3.4a buck converters to convert 12v from a car battery to 5v for use with ws2812b lights.

I was wondering if i can attach two of these into a single setup, where cable from the car battery powers two of them, and their output cables are combined to achieve 6.8a?

These buck converters seem to have qc2 qc3 dcp bc12 standards in out...

3 Comments
2024/06/21
10:20 UTC

1

Need help with an error

Sketch uses 3350 bytes (10%) of program storage space. Maximum is 32256 bytes.

Global variables use 232 bytes (11%) of dynamic memory, leaving 1816 bytes for local variables. Maximum is 2048 bytes.

Failed uploading: cannot execute upload tool: exec: "{runtime.tools.avrdude.path}/bin/avrdude": file does not exist

This happened this morning. Yesterday it was running just fine. although after that I installed cs2 and then it stopped running. could it be a problem with that?

3 Comments
2024/06/21
09:55 UTC

3

multi PID control and value integration

Hello redditors,

I am working on a thesis, and without going into detail, I have 2 pumping systems that push a liquid against each other into a single tube, with flow meters analyzing the flow in the 2 branches. I need to implement a PID feedback control for both pump systems. Additionally, I need the program to calculate the quantity of fluid that has passed through the sensor, for which I need to calculate the time elapsed between readings. I had implemented a DIY PID control but it is not very efficient. ChatGPT generated this pseudo code for me, but does anyone have any advice? Which library do you recommend?

here the system

PS. my doubt is that myPID1 and myPID2 can run simultaneously without interfere eachother

include <PID_v1.h>

double Setpoint1 = 100.0;

double Input1 = 0.0;

double Output1 = 0.0;

double Kp1 = 2.0;

double Ki1 = 5.0;

double Kd1 = 1.0;

PID myPID1(&Input1, &Output1, &Setpoint1, Kp1, Ki1, Kd1, DIRECT);

double Setpoint2 = 200.0;

double Input2 = 0.0;

double Output2 = 0.0;

double Kp2 = 1.0;

double Ki2 = 2.0;

double Kd2 = 0.5;

PID myPID2(&Input2, &Output2, &Setpoint2, Kp2, Ki2, Kd2, DIRECT);

void setup() {

// Initialization

Serial.begin(9600);

myPID1.SetMode(AUTOMATIC);

myPID2.SetMode(AUTOMATIC);

}

void loop() {

// Simulating a control process

Input1 = analogRead(A0); // Reading an analog value as input for PID1

Input2 = analogRead(A1); // Reading an analog value as input for PID2

myPID1.Compute(); // Computing PID1

myPID2.Compute(); // Computing PID2

analogWrite(9, Output1); // Applying PID1 output to a PWM pin

analogWrite(10, Output2); // Applying PID2 output to another PWM pin

// Outputting values for debugging

Serial.print("Input1: ");

Serial.print(Input1);

Serial.print(" - Output1: ");

Serial.print(Output1);

Serial.print(" | Input2: ");

Serial.print(Input2);

Serial.print(" - Output2: ");

Serial.println(Output2);

delay(100); // Delay to avoid overloading the CPU

}

7 Comments
2024/06/21
09:56 UTC

1

Pairing ESP32 Room-1 / ESP 32 wroom devDS3 to Playstation Console

Hi Guys, I tried to Connect/pair any esp32 or Raspberry Pi Zero w SBC to my Playstation console 3/4. It should be very complex and did Not found solution for this.

Anyone with experience here with knowledge about my Project?

Also i would be happy to replace my analog right thumbstick with a Mouse. I need for this an Mouse digital to analog D/A changer. Is that possible with an additional arduino mcu?

0 Comments
2024/06/21
08:16 UTC

1

EEG sensor for mood/feeling classification

Hi, I would like to collect EEG signals to classify mood or feeling among subjects when they are introduced to different reading materials for my research. May I know if there are any products out there or if I can build one with arduino? Any lead would be appreciated.. Thank you!

2 Comments
2024/06/21
07:09 UTC

0

Question on SWDIO pin

I recently purchased a solar charger controller for my arduino project from amazon: https://www.amazon.com/dp/B0CT7TG2WF If you follow the link and look at the bottom of the board, it has an area for a ground and an SWDIO pinout to solder in there. I didn't find a lot of information on the internet or on Wonrabai - Waveshare's site for specs or a data sheet.

My actual question is, if I soldered in the pins for the SWDIO pins, how would I be able to interface this with my M2560? Since my understanding is SWDIO is a bi-directional single pin signal. I downloaded a few debugging tools to try once I solder those pins in.4

Thanks in advance for any info you can provide.

  • JIW
4 Comments
2024/06/21
04:19 UTC

1

Need Help Setting Fuses on Genuine Arduino Nano

Trying to use the adafruit USBtinyISP programmer to set the fuses on a genuine arduino nano.

I put together the programmer, its recognized by windows, got the drivers --> no problem.

Plugged in my nano via the 6 pin cable and used the nano preset in avrdudess.

Hit detect to see if it can see it and I am continually getting the

avrdude error: initialization failed, rc=-1

  • double check the connections and try again
  • use -B to set lower the bit clock frequency, e.g. -B 125kHz
  • use -F to override this check

I've now tried every possible configuration, re-worked the solder joints, tried with the jumper connected...same error every time.

The arduino is not dead in order to confirm I used the usb to program and powers on and uploads no problem.

WHAT AM I DOING WRONG?

I am at my wits end please someone explain what I'm not seeing any resources online which address whatever piece I am too new to the hobby to know.

Someone please save me :(

5 Comments
2024/06/21
02:17 UTC

2

New to this kind of stuff looking for help

I want to use an Arduino to control my led light strips using the Bluetooth to connect the Arduino to my lights. The lights have Bluetooth and do have apps but i have different brands and wanted to use this to make something to turn them on at the same time from one place.

1 Comment
2024/06/21
01:41 UTC

2

How to read ammonia from water ?

ISE (Ion Selective Electrode) sensors for ammonia are so expensive so I was searching for a way to detect and measure ammonia levels from water (fish feed and organic waste) using an MQ135 or MQ137.

If there's anybody who did a similar project before, pls let me know if its ok to reach out.

2 Comments
2024/06/21
00:34 UTC

6

How would you get sensor data from an arduino to an online dashboard / website?

So im in a weird stage in learning:

-I can make a website

-I can program my arduino

No damn clue on how i connect the output of my arduino ini file to an input on my website / dashboard.

I want to display temperature data in real time on the website dashboard.

I think I need to use something like Django to create a server and then use my arduino R4 wifi to pass that data to the server?

Then is it as simple as saving the sensor data as a variable and using some JS to change the display?

I would appreciate guidance, im rather new and its confusing. I dont want to use the arduino dashboard, and they dont work at my school wifi (im a teacher).

13 Comments
2024/06/20
22:45 UTC

1

Reflective LCDs (with backlight) compatable with arduinos

I am working on a battery powered radio centered around the Si4735 and would like to use a LCD in order to display the relevant information to the user, are there any good reflective lcds that have a backlight and also have easy to use arduino libraries, such as how the lcd I have (not a reflective) uses the liquidcrystal arduino library?

I would prefer a 16x2 but a 20x4 would also be perfectly usable.

2 Comments
2024/06/20
21:51 UTC

Back To Top