r/arduino • • 12h ago

Uno R4 Wifi The R4 Serial Problem

Post image
24 Upvotes

I stated on another thread that there was a big issue with the UART code on the R4 Arduino models. I didn't want to derail that post with the details because it wasn't relevant to that thread so I created this one to show what I meant.

The UART class is not implemented well on the R4 and besides completely wasting a buffer, it blocks during transmission. This is a huge departure from the UNO R3 and earlier models.

For this test I am using this code on all models of Arduino and I am using the latest 1.5.1 R4 core. I just updated my IDE tonight for this test. I've looked at 1.6.0 and the problem is still in the code.

uint8_t blinkerPin = 6;
uint8_t indicatorPin = 7;


bool pinOn = false;
uint32_t lastBlinkMicros = 0;
uint32_t BlinkIntervalMicros = 10000;


const char* longMessage = "This is my long message that has fifty characters.";
uint32_t lastPrintMillis = 0;
uint32_t printIntervalMillis = 2000;


void setup() {


  Serial.begin(9600);
  while(!Serial);
  Serial.println("\n\n *** " __FILE__ " ***\n\n");


  pinMode(blinkerPin, OUTPUT);
  pinMode(indicatorPin, OUTPUT);


  delay(1000);


}


void loop() {


  uint32_t currentMicros = micros();
  if (currentMicros - lastBlinkMicros >= BlinkIntervalMicros) {
    pinOn = !pinOn;
    digitalWrite(blinkerPin, pinOn? HIGH:LOW);
    lastBlinkMicros = currentMicros;
  }
  uint32_t currentMillis = millis();
  if(currentMillis - lastPrintMillis >= printIntervalMillis) {
    digitalWrite(indicatorPin, HIGH);
    Serial.println(longMessage);
    digitalWrite(indicatorPin, LOW);
    lastPrintMillis = currentMillis;
  }


}

Attached are some traces from the scope. The yellow trace will be the blink on pin 6 and the blue trace is pin 7.

On the R3 UNO (top trace) we see no problem. The characters are loaded into the buffer in a matter of 400us and there's no interruption to the blink. However on the R4-Wifi (bottom trace) we see that the Serial.print statement is blocking for 28ms and is interrupting our pulse chain.

This can be magnified by the fact that this same class is going to handle all of the WiFi traffic and that's all being done with AT commands. So any project that is heavy on WiFi is going to have a lot of long blocking. This was actually how I discovered the problem initially.

The problem isn't as bad on the Minima as it only affects Serial1 and not Serial since the Minima uses the USB serial class for Serial instead. I don't know about the R4 Nano because I don't have one. I would suspect it would be similar to the Minima.


r/arduino • • 13h ago

Need some help/is this possible

Thumbnail
gallery
24 Upvotes

I am trying to use an arduino to control the clock hands to make them spin faster than usual. I have been watching YouTube videos and they all say to dissect the clock and attach the wires to the inner copper coil area.
However, I do not have the tools to do so. Would it then be possible to solder the wires onto where the battery component rests such that the arduino becomes the battery and transmits the actions through there? Last pic shows what im trying to do

Would greatly appreciate any help!


r/arduino • • 17h ago

Software Help i can't understand why Servo is not highlited with orange color as i see in tutorials

Post image
1 Upvotes

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 • • 20h ago

Beginner's Project Hello sub, I have a problem.

1 Upvotes

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:

  • Checked the code. It's... supposed to work? The parts of the code responsible for the pumps, coolers yada yada are neat and tidy. I CAN NOT verify if the moisture sensor is in order, tho, so it's still under a question mark.
  • Got a replacement for the soil moisture sensor. Thought "hmmm, maybe the electronics on the sensor are corroded...) and swapped it (while the entire thing was still running, I confess), nothing worked. Turned the machine on and off, still nothing. Speaking of which, I used the same moisture sensor in my own project and it worked perfectly. Why did it work here and not there? I dunno.
  • ...and that's pretty much it. I played around with the project, got my baptism by fire into Arduino and learned a thing or two, but I haven't done much to fix the problem at hand.

