r/arduino • u/RevolutionaryBuy7164 • 14d ago
R4 or r3
Hello for learning its Better to buy the r3 or r4 official kit?
r/arduino • u/RevolutionaryBuy7164 • 14d ago
Hello for learning its Better to buy the r3 or r4 official kit?
r/arduino • u/Nurglwe • 14d ago
Hiya, I'm looking to do some side projects. One of which is making a custom keyboard. Instead of doing the typical method of scanning through pins by setting them high and checking the outputs.
The logic behind this is to wait for pins to be pulled down before doing anything without having to constantly oscillate pins on / off.
Does the way that I'm doing it make sense? Does it already exist, does it have a name?
r/arduino • u/luminov1 • 16d ago
Dhurandar ft.FAFAFA (MOVIE:OM Chapter 1-tamil language) playing monochrome video frames on oled powered by esp32 wroom
Code will be soon, I put my GitHub link when it's ready!
r/arduino • u/Deputy_Discreet • 15d ago
Hi, I'm building a steering wheel project that uses an arduino nano as a button box that communicates with an arduino leonardo. This is the relavent repo(NOT MY WORK):
https://github.com/ranenbg/Arduino-FFB-wheel/tree/master/tx_rw_ferrari_458_wheel_emu_16buttons
In the "setup()" function, the following lines are used:
DDRB |= B00001011;
DDRC |= B00111111;
DDRD |= B11111011;
The comments indicate that these configure the button pins as inputs. However, on the ATmega328P, setting a DDR bit to 1 configures the corresponding pin as an output, not an input.
Since the subsequent "PORTx" statements set these pins HIGH, wouldn't pressing a button connected between one of these pins and GND effectively short an output to ground, potentially damaging the microcontroller?
Would the correct configuration instead be:
DDRB &= ~B00001011;
DDRC &= ~B00111111;
DDRD &= ~B11111011;
Im a bit of a beginner and this is just something ChatGPT flagged while I was working on the project. Is this a valid concern or is there something I am missing.
r/arduino • u/xv_sql • 15d ago
I am a beginner arduino user and i saw tutorials of how to use servo motor, but when i included library and tried it, i saw that Servo is not highlited with a different color which gives me impression that it is not working, and i didn't find such error fix in the net, i would appreciate help on this matter, thanks in advance
r/arduino • u/Agitated-Parsley-208 • 15d ago
Looking into making an mp3 player becouse why not, and came across this board "ESP32-S3" have never used it before but it seams to match the size form factor im looking for, however, ran into a problem upon my research. Bluetooth audio. I see tons of people connecting it to there phone and controlling it back and forth, but im looking to connect wireless headphone strit to the "mp3" player. And have come up empty handed. Any advise for moving forward tyia
r/arduino • u/_MODERNA_ • 16d ago
I built this power supply. I think I did everything right, but it looks terrible. It has a 650mAh Li-ion battery, a TP4056, and a 5V booster.
Did I build it correctly?
r/arduino • u/kayos12 • 16d ago
ClawPal is a small Wi-Fi display that sits on your desk and keeps you company. The crab lives on the Home screen and Monitors your PC:
It connect to your PC via a windows companion app. It was made for ESP32-S3-Touch-LCD-4.3B, 800 × 480 but it support more:
Tested Boards:
Experimental Boards(not tested yet):
Free and open source (GPLv3).
GitHub: https://github.com/Kaayoos/clawpal
Feedback welcome, especially if you try one of the experimental boards!
r/arduino • u/Embarrassed_Foot6386 • 15d ago
So I've gotten into electronics recently as a complete noob and, for whatever reason, was asked to solve a problem with a project.
The project in question is a DIY microgreens growing station. It runs on a Chinese Arduino Nano and is equipped with a heat pad (or whatever the problem name is), a good ol' rusty water pump, a buncha lights, a couple of fans for the plants' sustainable growth and also has a capacitive soil moisture sensor (v1.2), as well as a temperature sensor.
The problem is that the moisture sensor isn't measuring properly. The project supposedly used to work just fine for at least a year before, but now it's all mumbo jumbo. I've tested the heat pad, pump, fans - everything. On themselves, they work great. But the capacitive soil humidity sensor is showing, say, 74%-85% humidity when there is supposed to be none.
I would've sent a picture of the entire shtick, but the wiring is just incomprehensible and the entire thing is already hot-glued to a case, so checking the pins behind isn't currently an option. Nor do I currently have my hands on the schematics or the code, but I can try and get the code if needed.
Now, what I've done so far:
What I know I can do:
So, yeah.
Thank you for reading through this! If you have something to say - let me know! I'll appreciate any piece of advice (or criticism) that you may have.
r/arduino • u/Darkmatter313xx • 16d ago
Hello everyone I am very very new to this hobby and I'm in need of help with a project I'm stuck (and very frustrated) on. I hope this is ok to post here, as it is an ESP32 project and I apologize if I have broken any rules. I tried posting in a different sub but they are not very beginner friendly and a bit intimidating, so I though I'd try here, you guys all seem very nice!
So for the past couple of months I have been learning the wonderful world of microcontrollers and I got hooked pretty quickly. So far I have only made a ws2812b lighting system and a gif player. For the past couple of weeks I have been banging my head against the wall trying to make a mjpeg video player work, and it's been frustrating. After trying every example I found online and watching every video i could find someone suggested Chatgpt so i have been trying that, and at first it seemed like we were getting somewhere. We got my display and SD card working together passing a few tests (I didn't want to add touch to simplify things a little) . Then we started making the mjpeg player itself and things got really messy. We kept appearing to get close with some very slow out-of-aspect-ratio videos playing, and then we just started chasing our tails for a long time, so long we ran out of context 8 times! Finally I find myself here asking you good people for help and advice. How bad is this code? It's the closet we got to making it work, we accessed libraries I have not used yet and are taking a totally different approach compared to what I wound up with on the gif player project. Any insights you could give me would be very appreciated.
My display is a ILI9341 2.8" tft and Im using the ESP32 S3 N16R8 and I'm using arduino IDE
Here is my pinout:
#define TFT_MISO 4
#define TFT_MOSI 11
#define TFT_SCLK 12
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 14
// #define TFT_BL 13
//#define TOUCH_CS 5
#define SD_CS 7
here is the mjpeg player program
#include <SD.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <JPEGDEC.h>
#include <esp_heap_caps.h>
// ===================================
// DISPLAY PINS
// ===================================
#define TFT_MISO 4
#define TFT_MOSI 11
#define TFT_SCLK 12
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 14
#define SD_CS 7
// ===================================
// VIDEO SETTINGS
// ===================================
#define MAX_JPEG_SIZE (512 * 1024)
const char *VIDEO_FILE =
"/mjpeg/singulairitywarp20.mjpeg";
const uint32_t FRAME_INTERVAL = 100;
// ===================================
// DISPLAY
// ===================================
Adafruit_ILI9341 tft(&SPI, TFT_DC, TFT_CS, TFT_RST);
JPEGDEC jpeg;
// ===================================
// VIDEO BUFFER
// ===================================
uint8_t *frameBuffer = nullptr;
File videoFile;
// ===================================
// JPEG DRAW CALLBACK
// ===================================
int JPEGDraw(JPEGDRAW *pDraw) {
tft.drawRGBBitmap(
pDraw->x,
pDraw->y,
pDraw->pPixels,
pDraw->iWidth,
pDraw->iHeight
);
return 1;
}
// ===================================
// READ ONE JPEG FRAME
// ===================================
bool readNextJPEG(
File &file,
uint8_t *buffer,
size_t capacity,
size_t &length
) {
bool foundStart = false;
int previous = -1;
length = 0;
while (file.available()) {
int current = file.read();
if (current < 0) break;
// Find JPEG start: FF D8
if (!foundStart) {
if (previous == 0xFF && current == 0xD8) {
buffer[0] = 0xFF;
buffer[1] = 0xD8;
length = 2;
foundStart = true;
}
previous = current;
continue;
}
// Store JPEG data
if (length >= capacity) {
Serial.println("JPEG FRAME TOO LARGE!");
return false;
}
buffer[length++] = (uint8_t)current;
// Find JPEG end: FF D9
if (previous == 0xFF && current == 0xD9) {
return true;
}
previous = current;
}
return false;
}
// ===================================
// SETUP
// ===================================
void setup() {
Serial.begin(115200);
delay(1500);
Serial.println();
Serial.println("ESP32-S3 MJPEG PLAYER");
Serial.println("=====================");
// Deselect both SPI devices
pinMode(TFT_CS, OUTPUT);
digitalWrite(TFT_CS, HIGH);
pinMode(SD_CS, OUTPUT);
digitalWrite(SD_CS, HIGH);
// Initialize shared SPI
Serial.println("Starting SPI...");
SPI.begin(
TFT_SCLK,
TFT_MISO,
TFT_MOSI,
SD_CS
);
Serial.println("SPI READY!");
// Initialize display
Serial.println("Starting display...");
tft.begin(10000000);
tft.setRotation(0);
tft.fillScreen(ILI9341_BLACK);
Serial.println("DISPLAY READY!");
// Initialize SD card
Serial.println("Starting SD card...");
if (!SD.begin(SD_CS, SPI, 10000000)) {
Serial.println("SD CARD FAILED!");
while (true) delay(1000);
}
Serial.println("SD CARD READY!");
// Check PSRAM
Serial.println("Checking PSRAM...");
if (!psramFound()) {
Serial.println("PSRAM NOT FOUND!");
while (true) delay(1000);
}
Serial.print("Free PSRAM: ");
Serial.println(ESP.getFreePsram());
// Allocate frame buffer
Serial.println("Allocating video buffer...");
frameBuffer = (uint8_t *)heap_caps_malloc(
MAX_JPEG_SIZE,
MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT
);
if (!frameBuffer) {
Serial.println("PSRAM BUFFER ALLOCATION FAILED!");
while (true) delay(1000);
}
Serial.println("VIDEO BUFFER READY!");
// Open video
Serial.println("Opening video...");
videoFile = SD.open(VIDEO_FILE, FILE_READ);
if (!videoFile) {
Serial.println("VIDEO FILE NOT FOUND!");
while (true) delay(1000);
}
Serial.print("Video size: ");
Serial.println(videoFile.size());
Serial.println();
Serial.println("VIDEO PLAYBACK STARTING!");
Serial.println("=========================");
tft.fillScreen(ILI9341_BLACK);
}
// ===================================
// MAIN PLAYBACK LOOP
// ===================================
void loop() {
static uint32_t lastFrameTime = 0;
size_t frameSize = 0;
uint32_t frameStart = millis();
// Read next JPEG frame
if (!readNextJPEG(
videoFile,
frameBuffer,
MAX_JPEG_SIZE,
frameSize
)) {
Serial.println("VIDEO RESTARTING...");
videoFile.seek(0);
delay(100);
return;
}
// Decode and display frame
if (jpeg.openRAM(
frameBuffer,
frameSize,
JPEGDraw
)) {
jpeg.decode(0, 0, 0);
jpeg.close();
} else {
Serial.println("JPEG DECODE FAILED!");
}
// Frame rate control
uint32_t elapsed = millis() - frameStart;
if (elapsed < FRAME_INTERVAL) {
delay(FRAME_INTERVAL - elapsed);
}
lastFrameTime = millis();
}
r/arduino • u/giantsizecocoapuffs • 16d ago
I made this for Halloween this year! My husband is testing it in the video hahah. What do you guys think?
r/arduino • u/Builder_0101 • 16d ago
When my local library's Arduino program shut down for lack of instructors and materials, a few teammates from my robotics team and I rebuilt it from scratch. It's now taught at five libraries and has reached 1,000+ kids, and a Canadian nonprofit, Digital Moment, adopted the French edition.
What's in it:
- 8 lessons, about 90 minutes each: blinking LED, series vs. parallel, buttons and pull-down resistors, potentiometers and analogRead, servos and map(), switch statements and loops (a 4-mode windshield wiper), and two open-ended capstones
- Every lesson works with real parts OR entirely in the Tinkercad simulator
- Code examples, wiring diagrams, teacher notes, timing, common wiring mistakes, and exit tickets
- Free and MIT-licensed
I'm a high school senior, so I'd really appreciate feedback from people who know this better than I do, especially on the explanations in Lesson 3 (pull-down resistors) and Lesson 7 (millis() vs. delay()). If you teach or mentor and end up using any of it, I'd love to hear how it went.
r/arduino • u/TastyCollege9639 • 15d ago
If you use an ESP8266 (NodeMCU / D1 Mini / ESP-07S) for remote sensors in a yard, garage, or basement, two limits hit pretty quickly:
250 bytes (192 bytes usable after headers) and drops an entire multi-KB log or CSV batch if even one packet gets lost through a wall.80 KB of total SRAM (~22-40 KB free heap once the SDK boots), full TLS / BearSSL or big retransmission buffers eat almost all available memory.I built an open-source MIT library in zero-malloc, zero-float ANSI C99 called NLTP (now in the Arduino IDE Library Manager as NLTP and PlatformIO as indian-aman/NLTP) with an ultra-light sensor flag (-DNLTP_TX_ONLY=1) that shrinks sizeof(nltp_endpoint_t) to 4,760 bytes of static RAM while keeping:
ESP8266 <-> ESP32 ESP-NOW & Wi-Fi UDP: Automatically uses 192-byte shards (242-byte encrypted frames) on ESP8266 ESP-NOW v1 and interoperates seamlessly with ESP32 gateways and Python (pip install pynltp) receivers.GF(2^8) Cauchy FEC): Reconstructs 10-35% dropped RF frames mathematically on the receiver (3/3 SHA-256 verified on an 8 KB NodeMCU -> ESP32 bench sweep at 10%, 25%, and 35% packet loss, where raw ESP-NOW delivered 0/3).LZ4 compression: Compresses CSV/JSON telemetry 4x-7x before transmission (ESP8266_UltraLight_LZ4_Sensor.ino included in examples/).X25519 + ChaCha20-Poly1305 + 512-packet anti-replay: No BearSSL heap allocation and no hardware peer-slot limit, plus bidirectional confirmed popReflex() / sendReflex() control messages.On a clean 0%-loss desk link, unencrypted raw ESP-NOW is faster (2.55 Mbps raw vs 1.29 Mbps encrypted NLTP on 8 KB NodeMCU -> ESP32), so raw ESP-NOW is still great for tiny single-frame readings at short range. NLTP is specifically for multi-KB batches, encrypted links, and weak-signal spots where packets drop.
ESP8266 sketch & RF benchmarks): https://github.com/indian-aman/NLTP-Arduinodraft-bains-nltp-00): https://datatracker.ietf.org/doc/draft-bains-nltp/r/arduino • u/BitOops • 16d ago
r/arduino • u/LogicalLawfulness498 • 16d ago
I have a DS18B20 temperature sensor but when the temperature reaches 72 degrees, the sensor suddenly disconnects, this has happened repeatedly, has anyone experienced this too? What is the solution? Previously I used the MAX6675 sensor but it also gave an error when it came into contact with a conductor or air, even though I had searched for the error it was still the same. please help me bellow the comment
r/arduino • u/8_BitH3ro • 16d ago
So this is the core for an addressable rgbw led light effect system running off a digispark attiny85. Im making this to fit in the topper of a staff. It runs amazingly but I really just patched together some basic effects online. A lot of flicker not enough flow. Fire, lightning, ice, earth, and a flashlight. Im new and feel like I'm missing something obvious to get those eye catching effects. Is it the hardware? What are some equations yall use to make it pop? Also the sealent as a defuser works fine for the led matrix in the photo, because it's going under a resin object but the inlays are still to shallow for it to be enough. What are some things yall use for soft decisions?
r/arduino • u/animus-official • 17d ago
Here is my 16 array IR sensor Line follower with PID controller along with oled menu.....if u have any query feel free to DM me
r/arduino • u/Ok-Finish1303 • 16d ago
Hi everyone,
I'm working on a line-following robot using:
My robot initially worked during the first couple of attempts, but now it keeps turning and eventually loses the black line.
I'm using a weighted sensor-position calculation and proportional steering control. I also included sharp-turn handling and line-loss recovery.
My sensor readings are configured as:
Could someone review my code and point out anything that might cause the robot to keep turning or lose the line?
I'd appreciate suggestions for improvements without completely changing my existing approach.
Thank you!
p.s. i did not use ai to write this code. im just bad
#define wht LOW
#define blk HIGH
// IR sensor pins
#define IR1 19
#define IR2 18
#define IR3 5
#define IR4 17
#define IR5 16
#define IR6 4
// Motor driver pins
#define motor1a 33 // pwm1-
#define motor1b 32 // pwm1+
#define motor2a 25 // pwm2+
#define motor2b 26 // pwm2-
// Store sensor pins and readings
int sensorPins[] = {IR1, IR2, IR3, IR4, IR5, IR6};
int sensorValues[6];
// Sensor weights from left to right
int weights[] = {-5, -3, -1, 1, 3, 5};
// Motor speed settings
int baseSpd = 65;
int maxSpd = 110;
// Motor speed commands
int gotoL = 0;
int gotoR = 0;
// Line recovery variables
int lostCount = 0;
int lastDirection = 0;
void setup() {
// Set IR sensors as inputs
for (int i = 0; i < 6; i++) {
pinMode(sensorPins[i], INPUT);
}
// Set motor pins as outputs
pinMode(motor1a, OUTPUT);
pinMode(motor1b, OUTPUT);
pinMode(motor2a, OUTPUT);
pinMode(motor2b, OUTPUT);
// Set PWM frequency and resolution
ledcAttach(motor1a, 20000, 8);
ledcAttach(motor1b, 20000, 8);
ledcAttach(motor2a, 20000, 8);
ledcAttach(motor2b, 20000, 8);
}
void loop() {
int total = 0;
int count = 0;
// Read all six IR sensors
for (int i = 0; i < 6; i++) {
sensorValues[i] = digitalRead(sensorPins[i]);
// Check if the sensor detects black
if (sensorValues[i] == blk) {
total += weights[i];
count++;
}
}
// If the line is detected
if (count > 0) {
lostCount = 0;
// Calculate the line position
float position = (float)total / count;
// Remember the last direction
if (position < -0.5) {
lastDirection = -1;
}
else if (position > 0.5) {
lastDirection = 1;
}
// Sharp left turn
if (position <= -3.5) {
gotoL = -35;
gotoR = 95;
}
// Sharp right turn
else if (position >= 3.5) {
gotoL = 95;
gotoR = -35;
}
// Normal line following
else {
// Calculate steering correction
int correction = 15.0 * position;
// Adjust left and right motor speeds
gotoL = baseSpd + correction;
gotoR = baseSpd - correction;
}
}
// If the line is not detected
else {
lostCount++;
// Start searching after five readings
if (lostCount >= 5) {
// Search towards the left
if (lastDirection == -1) {
gotoL = -35;
gotoR = 95;
}
// Search towards the right
else if (lastDirection == 1) {
gotoL = 95;
gotoR = -35;
}
// Stop if no direction was recorded
else {
gotoL = 0;
gotoR = 0;
}
}
}
// Limit motor speeds
gotoL = constrain(gotoL, -maxSpd, maxSpd);
gotoR = constrain(gotoR, -maxSpd, maxSpd);
// Control both motors
controlMotor(gotoL, motor1a, motor1b);
controlMotor(gotoR, motor2a, motor2b);
delay(5);
}
// Control motor speed and direction
void controlMotor(int spd, int pinA, int pinB) {
// Move forward
if (spd > 0) {
ledcWrite(pinA, spd);
ledcWrite(pinB, 0);
}
// Move backward
else if (spd < 0) {
ledcWrite(pinA, 0);
ledcWrite(pinB, -spd);
}
// Stop motor
else {
ledcWrite(pinA, 0);
ledcWrite(pinB, 0);
}
}r/arduino • u/haricane8133 • 16d ago
A follow up to the version 1 - https://www.reddit.com/r/arduino/comments/1p8kzg6/graytimer_simple_and_crude_diy_epaper_watch/
Version 2 now can now do:-
YouTube demo - https://www.youtube.com/watch?v=rnAYJC3mgms
Build Guide (Hackster) - https://www.hackster.io/varahan/graytimer-nfc-eink-watch-06e3d7
Medium (The story behind) - https://medium.com/@haricane8133/gray-timer-the-story-4ba7ca0a75e1
Repository - https://github.com/haricane8133/graytimer
I am available through the username haricane8133 in X, Reddit, LinkedIn, Medium and YouTube. Happy hacking!
r/arduino • u/WalierTheDarkHeros • 16d ago
I need battery to power 6 servo 4 of it is carry low and 2 carry high weight(~100-200g) and it use really much power latest solution i use 4 1.5v to make 6v for them but it drain really fast i want to find replacement if possible.
r/arduino • u/Salopar • 17d ago
Hello, right now in our university, we have a arduino project. We are creating a contactless hand sanitizer dispenser. The ultrasonic sensor detects a hand, the Arduino runs the pump briefly, and a green LED lights while it dispenses. After a set number of doses a red LED lights to say it needs a refill. Also in this diagram there is a DC motor but i will use a 6v pump with a plastic tube for the liquid sanitizer.
I would greatly appreciate if you told me how my circuit is right now, and advice how to make it better and tips for creating the physical model. 🙏🙏🙏
r/arduino • u/Upper-Butterfly6963 • 18d ago
I made this project back in college in 2022. Never really showed it to anyone. It was more of a challenge I had set for myself.
Although I wanted to present it, my college made it clear that a project like this couldn't be showcased because it had "no practical usage". On the other hand, they approved some basic RC car in the name of surveillance applications. Anyway, that's a story for another day. : )
The project took around a month to complete, covering everything from electronics, circuit layout and component selection to designing the CAD files, and coding the games and menu system.
I packed it with three games: Pong, Snake, and Space Invaders (my favourite!). The coding was one hell of a challenge back then, especially since there was no AI assistance (at least, I wasn't aware of it before the ChatGPT boom). I eventually maxed out the Arduino Nano's memory, but managed to get everything working!
Some features I implemented:
Anyways, just wanted to share this little project with you guys, as I never really got the chance to share it with anyone.
Now that I'm a working professional (and not in the electronics field anymore 🥲), I'm planning to take on another, more advanced project as a hobby build. Maybe a better Game Boy or something entirely different.
Back then, I struggled to find similar projects with shared code and build details, so I thought I'd share mine. Maybe it'll help someone out there!
I really want to tinker around Arduino and electronics. Love the community ✨
(Used AI to proof write :D)
r/arduino • u/SplinterJaw • 18d ago
A little tin box aquarium, using an ESP32-C3 SuperMini, a 1.8″ TFT, a five way switch and a LiPo battery. You feed the fish and shrimp, change the water, buy plants and decorations, and upgrade the tank. Different species have their own behaviours, and neglect can eventually kill them. Everything runs offline. Basically a fish Tamagotchi
The wiring was a bit of a headache, and the build is definitely rough around the edges, but I’m happy with how it turned out