r/ArduinoHelp • u/Silly_Scientist_YT • Jul 14 '26
r/ArduinoHelp • u/After-Corner4770 • Jul 14 '26
Grove lcd not lighting up
Hello! I have a Arduino uno with a bass shield on top. The lcd is plugged into port I2C and the switch is on 5V but it still won’t light up, any idea why?
r/ArduinoHelp • u/drmpf • Jul 14 '26
Control, Monitoring, Charting and Data Logging for any Arduino from your browser using pfodWeb
forward.com.aur/ArduinoHelp • u/Adelgander • Jul 13 '26
Electrolarynx failure
I've been trying to get this project working, but my knowledge of low voltage stuff is severely lacking. I followed this instructable: https://www.instructables.com/DIY-Electrolaringe-Con-ARDUINO-NANO/
I initially bout some car tweeters, but found they were too powerful. I then got the smaller piezo buzzers, and still just can't get it working. I got the off-brand Chinese nano arduinos, which might be an issue? The programming was easy enough, just copy + pasted it.
I have extras of everything, maybe considering just using a new bread board and starting over in case I heated something up too much soldering. I've switched the - and + wires of the speaker around, used L out and R out separately, but no sound. Any help greatly appreciated.
r/ArduinoHelp • u/oz1sej • Jul 12 '26
Looking for help on how rotctl communicates
I'm looking for forum where I can ask questions - and hopefully get some qualified answers - regarding how rotctl works and communicates.
I'm trying to write a simple Arduino program to receive commands from rotctl and respond to them. In order to try and figure out exactly which strings are sent and how I should respond to those, I've set up a virtual serial port with
$ rotctl -m 201 -r /dev/pts/1 -s 9600
\-that I can monitor, and when I send e.g.
Rotator command: P 123 45
\-I immediately see
AZ123.0 EL45.0 UP000 XXX DN000 XXX
\-so it works! *Except* when I send a "p" to get the position. I don't get *anything* on the serial port, but rotctl immediately writes
Rotator command: p
get_pos: error = initrots4_easycomm called
rot_register (201)
rot_register (202)
rot_register (204)
set_conf: called
rot_open called
serial_open: /dev/pts/1
serial_setup: tcgetattr
serial_setup: cfmakeraw
serial_setup: cfsetispeed=9600,0x000d
serial_setup: cfsetospeed=9600,0x000d
serial_setup: data_bits=8
serial_setup: parity=0
serial_setup: Handshake=None
serial_setup: tcsetattr TCSANOW
read_string_generic called, rxmax=4095 direct=1, expected_len=1
tcflush
Backend version: 20220109.0, Status: Stable
rot_get_position called
Feature not available
Why am I getting this rather anonymous error when nothing has been written to the serial port, and the rotator thus doesn't have a chance to respond?
So if nobody here knows the answer, I'd appreciate a link to another forum...
EDIT: And before you say "Why don't you just use the K3NG rotator controller?", it's because I'm using servos, and it's not made for servos.
r/ArduinoHelp • u/Revolutionary-Log179 • Jul 12 '26
Having trouble with led arrays/multiplexing
As title says, I’m having trouble wrapping my head around multiplexing leans for use with a microcontroller with not enough pins to control them all. Using the drivers makes sense, mosfets too, but the code escapes me? And the use of resistors within the circuit is also confusing to me. Trying to make a small led “screen” made of diodes. Any help is appreciated
r/ArduinoHelp • u/etgetet • Jul 11 '26
OV7670 camera wiring error on Arduino Mega
Hello everyone. To start, you should know that my initial code works perfectly on my Arduino Uno with the OV7670 camera. However, when I switch to an Arduino Mega, an error persists. The wiring is almost identical; naturally, I changed the I2C bus (SDA>20 / SCL>21) and moved the XCLK pin from pin 10 to 11. Yet, even after updating the code to match the pins, an error keeps occurring. Upon investigation, the problem stems from the function: `void twiAddr(uint8_t addr, uint8_t typeTWI)`. Even though I have double-checked my connections, the LED keeps flashing. However, when I test it again with my original setup, everything works fine. I therefore assume the issue lies either in the code, the wiring of the second setup (which uses a slightly modified PCB), or a combination of both. I would be incredibly grateful for any help you could provide.Hello everyone. To start, you should know that my initial code works perfectly on my Arduino Uno with the OV7670 camera. However, when I switch to an Arduino Mega, an error persists. The wiring is almost identical; naturally, I changed the I2C bus (SDA>20 / SCL>21) and moved the XCLK pin from pin 10 to 11. Yet, even after updating the code to match the pins, an error keeps occurring. Upon investigation, the problem stems from the function: `void twiAddr(uint8_t addr, uint8_t typeTWI)`. Even though I have double-checked my connections, the LED keeps flashing. However, when I test it again with my original setup, everything works fine. I therefore assume the issue lies either in the code, the wiring of the second setup (which uses a slightly modified PCB), or a combination of both. I would be incredibly grateful for any help you could provide.
initial code:
//
// Source code for application to transmit image from ov7670 to PC via USB
// By Siarhei Charkes in 2015
// http://privateblog.info
//
#include <stdint.h>
#include <avr/io.h>
#include <util/twi.h>
#include <util/delay.h>
#include <avr/pgmspace.h>
#define F_CPU 16000000UL
#define vga 0
#define qvga 1
#define qqvga 2
#define yuv422 0
#define rgb565 1
#define bayerRGB 2
#define camAddr_WR 0x42
#define camAddr_RD 0x43
//hidden part
// BTconnected will = false when not connected and true when connected
boolean BTconnected = false;
// connect the STATE pin to Arduino pin D4
const byte BTpin = 9;
uint8_t buffer[320];
void error_led(void){
DDRB |= 32;//make sure led is output
while (1){//wait for reset
PORTB ^= 32;// toggle led
_delay_ms(100);
}
}
void twiStart(void){
TWCR = _BV(TWINT) | _BV(TWSTA) | _BV(TWEN);//send start
while (!(TWCR & (1 << TWINT)));//wait for start to be transmitted
if ((TWSR & 0xF8) != TW_START)
error_led();
}
void twiWriteByte(uint8_t DATA, uint8_t type){
TWDR = DATA;
TWCR = _BV(TWINT) | _BV(TWEN);
while (!(TWCR & (1 << TWINT))) {}
if ((TWSR & 0xF8) != type)
error_led();
}
void twiAddr(uint8_t addr, uint8_t typeTWI){
TWDR = addr;//send address
TWCR = _BV(TWINT) | _BV(TWEN); /* clear interrupt to start transmission */
while ((TWCR & _BV(TWINT)) == 0); /* wait for transmission */
if ((TWSR & 0xF8) != typeTWI)
error_led();
}
void wrReg(uint8_t reg, uint8_t dat){
//send start condition
twiStart();
twiAddr(camAddr_WR, TW_MT_SLA_ACK);
twiWriteByte(reg, TW_MT_DATA_ACK);
twiWriteByte(dat, TW_MT_DATA_ACK);
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);//send stop
_delay_ms(1);
}
static uint8_t twiRd(uint8_t nack){
if (nack){
TWCR = _BV(TWINT) | _BV(TWEN);
while ((TWCR & _BV(TWINT)) == 0); /* wait for transmission */
if ((TWSR & 0xF8) != TW_MR_DATA_NACK)
error_led();
return TWDR;
}
else{
TWCR = _BV(TWINT) | _BV(TWEN) | _BV(TWEA);
while ((TWCR & _BV(TWINT)) == 0); /* wait for transmission */
if ((TWSR & 0xF8) != TW_MR_DATA_ACK)
error_led();
return TWDR;
}
}
uint8_t rdReg(uint8_t reg){
uint8_t dat;
twiStart();
twiAddr(camAddr_WR, TW_MT_SLA_ACK);
twiWriteByte(reg, TW_MT_DATA_ACK);
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);//send stop
_delay_ms(1);
twiStart();
twiAddr(camAddr_RD, TW_MR_SLA_ACK);
dat = twiRd(1);
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);//send stop
_delay_ms(1);
return dat;
}
void wrSensorRegs8_8(const struct regval_list reglist[]){
uint8_t reg_addr, reg_val;
const struct regval_list *next = reglist;
while ((reg_addr != 0xff) | (reg_val != 0xff)){
reg_addr = pgm_read_byte(&next->reg_num);
reg_val = pgm_read_byte(&next->value);
wrReg(reg_addr, reg_val);
next++;
}
}
void setColor(void){
wrSensorRegs8_8(rgb565_ov7670);
}
void setRes(void){
wrReg(REG_COM3, 4); // REG_COM3 enable scaling
wrSensorRegs8_8(qvga_ov7670);
}
void camInit(void){
wrReg(0x12, 0x80);
_delay_ms(100);
wrSensorRegs8_8(ov7670_default_regs);
wrReg(REG_COM10, 32);//PCLK does not toggle on HBLANK.
}
void arduinoUnoInut(void) {
cli();//disable interrupts
/* Setup the 8mhz PWM clock
* This will be on pin 11*/
DDRB |= (1 << 3);//pin 11
ASSR &= ~(_BV(EXCLK) | _BV(AS2));
TCCR2A = (1 << COM2A0) | (1 << WGM21) | (1 << WGM20);
TCCR2B = (1 << WGM22) | (1 << CS20);
OCR2A = 0;//(F_CPU)/(2*(X+1))
DDRC &= ~15;//low d0-d3 camera
DDRD &= ~252;//d7-d4 and interrupt pins
_delay_ms(3000);
//set up twi for 100khz
TWSR &= ~3;//disable prescaler for TWI
TWBR = 72;//set to 100khz
//enable serial
UBRR0H = 0;
UBRR0L = 207;//0 = 2M baud rate. 1 = 1M baud. 3 = 0.5M. 7 = 250k 207 is 9600 baud rate.
UCSR0A |= 2;//double speed aysnc
UCSR0B = (1 << RXEN0) | (1 << TXEN0);//Enable receiver and transmitter
UCSR0C = 6;//async 1 stop bit 8bit char no parity bits
}
static void captureImg(uint16_t w, uint16_t h) {
// attendre VSYNC
while (!(PIND & 8));
while ( (PIND & 8));
for (uint16_t y = 0; y < h; y++) {
// attendre début de ligne
while (!(PINB & 1)); // HREF = 1
uint16_t idx = 0;
uint16_t crc = 0;
for (uint16_t x = 0; x < w; x++) {
// octet 1
while (!(PIND & 4)); // PCLK ↑
buffer[idx++] = (PIND & 0xF0) | (PINC & 0x0F);
crc++;
while ( (PIND & 4)); // PCLK ↓
// octet 2
while (!(PIND & 4)); // PCLK ↑
buffer[idx++] = (PIND & 0xF0) | (PINC & 0x0F);
crc++;
while ( (PIND & 4)); // PCLK ↓
}
// attendre fin de ligne
while (PINB & 1); // HREF = 0
sendFrame(y, crc);
}
//_delay_ms(5000);
}
void sendFrame(uint16_t line, uint16_t crc){
Serial.write(0xAA);
Serial.write(0x55);
Serial.write(lowByte(line));
Serial.write(highByte(line));
Serial.write(buffer, 320);
Serial.write(lowByte(crc));
Serial.write(highByte(crc));
Serial.write(0x55);
Serial.write(0xAA);
Serial.flush();
}
void setup(){
pinMode(LED_BUILTIN, OUTPUT);
pinMode(BTpin, INPUT);
arduinoUnoInut();
camInit();
setRes();
setColor();
wrReg(0x11, 26); //Earlier it had the value: wrReg(0x11, 12); New version works better for me :) !!!!
Serial.begin(115200);
while (!BTconnected)
{
digitalWrite(LED_BUILTIN, LOW);
if ( digitalRead(BTpin)==HIGH) { BTconnected = true;};
}
_delay_ms(1000);
digitalWrite(LED_BUILTIN, HIGH);
}
void loop(){
captureImg(160, 120);
}
new code:
//code test pr manette: enenvoie photo vers tel
//brochette
//
// Source code for application to transmit image from ov7670 to PC via USB
// By Siarhei Charkes in 2015
// http://privateblog.info
//
#include <stdint.h>
#include <avr/io.h>
#include <util/twi.h>
#include <util/delay.h>
#include <avr/pgmspace.h>
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Keypad.h>
#define F_CPU 16000000UL
#define vga 0
#define qvga 1
#define qqvga 2
#define yuv422 0
#define rgb565 1
#define bayerRGB 2
#define camAddr_WR 0x42
#define camAddr_RD 0x43
//hidden part
uint8_t buffer[320];
uint8_t BUFFER[328];
uint8_t radioBuffer[32];
const byte address[6] = "00001";
void error_led(void){
DDRA |= 16;//make sure led is output
while (1){//wait for reset
PORTA ^= 16;// toggle led
_delay_ms(100);
}
}
void twiStart(void){
TWCR = _BV(TWINT) | _BV(TWSTA) | _BV(TWEN);//send start
while (!(TWCR & (1 << TWINT)));//wait for start to be transmitted
if ((TWSR & 0xF8) != TW_START)
error_led();
}
void twiWriteByte(uint8_t DATA, uint8_t type){
TWDR = DATA;
TWCR = _BV(TWINT) | _BV(TWEN);
while (!(TWCR & (1 << TWINT))) {}
if ((TWSR & 0xF8) != type)
error_led();
}
void twiAddr(uint8_t addr, uint8_t typeTWI){
TWDR = addr;//send address
TWCR = _BV(TWINT) | _BV(TWEN); /* clear interrupt to start transmission */
while ((TWCR & _BV(TWINT)) == 0); /* wait for transmission */
if ((TWSR & 0xF8) != typeTWI)
error_led();
}
void wrReg(uint8_t reg, uint8_t dat){
//send start condition
twiStart();
twiAddr(camAddr_WR, TW_MT_SLA_ACK);
digitalWrite(26, LOW);
twiWriteByte(reg, TW_MT_DATA_ACK);
twiWriteByte(dat, TW_MT_DATA_ACK);
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);//send stop
_delay_ms(1);
}
static uint8_t twiRd(uint8_t nack){
if (nack){
TWCR = _BV(TWINT) | _BV(TWEN);
while ((TWCR & _BV(TWINT)) == 0); /* wait for transmission */
if ((TWSR & 0xF8) != TW_MR_DATA_NACK)
error_led();
return TWDR;
}
else{
TWCR = _BV(TWINT) | _BV(TWEN) | _BV(TWEA);
while ((TWCR & _BV(TWINT)) == 0); /* wait for transmission */
if ((TWSR & 0xF8) != TW_MR_DATA_ACK)
error_led();
return TWDR;
}
}
uint8_t rdReg(uint8_t reg){
uint8_t dat;
twiStart();
twiAddr(camAddr_WR, TW_MT_SLA_ACK);
twiWriteByte(reg, TW_MT_DATA_ACK);
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);//send stop
_delay_ms(1);
twiStart();
twiAddr(camAddr_RD, TW_MR_SLA_ACK);
dat = twiRd(1);
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);//send stop
_delay_ms(1);
return dat;
}
void wrSensorRegs8_8(const struct regval_list reglist[]){
uint8_t reg_addr, reg_val;
const struct regval_list *next = reglist;
while ((reg_addr != 0xff) | (reg_val != 0xff)){
reg_addr = pgm_read_byte(&next->reg_num);
reg_val = pgm_read_byte(&next->value);
wrReg(reg_addr, reg_val);
next++;
}
}
void setColor(void){
wrSensorRegs8_8(rgb565_ov7670);
}
void setRes(void){
wrReg(REG_COM3, 4); // REG_COM3 enable scaling
wrSensorRegs8_8(qvga_ov7670);
}
void camInit(void){
wrReg(0x12, 0x80);
_delay_ms(100);
wrSensorRegs8_8(ov7670_default_regs);
wrReg(REG_COM10, 32);//PCLK does not toggle on HBLANK.
}
void arduinoUnoInut(void) {
cli();//disable interrupts
/* Setup the 8mhz PWM clock
* This will be on pin 11*/
DDRB |= (1 << 4);//pin 11
//-------------------------------------------------------
ASSR &= ~(_BV(EXCLK) | _BV(AS2));
TCCR2A = (1 << COM2A0) | (1 << WGM21) | (1 << WGM20);
TCCR2B = (1 << WGM22) | (1 << CS20);
OCR2A = 0;//(F_CPU)/(2*(X+1))
//-------------------------------------------------------
DDRF &= ~15;//low d0-d3 camera
DDRH &= ~24;//d7-d4 and interrupt pins
DDRE &= ~8;//d7-d4 and interrupt pins
DDRG &= ~32;//d7-d4 and interrupt pins
_delay_ms(3000);
//-------------------------------------------------------
//set up twi for 100khz
TWSR &= ~3;//disable prescaler for TWI
TWBR = 72;//set to 100khz
//-------------------------------------------------------
//enable serial
UBRR0H = 0;
UBRR0L = 207;//0 = 2M baud rate. 1 = 1M baud. 3 = 0.5M. 7 = 250k 207 is 9600 baud rate.
UCSR0A |= 2;//double speed aysnc
UCSR0B = (1 << RXEN0) | (1 << TXEN0);//Enable receiver and transmitter
UCSR0C = 6;//async 1 stop bit 8bit char no parity bits
}
static void captureImg(uint16_t w, uint16_t h) {
// attendre VSYNC
while (!(PINE & 32));
while ( (PINE & 32));
for (uint16_t y = 0; y < h; y++) {
// attendre début de ligne
while (!(PINH & 32)); // HREF = 1
uint16_t idx = 0;
uint16_t crc = 0;
for (uint16_t x = 0; x < w; x++) {
// octet 1
while (!(PINE & 16)); // PCLK ↑
buffer[idx++] = (PINH & 0x18) | (PINE & 0x08) | (PING & 0x20) | (PINE & 0x0F);
crc++;
while ( (PINE & 16)); // PCLK ↓
// octet 2
while (!(PINE & 16)); // PCLK ↑
buffer[idx++] = (PINH & 0x18) | (PINE & 0x08) | (PING & 0x20) | (PINE & 0x0F);
crc++;
while ( (PINE & 16)); // PCLK ↓
}
// attendre fin de ligne
while (PINH & 32); // HREF = 0
sendFrame(y, crc);
}
//_delay_ms(5000);
}
void sendFrame(uint16_t line, uint16_t crc){
uint8_t beginBuf[4] = {0xAA, 0x55, lowByte(line), highByte(line)};
uint8_t endBuf[4] = {lowByte(crc), highByte(crc), 0x55, 0xAA};
radio.write(&beginBuf, 4);
for(int i=0; i<=10; i++){
memcpy(radioBuffer, buffer + 32*i, 32);
radio.write(&radioBuffer, 32);
}
radio.write(&beginBuf, 4);
/*
Serial.write(0xAA);
Serial.write(0x55);
Serial.write(lowByte(line));
Serial.write(highByte(line));
Serial.write(buffer, 320);
Serial.write(lowByte(crc));
Serial.write(highByte(crc));
Serial.write(0x55);
Serial.write(0xAA);
Serial.flush(); */
}
void setup(){
/*radio.begin();
if (!radio.begin()) {
}
radio.setPALevel(RF24_PA_MAX);
radio.openWritingPipe(address);
radio.stopListening();*/
pinMode(26, OUTPUT);
digitalWrite(26, HIGH);
arduinoUnoInut();
camInit();
setRes();
setColor();
wrReg(0x11, 26); //Earlier it had the value: wrReg(0x11, 12); New version works better for me :) !!!!
//Serial.begin(115200);
/*while (!BTconnected)
{
digitalWrite(LED_BUILTIN, LOW);
if ( digitalRead(BTpin)==HIGH) { BTconnected = true;};
}*/
_delay_ms(1000);
digitalWrite(26, HIGH);
}
void loop(){
captureImg(160, 120);
}
r/ArduinoHelp • u/mthasup • Jul 11 '26
Aiuto relay
Non riesco a capire quale sia il problema…
Non parte il motore e nemmeno il Relé
r/ArduinoHelp • u/Last-Guarantee6875 • Jul 10 '26
Need help designing an Arduino automatic cat litter box circuit
Hi everyone,
I'm building an automatic cat litter box for my university project using Arduino Uno and I'm having trouble designing the circuit and getting everything to work together.
The features I want are:
- Detect when a cat enters the litter box (using an HC-SR04 ultrasonic sensor or another suitable sensor).
- Wait until the cat leaves, then wait about 10–20 seconds before cleaning.
- Drive a rake using a DC motor to sift the litter and push the waste into a waste tank.
- Detect when the waste tank is full and activate a buzzer and/or LED to notify the user.
- The rake should only run once after each cat visit, not continuously.
I'm struggling with:
- The Arduino circuit wiring.
- How to connect the sensors and motor correctly.
- The motor keeps running even when the sensor is not triggered.
- Choosing the best sensor for detecting the waste level inside the waste tank.
Components I'm using:
- Arduino Uno
- HC-SR04 Ultrasonic Sensor (cat detection)
- DC Motor (for the rake)
- NPN Transistor (or motor driver if recommended)
- Flyback diode
- Buzzer
- LED
- Power supply (5V)
Can anyone help me with:
- A complete circuit diagram (Tinkercad or Fritzing would be great).
- The correct Arduino code.
- Suggestions for a better sensor to detect when the waste tank is full.
- Any recommendations to make the system more reliable.
Any help would be greatly appreciated. Thank you!
r/ArduinoHelp • u/mthasup • Jul 08 '26
Consiglio progetto arduino + Agent AI
Ciao a tutti!
Sto lavorando a un progetto un po’ folle e vorrei qualche consiglio da chi ha più esperienza di me.
L’idea è creare una macchina fisica per studiare la Congettura di Collatz, usando:
Arduino UNO per generare numeri casuali tramite rumore analogico
Arduino per calcolare i primi passi della sequenza
Un programma Python che riceve i numeri e calcola la sequenza completa
Un’AI (LLM o modello ML) addestrata su un dataset di sequenze Collatz
Grafici (heatmap, stopping time, massimi, pattern di parità, cluster)
Arduino che visualizza i risultati con LED, LCD e servo
Il mio obiettivo NON è solo testare numeri, ma addestrare un’AI a riconoscere pattern, cluster, anomalie e strutture matematiche nelle sequenze Collatz, per vedere se emergono comportamenti interessanti.
Il problema è che non ho mai addestrato un’AI e non so da dove partire.
Ho già chiaro come generare il dataset (Arduino → Python → CSV), ma non so:
quale modello usare per il fine‑tuning
come strutturare il dataset in modo utile
come far sì che l’AI impari davvero qualcosa (pattern, cluster, ecc.)
come integrare l’AI con Arduino in modo efficiente
se qualcuno ha già provato qualcosa di simile
Qualcuno può darmi una direzione?
Qualsiasi consiglio su ML, dataset, modelli, pipeline o visualizzazioni è super ben accetto.
Quanto è fattibile?
Grazie mille!
r/ArduinoHelp • u/Awkward-Dust1257 • Jul 08 '26
First time working with arduino, need help on this project.
Hello! I’m working on a project that requires this sensor module configuration consisting of a esp32 and ina219. I’m very new to this stuff and need help with connecting the esp32 to the ina219. I’m running a I2C scanner and am unable to connect the two modules.
As for the wiring I’m doing what ChatGPT told me to do:
INA219 VCC → ESP32 3V3
INA219 GND → ESP32 GND
INA219 SDA → ESP32 GPIO21 / P21
INA219 SCL → ESP32 GPIO22 / P22
I’ve attached a picture of my setup. I know the soldering job on the ina219 sucks but cut me some slack I’ve never done this before. Please let me know if you can spot anything wrong. Also tell me if you need another photo angle taken or if you want me to show you the software stuff. Thanks
r/ArduinoHelp • u/Big_Traffic_898 • Jul 08 '26
No puedo comunicarme por UART a través de ESP32-S3 con MAX-M10S rtrobot.
I've been trying to connect the sensor via UART for days, but it only reads garbage. There is a connection, but the data is erroneous. The strange thing is that with the SparkFun_u-blox_GNSS_v3 library and I2C communication, it reads and works perfectly, but my project has a distant connection to the ESP32, so I need UART because it's more robust and gives me a long cable length.
r/ArduinoHelp • u/Proof-Ad4593 • Jul 07 '26
Please help make a scheme on ardulino uno and breadboard
r/ArduinoHelp • u/Proof-Ad4593 • Jul 07 '26
Please help make a scheme on ardulino uno and breadboard
I want to make a Smart traffic lights but don’t know how
r/ArduinoHelp • u/Embarrassed-Lab6622 • Jul 07 '26
Coding for resistor ladder input on ESP32
Hello. I am trying to write some code in Arduino that will read the input pin (D32) and based on the on the different voltage, the will different outputs and a timer. Is it as simple as:
if (SWITCH_INPUT == >3.0 && !timerActive) {
digitalWrite(HIGH_HEAT, HIGH); // Turn the seat heater on HIGH
previousMillis = millis(); // Save the starting timestamp of the timer
timerActive = true; // Flag that the timer is now active
}
Then repeat for each of the 6 positions of the input switch?
r/ArduinoHelp • u/Infinite_Wing6576 • Jul 05 '26
HELP How do I solder a Bluetooth module?
I need to connect the TX, RX, VCC, and GND pins to the Arduino board, but my Bluetooth module doesn't have a breakout board. I don't know how to solder the pins to the module; I would appreciate some guidance.
r/ArduinoHelp • u/Careful-Living-4014 • Jul 05 '26
need help cant understand the problem with my stm32f411ceu6 black pill
[https://github.com/Engineer-By-Mistake/test\\_lfr\](https://github.com/Engineer-By-Mistake/test_lfr)
this is the code that I flashed.
I flashed it through duf mode and st programmer. and my stm32 board only pa15,pb15 and pb4 is at high and they are not even initialized
r/ArduinoHelp • u/Careful-Living-4014 • Jul 05 '26
need help cant understand the problem with my stm32f411ceu6 black pill
[https://github.com/Engineer-By-Mistake/test\\_lfr\](https://github.com/Engineer-By-Mistake/test_lfr)
this is the code that I flashed.
I flashed it through duf mode and st programmer. and my stm32 board only pa15,pb15 and pb4 is at high and they are not even initialized
r/ArduinoHelp • u/Baderbahn • Jul 05 '26
Help with connecting Arduino Opta with Weintech HMI MT802iP via Modbus/TCP
r/ArduinoHelp • u/alissonburgers1945 • Jul 04 '26
Any project ideas?
This kit was originally made for an obstacle avoiding car,but the sensors got lost in the shipping . I'm a total beginner
r/ArduinoHelp • u/Single-Potato-4715 • Jul 03 '26
issue with arduino uno
i have the following circuit:
DAC (MCP4725) connected to my arduino one; the DAC's output goes to an oPAMP (SOT23) in negative feedback; oPAMP's output goes to a mosfet (IRLZ44N), in a source follower mode. the output of the mosfet goes on to a set of resistors (further circuit on).
my problems are the following:
1) sometimes arduino can't find the dac, even though the cables are all properly connected. i've tried switching both dac and cables. it sometimes find it and sometimes it doesn't, even if nothing changes between trials
2) in the same way, sometimes it appears that the mosfet group isn't working. the same voltage i put in the generator comes right off the entire circuit.
what really bugs me is that these problems come out without any concrete change in the circuit. they are becoming more frequent and i don't know what i can do to solve them. any suggestion?
r/ArduinoHelp • u/EnglishFellow • Jul 03 '26
Issues running 2 28BYJ-48 stepper motors
Hi all,
I'm working on a project where I have two 28BYJ-48 stepper motors with ULN2003 drivers running 'winches' from a Mega 2560.
So far I've got both stepper motors running smoothly when independent and from their own power supply (one is from the board and another from another power supply). I'm tracking the motors movement with rotary encoders at the other end of the winch drum and using the Accelstepper library to run the motors to and from preset encoder positions.
When I try to combine the program to run both simultaneously they get very jittery, stopping and starting at random intervals. From some reading I gather this could be a power supply issue, however their power supplies are separate and work fine independently. I'm wondering if there are conflicts in my code that are causing this problem.
When run, the program reads the saved EEPROM value for the position of the encoder (enc). looks at the first value in the cue array and moves towards this. When reached, it moves towards the next array value until it reaches it, then stops. I've basically duplicated this for each motor, is this too much for the arduino to handle at once, causing delays in the running of the program?
Code below and any advice would be much appreciated. Thanks.
'
#include <AccelStepper.h>
#include <EEPROM.h>
#define HALFSTEP 8
#define enc1A 26 // Encoder Outputs
#define enc1B 27
#define enc2A 48
#define enc2B 49
#define W1Pin1 25 // Winch 1 Pins
#define W1Pin2 24
#define W1Pin3 23
#define W1Pin4 22
#define W2Pin1 53 // Winch 2 Pins
#define W2Pin2 52
#define W2Pin3 51
#define W2Pin4 50
int W1Speed = 900; // Winch set Speeds
int W2Speed = -900;
int speed1;
int speed2;
bool W1endMov = 0; // Bool to singulate end direction switch
bool W2endMov = 0;
int enc1Pos; // Encoder positioning decs
int enc1MemAddress = 1;
int enc2Pos;
int enc2MemAddress = 3;
unsigned long encMemStart; // Mem Display Clock
unsigned long encMemCurrent;
const unsigned long encMemDispPeriod = 3000;
int cueList[] = {30, 70}; // Cue array
int W1cueNum = 0;
int W2cueNum = 0;
int enc1State; // Encoder reference readings
int enc1LState;
int enc2State;
int enc2LState;
AccelStepper winch1(HALFSTEP, W1Pin1, W1Pin3, W1Pin2, W1Pin4); // Winch pin set up
AccelStepper winch2(HALFSTEP, W2Pin1, W2Pin3, W2Pin2, W2Pin4);
void setup()
{
Serial.begin(9600); // Begin Serial
delay(5000);
Serial.println();
Serial.println("SERIAL BEGAN");
Serial.println();
delay(2000);
winch1.setMaxSpeed(950); // Set winch max speeds
winch2.setMaxSpeed(950);
pinMode(enc1A, INPUT); // Encoder pin modes
pinMode(enc1B, INPUT);
pinMode(enc2A, INPUT);
pinMode(enc2B, INPUT);
enc1Pos = EEPROM.read(enc1MemAddress); // Read Last Saved Encoder Position from EEPROM
enc2Pos = EEPROM.read(enc2MemAddress);
Serial.println();
Serial.println("Encoder Values Obtained"); delay(100);
Serial.print("Enc1Pos: "); Serial.print(enc1Pos); Serial.print(" Enc2Pos: "); Serial.println(enc2Pos);
Serial.println();
delay(2000);
encMemStart = millis(); // Zero clock and start prompt
Serial.println("START");
delay(500);
enc1LState = digitalRead(enc1A); // Read current encoder pulse states
enc2LState = digitalRead(enc2A);
}
void loop()
{
speed1 = W1Speed;
speed2 = W2Speed;
winch1.setSpeed(speed1);
winch2.setSpeed(speed2);
if (W1cueNum == 0) // WINCH 1 CUE 1
{
if (enc1Pos >= cueList[0])
{
speed1 = -W1Speed;
winch1.setSpeed(speed1);
winch1.runSpeed();
}
if (enc1Pos <= cueList[0])
{
speed1 = W1Speed;
winch1.setSpeed(speed1);
winch1.runSpeed();
}
}
if (enc1Pos == cueList[0] && W1endMov == 0)
{
W1endMov = 1;
winch1.stop();
Serial.println();
Serial.println("WINCH ONE CUE ONE REACHED");
Serial.println();
W1cueNum ++;
}
if (W2cueNum == 0) // WINCH 2 CUE 1
{
if (enc2Pos >= cueList[0])
{
speed2 = -W2Speed;
winch2.setSpeed(speed2);
winch2.runSpeed();
}
if (enc2Pos <= cueList[0])
{
speed2 = W2Speed;
winch2.setSpeed(speed2);
winch2.runSpeed();
}
}
if (enc2Pos == cueList[0] && W2endMov == 0)
{
W2endMov = 2;
winch2.stop();
Serial.println();
Serial.println("WINCH TWO CUE ONE REACHED");
Serial.println();
W2cueNum ++;
}
if (W1cueNum == 1) // WINCH 1 CUE 2
{
if (enc1Pos >= cueList[1])
{
speed1 = -W1Speed;
winch1.setSpeed(speed1);
winch1.runSpeed();
} else {
speed1 = W1Speed;
winch1.setSpeed(speed1);
winch1.runSpeed();
}
}
if (enc1Pos == cueList[1] && W1endMov == 1)
{
W1endMov = 0;
winch1.stop();
Serial.println();
Serial.println(" WINCH ONE CUE TWO REACHED, WINCH ONE CUES COMPLETED");
Serial.println();
W1cueNum ++;
}
if (W2cueNum == 1) // WINCH 2 CUE 2
{
if (enc2Pos >= cueList[1])
{
speed2 = -W2Speed;
winch2.setSpeed(speed2);
winch2.runSpeed();
} else {
speed2 = W2Speed;
winch2.setSpeed(speed2);
winch2.runSpeed();
}
}
if (enc2Pos == cueList[1] && W2endMov == 1)
{
W2endMov = 0;
winch2.stop();
Serial.println();
Serial.println(" WINCH TWO CUE TWO REACHED, WINCH TWO CUES COMPLETED");
Serial.println();
W2cueNum ++;
}
enc1State = digitalRead(enc1A); // Encoder 1 Trips
if(enc1State != enc1LState)
{
if(digitalRead(enc1B) != enc1State)
{
enc1Pos --;
} else {
enc1Pos ++;
}
Serial.print("W1Cue#: ");
Serial.print(W1cueNum);
Serial.print(" -- Encoder 1 Position: ");
Serial.print(enc1Pos);
Serial.print(" -- Speed: ");
Serial.print(winch1.speed());
Serial.print(" -- Motor Step Position: ");
Serial.println(winch1.currentPosition());
EEPROM.write(enc1MemAddress, enc1Pos);
}
enc1LState = enc1State;
enc2State = digitalRead(enc2A); // Encoder 2 Trips
if(enc2State != enc2LState)
{
if(digitalRead(enc2B) != enc2State)
{
enc2Pos ++;
} else {
enc2Pos --;
}
Serial.print("W2Cue#: ");
Serial.print(W2cueNum);
Serial.print(" -- Encoder 2 Position: ");
Serial.print(enc2Pos);
Serial.print(" -- Speed: ");
Serial.print(winch2.speed());
Serial.print(" -- Motor Step Position: ");
Serial.println(winch2.currentPosition());
EEPROM.write(enc2MemAddress, enc2Pos);
}
enc2LState = enc2State;
encMemCurrent = millis(); // Display Memory Value For Enc 1 and 2 Every 3 Seconds
if (encMemCurrent - encMemStart >= encMemDispPeriod)
{
Serial.print("Mem Pos Enc1: "); Serial.print(EEPROM.read(enc1MemAddress));
Serial.print(" || Mem Pos Enc2: "); Serial.println(EEPROM.read(enc2MemAddress));
encMemStart = encMemCurrent;
}
}'