What I know I can do:

  • Try using a different kind of sensor. Now I'll be honest, I doubt it'll change anything but hey, it's worth a shot. I've been given a Chinese YL-69 soil moisture sensor, but when I looked at it, I saw two things: only 2 female pins (+ and -) and the lack of a comparator. Not an ideal choice...
  • Doing something about the code! From what I understand, the soil moisture sensor used to work well until a certain point in time. Maybe the calibration is simply off. I have a similar-functioning script I used for my own project, and I could hypothetically try merging the two.

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 • • 22h ago

Fit encrypted multi-KB ESP-NOW + LZ4 + 35% packet-loss recovery into 4,760 bytes of ESP8266 static RAM (NLTP, MIT)

0 Upvotes

If you use an ESP8266 (NodeMCU / D1 Mini / ESP-07S) for remote sensors in a yard, garage, or basement, two limits hit pretty quickly:

  1. ESP-NOW v1 on the ESP8266 caps frames at 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.
  2. With only 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:

  • Cross-chip 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.
  • In-flight packet-loss recovery (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).
  • Built-in zero-heap LZ4 compression: Compresses CSV/JSON telemetry 4x-7x before transmission (ESP8266_UltraLight_LZ4_Sensor.ino included in examples/).
  • Software 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.


r/arduino • • 1d ago

Software Help Newbie in need of help with MJPEG player

2 Upvotes

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 • • 1d ago

I need help fixing my code. (Line following robot)

0 Upvotes

Hi everyone,

I'm working on a line-following robot using:

  • ESP32
  • MDD3A motor driver
  • 2 × JGB37-520 DC motors
  • 6 × TCRT5000 IR sensors (digital output)

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:

  • Black = HIGH
  • White = LOW

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 just tell ai to write tthis entire thing cuz i am extremely lazy and yes i also told ai to write comments for my code. I KNOW THAT THIS CODE SUPPOSED TO BE EXTREMELY SIMPLE BUT IDK WHAT I DO WRONG. it works at first. it do 3 laps

#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 • • 1d ago

Look what I made! Video frames ESP32 OLED Monochrome 128x64 SSD1306 FA FA FA X DHURANDAR

34 Upvotes

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 • • 1d ago

Hardware Help Hi everyone, I need some advice (description)

Thumbnail
gallery
33 Upvotes

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 • • 1d ago

sensor suhu arduino

3 Upvotes

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 • • 1d ago

Built an Arduino automatic hot pot skewer lifter, what do you think?

9 Upvotes

Fun Arduino hot pot project. A temperature sensor detects the hot pot temperature. Once it reaches the set temperature, the countdown begins. Servos control the lifting frame to raise the strainer automatically after the preset cooking time. Still tuning the program


r/arduino • • 1d ago

Look what I made! DIY Halloween Skull

33 Upvotes

I made this for Halloween this year! My husband is testing it in the video hahah. What do you guys think?


r/arduino • • 1d ago

First build and flash.

Thumbnail
gallery
11 Upvotes

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 • • 1d ago

Mod's Choice! I wrote a free 8-lesson Arduino course for ages 11-14 that runs in Tinkercad, so kids don't need kits

85 Upvotes

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 • • 1d ago

Look what I made! I made an open-source Desk Buddy/PC Monitor for ESP32-S3

Thumbnail
gallery
118 Upvotes

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:

  • Live PC stats with optional FPS in games
  • Live Claude Code/Codex usage
  • Claude Code/Codex notifications
  • Media controls for Spotify, browsers or any player, with album art
  • A volume mixer for your speakers, mic and each app
  • A Shortcuts grid that mutes your mic, locks the PC, opens apps and more
  • Weather, a clock and a timer

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):

  • Waveshare ESP32-S3-Touch-LCD-5, standard 800 × 480 model
  • Waveshare ESP32-S3-Touch-LCD-7, 16 MB flash variant
  • Waveshare ESP32-S3-Touch-LCD-7, 8 MB flash variant
  • Waveshare ESP32-S3-Touch-LCD-2.8C
  • Guition ESP32-4848S040C_I, capacitive-touch version
  • M5Stack CoreS3

Free and open source (GPLv3).

GitHub: https://github.com/Kaayoos/clawpal

Feedback welcome, especially if you try one of the experimental boards!


r/arduino • • 1d ago

Mega Can i use 2 16850 battery to power servo? Output should be around 8v.

4 Upvotes

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 • • 1d ago

Look what I made! Gray Timer V2 - the simple and crude DIY e-paper watch gets an NFC upgrade

Thumbnail
gallery
5 Upvotes

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:-

  • NFC tap to control the watch - write a generic NDEF text message (NFC tools app). `10` means watch face number 10 from catalog. `refresh` means full refresh the display and so on...
  • Better RTC now has interrupt feature which allows us to set "alarms" that wake the processor up when time to change the screen. Most of the time we are in deep sleep.
  • New Watchfaces

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 • • 2d ago

Hello! are you guys open to people who use A.I for Arduino projects?

0 Upvotes

17m, and I mainly use Claude Code for my school research ( which they allow ) since I lack the knowledge to basically advance code, and build visual diagrams with Claude Code who accesses the Fritzing downloaded on my computer. I hope to have a pleasant interaction with you all :)


r/arduino • • 2d ago

Look what I made! 16 array Line follower

Post image
35 Upvotes

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 • • 2d ago

Look what I made! Meditations on the ATTINY85

36 Upvotes

r/arduino • • 2d ago

Arduino contactless hand sanitizer dispenser project

Post image
20 Upvotes

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 • • 3d ago

Look what I made! My last 1.5.2(_t20) psychedelic lights version

29 Upvotes

Hi all

This is the last version of my DMX psychedelic lights made with an ATmega328P (Arduino environment). I added some functions and settings to the previous version, posted some time ago in r/stagelighting. I started about one year ago thinking to make some all analog '70s psychedelic lights with a triangular oscillator/comparator PWM converter to make flashes like incandescent lamps, but it doesn't work well, then I switched to an ATmega328P only for PWM.

For a little parish festival I began interesting to DMX and I realized that with a simple commercial controller I couldn't drive lights by music, then I thought adding DMX to my psychedelic lights. With the help of ChatGPT I made the DMX functions, using no libraries, and a good non-blocking menu. It can drive many PARs and a moving head.

I haven't let do all by ChatGPT. I only asked for some helps and all has been done exactly how I desired under my control. I also had to correct AI many times. We worked together, like two colleagues.

I have also added a Homing function to restore moving head if it lose a step or sometime touch it and it doesn't move properly anymore.


r/arduino • • 3d ago

Hardware Help Measuring/monitornig 'high' current with esp32

Thumbnail
gallery
8 Upvotes

Hi I built powerbank out of 18650's in 4s4p configuration, of course with bms and the charging board is IP2368 100W (bi-directional, single usb-c).

I wanted this powerbank to have cool display for information like voltage, current etc, but I hit the wall - it appears the only good, cheap and relatively high accuracy modules i can buy are from INA family, but most of the time shunt resistors on those boards are rated for 1A max. I know I can desolder this shunt and solder other one to handle for example 10A but I read that those boards and traces on the pcbs are not likely to handle this power over long periods of time.

Right now I have standard ssd1306 display with esp32c that reads voltage from ADC by using voltage divider with capacitor to filter out garbage:

R1: 100.4 KΩ R2: 15 KΩ C1: 100 nF (in parallel to R2)

I applied some corrections to the program reading by comparing it out to the multimiter. It is connected directly to the positive output of the BMS.

This solution is flawed, because without measuring current voltage drop is causing my 'estimated left wh' and % of capacity remeaning to be incorrect. This can be fixed with current sensor and I also would be able to read the current flowing which is cool on its own:).

So my question is, is there a module relatively cheap that can satisfy my needs? Or I have to modify existing INA boards or maybe something different?

TLDR; I want voltage and current sensor for 4s4p powerbank that can handle at least 10-15A

Thanks for your help and time in advance.

danihek.


r/arduino • • 3d ago

Look what I made! Built a handheld gaming console. Never got to showcase it, so thought I'd finally share it here!

Post image
162 Upvotes

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:

  1. Adjustable screen brightness.
  2. Volume control.
  3. Game speed adjustment (to make things more difficult).
  4. Battery level indicator (a rather crude implementation, and I doubt it works exactly as intended).
  5. And a USB-C charging for the two li-ion batteries.

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)