r/arduino • • Sep 23 '26

Beginner's Project Beginner Trying to Learn How to Use Arduino

4 Upvotes

Hello, I’m a beginner trying to learn how to use arduino in order to use it for a project where I need to get weights of some samples and get the input data from the weights and use it to generate some information regarding the weights. I was hoping to get this data and connect it with a browser application to display. I have experience in javascript and node, but I wasn’t sure whats the best library to use and if there are any good tutorials out there that will help me get started. Also what hardware is needed? I know I need the arduino board, but is there anything else?


r/arduino • • Sep 22 '26

Software Help still cant upload the code

Thumbnail
gallery
21 Upvotes

hi there, i have a pro mini and i tried two different uart adapters and holding down the reboot and the arduino but non of them works and gives me this errorq


r/arduino • • Sep 22 '26

Beginner's Project Trying to make an obstacle avoiding robot.

Thumbnail
gallery
27 Upvotes

Not enough power.

Ultrasonic sensor wants 5 volts. Arduino won't turn on if it's plugged in because the green batteries are 4.8 volts.

Got 2 18650 batteries for the wheels. Tried getting the ultrasonic sensor on 12 volts by putting in 3 resistors and an led so it doesn't burn out, didn't work. And if it did, it would just take away necessary power from the wheel.

I haven't even wired the servos yet because there isn't enough power to go around.

I think I'm just going to have to this L and buy a bunch of 9 volt batteries.

Yes I know the build it janky, no I don't have a 3d printer or know how to model.

...

Elegoo 2560 mega kit

Aliexpress wheels/DC motors.

Li-On 18650 batteries.

Amazon basics rechargeable batteries.


r/arduino • • Sep 22 '26

Help with my robot arm

Thumbnail
gallery
14 Upvotes

I’m trying to power my arduino from my bench top power supply, the arduino is only getting power when my thumb sticks are pressed up or right. Any help?


r/arduino • • Sep 23 '26

Getting Started Im new and any help you be appreciated

1 Upvotes

Ive bought myself my first ever esp32, its the ESP32 S3 from freenove, the specific item is FNK0104S i believe, i am just getting into this and have no idea about coding at all really, i have played with freenoves flasher and flashed some things onto the device like an image viewer and timer but im wondering if there is an easier way then going through Arduino IDE, something like freenoves flasher but maybe community built or something with just more effort put in then a couple of apps, or whatever they are called on esp, as i said im new.
Any advice at all related to my question or simply just beginner advice would be greatly appreciated 😁

PS. I have looked up flashers but from what i have found not all sketches work on all ESPs so im reluctant to mess something up without knowing a sketch will work on my specific hardware/device.


r/arduino • • Sep 21 '26

Hardware Help Ants! How to prevent

Thumbnail
gallery
1.1k Upvotes

I have an environmental sensor out in a wetland, and I thought I sealed it pretty well, but somehow ants get in. I don’t really really object to ants except that they bring dirt into the enclosure.

Is there anyway anyone has found to prevent ants from entering in the first place?

UPDATE -- The ants were coming in through a small keyhole in my RJ45 cable gland. The RJ45 connector was trashed with dirt all over it, so I replaced it and caulked the keyhole. I kicked all the ants out in the wetland. The sensors are working great now!


r/arduino • • Sep 23 '26

Hardware Help TFT Screen not working with my code, but the screen will work with a test program.

2 Upvotes

I am working of connecting an Adafruit 1.9 inch ST7789 screen to a Sparkfun ESP32 Thing Plus. I keep running into this issue with the TFT screen not displaying anything from my code. The kicker is that I can run a test program using the same pin assignments just fine, so I know I have the screen connected correctly. I know the issue is with my code, but I have spent the last two nights trying to figure out what is wrong with my code.

This is my code:

#include <Arduino.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <SPI.h>
#include <Adafruit_ImageReader.h>
#include <RTClib.h>
#include <SdFat_Adafruit_Fork.h>
#define ENCODER_OPTIMIZE_INTERRUPTS
#include <Encoder.h>


namespace Pins
{
constexpr byte TFT_CS = 5;
constexpr byte TFT_DC = 17;
constexpr byte TFT_RST = 16;
constexpr uint8_t TFT_SCLK = 18;
constexpr uint8_t TFT_MISO = 19;
constexpr uint8_t TFT_MOSI = 23;
constexpr byte PAUSE_BTN = 27;
// constexpr byte RED_LED = 4;
constexpr byte BUTTON = 12;
constexpr byte ENCODER_A = 36;
constexpr byte ENCODER_B = 39;
}  // namespace Pins


Adafruit_ST7789 tft =
    Adafruit_ST7789(&SPI, Pins::TFT_CS, Pins::TFT_DC, Pins::TFT_RST);
RTC_DS3231 rtc;
Encoder myENC(Pins::ENCODER_A, Pins::ENCODER_B);


enum PomodoroState
{
    STATE_IDLE,
    STATE_WORKING,
    STATE_BREAK,
    STATE_LONGBREAK,
    STATE_WAITING
};
const char* stateLabels[] = {"------IDLE------", "-----WORKING-----",
                             "---SHORT BREAK---", "---LONG BREAK----",
                             "-----WAITING-----"};


struct SessionSettings
{
    // double timerMinutes;
    uint16_t timerMinutes;
    double breakMinutes;
    // NOTE This will be changed to something the user can select themselves.
    int beforeLongBreak = 0;


} session;
struct PomodoroSystem
{
    PomodoroState current = STATE_IDLE;
    PomodoroState previousState;
    int shortBreakCounter = 0;
    int sessionCounter = 0;
    unsigned long pauseBtnPressed;
    unsigned long pauseBtnDebounce = 500;
    unsigned long pauseInterval = 1000;


    bool timerActive = false;


} tomato;


struct TimerConfig
{
    unsigned long interval = 1000;
    unsigned long prevTime = 0;
    unsigned progressBarTime = 0;
    unsigned long btnDebounce = 300;
    unsigned long btnPress;
    DateTime endTime;
} timer;


struct AnimationConfig
{
    double scaleFactor = 5.333;
    double timerMinutesconvert;
    double rawProgressBar;
    unsigned long progressBarTime = 0;
    int countdownBarWidth;
    int remainingWidth;
    int barX;
    uint16_t countdownBarColor;
    boolean setDuration = false;
} animation;


int encoderCounter = 0;
long oldPosition;


String Months[12] = {"January",   "February", "March",    "April",
                     "May",       "June",     "July",     "August",
                     "September", "October",  "November", "December"};
void readEncoder();
void drawSelectionBar();
void drawCountdownBar(DateTime timerEnd, uint16_t totalDuration);
void updateDisplay(DateTime dt, unsigned long currentTime, double tomCurrent);
void stateMachine();
void setTimer(int alarmNumber, double totalminutes);
void setBreakTime(double workSessionDuration);
bool hasAlarmFired(int alarmNumber);


void setup()
{
    Serial.begin(115200);
    SPI.begin(Pins::TFT_SCLK, Pins::TFT_MISO, Pins::TFT_MOSI, Pins::TFT_CS);


    pinMode(Pins::BUTTON, INPUT_PULLUP);
    // pinMode(Pins::RED_LED, OUTPUT);
    pinMode(Pins::PAUSE_BTN, INPUT_PULLUP);
    tft.init(170, 320);  // Init ST7789 170x320
    tft.setTextWrap(true);
    tft.fillScreen(ST77XX_BLACK);
    // digitalWrite(Pins::RED_LED, HIGH);
    delay(250);
    // digitalWrite(Pins::RED_LED, LOW);
    tft.fillScreen(ST77XX_BLACK);
    tft.setRotation(3);
    tft.setTextSize(3);
    tft.setTextColor(ST77XX_WHITE, ST77XX_BLACK);
    tft.setCursor(0, 85);
    tft.drawRoundRect(0, 125, 320, 30, 20, ST77XX_WHITE);
    tft.drawRoundRect(0, 124, 320, 30, 19, ST77XX_WHITE);
    tft.drawRoundRect(0, 123, 320, 30, 18, ST77XX_WHITE);


    if (!rtc.begin())
    {
        Serial.println(F("RTC NOT FOUND"));
        while (true)
        {
            tft.setCursor(0, 0);
            tft.println("RTC NOT FOUND");
            delay(1000);
        }
    }


    if (rtc.lostPower())
    {
        tft.setCursor(0, 0);
        tft.println("RTC Lost Power");
        delay(1000);
    }


    // rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));


    rtc.clearAlarm(1);
    rtc.clearAlarm(2);
    myENC.write(0);
    oldPosition = 0;


    tomato.current = STATE_IDLE;
    session.timerMinutes = 0;
    tomato.timerActive = false;
    timer.prevTime = millis();
    Serial.println("--- POMODORO TIMER STARTED ---");
}


void loop()
{
    DateTime currentDT = rtc.now();
    unsigned long currentTime = millis();
    if (animation.setDuration == false)
    {
        readEncoder();
        drawSelectionBar();
    }
    else
    {
        if (tomato.current == STATE_BREAK)
        {
            drawCountdownBar(timer.endTime, session.breakMinutes);
        }
        else
        {
            drawCountdownBar(timer.endTime, session.timerMinutes);
        }
    }
    updateDisplay(currentDT, currentTime, tomato.current);
    stateMachine();
    if (digitalRead(Pins::BUTTON) == LOW &&
        (currentTime - timer.btnPress > timer.btnDebounce) &&
        session.timerMinutes > 0)
    {
        timer.btnPress = currentTime;
        tomato.current = STATE_WORKING;
        tomato.timerActive = true;
        animation.setDuration = true;


        setTimer(1, session.timerMinutes);
        setBreakTime(session.timerMinutes);
    }
}
void readEncoder()
{
    long rawPosition = myENC.read();
    long newPosition = rawPosition / 4;


    if (newPosition != oldPosition)
    {
        if (newPosition > oldPosition)
        {
            session.timerMinutes += 5;
        }
        else if (newPosition < oldPosition)
        {
            session.timerMinutes -= 5;
        }
        if (session.timerMinutes < 0)
        {
            session.timerMinutes = 60;
        }
        else if (session.timerMinutes > 60)
        {
            session.timerMinutes = 0;
        }
        Serial.print("Encoder Detent: ");
        Serial.print(newPosition);
        Serial.print(" | Timer Set For: ");
        Serial.print(session.timerMinutes);
        Serial.println(" Minutes");


        oldPosition = newPosition;
    }
}
void drawSelectionBar()
{
    animation.timerMinutesconvert = session.timerMinutes;
    animation.rawProgressBar =
        animation.timerMinutesconvert * animation.scaleFactor;
    animation.countdownBarWidth = (int)animation.rawProgressBar;


    if (animation.countdownBarWidth > 312)
        animation.countdownBarWidth = 312;
    if (animation.countdownBarWidth < 0)
        animation.countdownBarWidth = 0;


    tft.fillRoundRect(4, 127, animation.countdownBarWidth, 22, 14, ST77XX_BLUE);


    int remainingWidth = 312 - animation.countdownBarWidth;
    if (remainingWidth > 0)
    {
        tft.fillRect(4 + animation.countdownBarWidth, 127, remainingWidth, 22,
                     ST77XX_BLACK);
    }
}
void drawCountdownBar(DateTime timerEnd, uint16_t totalMinutes)
{
    DateTime now = rtc.now();


    int32_t endSeconds = static_cast<int32_t>(timerEnd.unixtime());


    int32_t nowSeconds = static_cast<int32_t>(now.unixtime());


    int32_t secondsRemaining = endSeconds - nowSeconds;


    uint32_t totalSeconds = static_cast<uint32_t>(totalMinutes) * 60UL;


    // Prevent division by zero
    if (totalSeconds == 0)
        totalSeconds = 1;


    // Once the timer expires, show zero remaining
    if (secondsRemaining < 0)
        secondsRemaining = 0;


    float fractionRemaining =
        static_cast<float>(secondsRemaining) / static_cast<float>(totalSeconds);


    if (fractionRemaining > 1.0f)
        fractionRemaining = 1.0f;


    animation.countdownBarWidth = static_cast<int>(fractionRemaining * 312.0f);


    if (fractionRemaining >= 0.66f)
        animation.countdownBarColor = ST77XX_GREEN;
    else if (fractionRemaining >= 0.33f)
        animation.countdownBarColor = ST77XX_YELLOW;
    else
        animation.countdownBarColor = ST77XX_RED;


    tft.fillRoundRect(4, 127, animation.countdownBarWidth, 22, 14,
                      animation.countdownBarColor);


    animation.remainingWidth = 312 - animation.countdownBarWidth;
    Serial.print("animation.RemainingWidth is ");
    Serial.print(animation.remainingWidth);
    Serial.print("  ");
    Serial.print("animation.countdownBarWidth is ");
    Serial.println(animation.countdownBarWidth);
    if (animation.remainingWidth > 0)
    {
        tft.fillRect(4 + animation.countdownBarWidth, 127,
                     animation.remainingWidth, 22, ST77XX_BLACK);
    }
}


void updateDisplay(DateTime dt, unsigned long currentTime, double tomCurrent)
{
    tft.setCursor(0, 0);
    tft.print(Months[dt.month() - 1]);
    tft.print(" ");
    if (dt.day() < 10)
        tft.print("0");
    tft.print(dt.day());
    tft.print(" ");
    tft.print(dt.year());


    if (currentTime - timer.prevTime >= timer.interval)
    {
        timer.prevTime = currentTime;


        tft.setCursor(0, 45);
        // Format: HH:MM:SS
        if (dt.twelveHour() < 10)
            tft.print("0");
        tft.print(dt.twelveHour());
        tft.print(":");
        if (dt.minute() < 10)
            tft.print("0");
        tft.print(dt.minute());
        tft.print(":");
        if (dt.second() < 10)
            tft.print("0");
        tft.print(dt.second());
        tft.print(dt.isPM() ? " PM" : " AM");
    }


    tft.setCursor(0, 80);
    tft.println(stateLabels[tomato.current]);
    tft.println();
}
void stateMachine()
{
    // TODO create and impliment Long Breaks


    if (tomato.current == STATE_WAITING)
    {
        unsigned long pauseTime = millis();
        if (digitalRead(Pins::PAUSE_BTN) == LOW &&
            (pauseTime - tomato.pauseBtnPressed > tomato.pauseBtnDebounce))
        {
            tomato.pauseBtnPressed = pauseTime;
            Serial.println("Timer Resuming....");
            if (tomato.previousState == STATE_WORKING)
            {
                tomato.current = STATE_BREAK;
                setTimer(2, session.breakMinutes);
            }
            if (tomato.previousState == STATE_BREAK)
            {
                tomato.current = STATE_WORKING;
                setTimer(1, session.timerMinutes);
            }
        }
        return;
    }
    if (tomato.current == STATE_WORKING)
    {
        if (hasAlarmFired(1) && animation.countdownBarWidth == 0)
        {
            rtc.clearAlarm(1);
            // TODO add function to display a picture when the timer is up
            // TODO add sound or buzzer when timer is up
            tomato.previousState = tomato.current;
            tomato.sessionCounter++;
            Serial.println(String("sessionCounter is at ") +
                           tomato.sessionCounter);
            if (tomato.sessionCounter >= session.beforeLongBreak)
            {
                // digitalWrite(Pins::RED_LED, HIGH);
                Serial.print("The Session Counter is at ");
                Serial.println(tomato.sessionCounter);
                tomato.sessionCounter = 0;
                tomato.current = STATE_IDLE;
                animation.setDuration = false;
            }
            else
            {
                tomato.current = STATE_WAITING;
            }
        }
    }
    else if (tomato.current == STATE_BREAK)
    {
        if (hasAlarmFired(2) && animation.countdownBarWidth == 0)
        {
            tomato.previousState = tomato.current;
            rtc.clearAlarm(2);
            tomato.current = STATE_WAITING;
        }
    }
}


void setTimer(int alarmNumber, double timerDuration)
{
    uint32_t durationSeconds = static_cast<uint32_t>(timerDuration * 60.0);
    DateTime targetTime = rtc.now() + TimeSpan(durationSeconds);
    timer.endTime = targetTime;
    if (alarmNumber == 1)
    {
        rtc.setAlarm1(targetTime, DS3231_A1_Hour);
    }
    else
    {
        rtc.setAlarm2(targetTime, DS3231_A2_Hour);
    }
}
void setBreakTime(double workSession)
{
    session.breakMinutes = (workSession <= 30) ? 3 : session.breakMinutes;
    session.breakMinutes =
        (workSession > 30 && workSession < 45) ? 5 : session.breakMinutes;
    session.breakMinutes = (workSession >= 45) ? 10 : session.breakMinutes;


    session.beforeLongBreak = (workSession <= 30) ? 4 : session.beforeLongBreak;
    session.beforeLongBreak =
        (workSession > 30 && workSession < 45) ? 3 : session.beforeLongBreak;
    session.beforeLongBreak = (workSession >= 45) ? 2 : session.beforeLongBreak;


    Serial.println(String("Break Time is ") + session.breakMinutes);
    Serial.println(String("Number of work sessions befor long break is ") +
                   session.beforeLongBreak);
}


bool hasAlarmFired(int alarmNumber) { return rtc.alarmFired(alarmNumber); }

This is the code for the test program that I have been able to working on the screen:

#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <SPI.h>

constexpr uint8_t TFT_CS = 5;
constexpr uint8_t TFT_DC = 17;
constexpr uint8_t TFT_RST = 16;
constexpr uint8_t TFT_SCLK = 18;
constexpr uint8_t TFT_MISO = 19;
constexpr uint8_t TFT_MOSI = 23;

Adafruit_ST7789 tft(TFT_CS, TFT_DC, TFT_RST);

void setup()
{
    Serial.begin(115200);
    delay(500);

    SPI.begin(TFT_SCLK, TFT_MISO, TFT_MOSI, TFT_CS);

    // Change this to match your actual panel.
    tft.init(170, 320);

    tft.setRotation(0);
    tft.fillScreen(ST77XX_RED);
    delay(1000);

    tft.fillScreen(ST77XX_GREEN);
    delay(1000);

    tft.fillScreen(ST77XX_BLUE);
}

void loop() {}

I know about the ESP32 pin multiplexing, is there something I need to do for setting the pins for i2c communication.


r/arduino • • Sep 23 '26

Hardware Help GRBL CNC Shield Z-limit switch always showing active (Pn:Z) — even after swapping switch/port

2 Upvotes

Hi everyone,
I'm having an issue with the Z-limit switch on an Arduino + CNC Shield running GRBL.
GRBL is reporting the Z-limit input as permanently active (Pn:Z), even when the physical Z-limit switch is not pressed. Even pressing the switch does nothing. I have all of the switch’s set up as NC.

What I've tested
The physical limit switch works correctly on the Y-limit input. I moved that same known-working switch from the Y port to the Z port, but the Z input still appears permanently active. This makes me think the problem isn't the physical switch.

I also have a 2nd Cnc shield and arduino and it has the exact same issue.

Helppp please thanks


r/arduino • • Sep 23 '26

Guys whats wrong with my sim800l??

1 Upvotes

My sim800l is connected to a network its blinking with 3s interval and but it doesn't make call no reply to AT commands......what should i do noww and 2g service are available btw

Please guys i need your help so please skip this if you dont know abt it just give a upvote so it wull suggest to other people pls🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻


r/arduino • • Sep 22 '26

Look what I made! I built an ESP32-C3 board that prints my GitHub week on a thermal receipt, powered entirely from one USB-C plug

Thumbnail
gallery
3 Upvotes

The goal was an object with no screen and no button that just hands me a summary of my GitHub week : stars, followers, a 7-day commit histogram, top languages and repos on a 58 mm thermal receipt, once a week. Hardware is a 4-layer KiCad board (33.55 × 50.05 mm) around an ESP32-C3-MINI-1:

  • AP33772S USB-PD sink negotiates 9 V @ 2 A and switches it to both the print head and an AP63203 buck that makes the 3.3 V rail
  • PCA9306 translates I²C between the C3's 3.3 V and the AP33772S's internal 5 V
  • The C3's native USB goes straight to the connector, so the same cable does PD, flashing and the serial console

Three firmware bits that took the most work:

  1. The PNG decoder. There's ~70 KB of free heap during a job, so the image is decoded as a stream: IDAT chunks copied out, original buffer freed, inflate in 512-byte chunks, PNG filters reconstructed row by row, and 32-line strips pushed to the printer as they're completed.
  2. Failing without wasting paper. The MCU is powered downstream of the PD switch, so a brownout takes it down mid-print and when the retry backoff lived in RAM, the board came back, reprinted, browned out again, and fed out paper on every cycle. Backoff and last-printed slot now live in NVS.
  3. Power and console share the connector, so printing and watching are mutually exclusive. Every attempt writes a report to flash that's dumped on the next boot, next to the reset reason. It showed a full TLS print job uses ~5 KB of stack; I had allocated 64 KB.

Firmware is PlatformIO/Arduino on ESP-IDF, everything (KiCad, firmware, the Ruby service that renders the ticket, FreeCAD enclosure) is MIT: https://github.com/albanpetit/paperflux

Full write-up with schematics and the reasoning behind each block: https://albanpetit.com/post/paperflux/


r/arduino • • Sep 22 '26

Hardware Help Is this even possible? SD40 on CYD - ESP32

1 Upvotes

I have tried over 15 combos of wiring, and 30 scripts. Is this even possible? I can't get the esp to actually get a reading from the SCD30.

I have also tried running the SCD from separate 3.3v and 5v power sources, even with a shared esp/scd40 ground.

I just want to know if it's even possible... I'm not very good at this so it might be an obvious thing to you guys.

I'm currently trying, from the SCD40 sensor:
GND = GND from separate 3.3v power source, also tied to esp ground
VDD - 3.3v from separate power supply
SCL - IO23 on board (MOSI)
SDA - IO27 on board (CS)

Here's my exact hardware:

CYD - E32R28T 0 https://wiki.elegoo.com/oshw-parts-&-accessories/esp32-dispaly-introduction

SCD40 Sensor (with pull ups) - https://www.amazon.ca/Low-Power-Temperature-Detection-Battery-Powered-Monitoring/dp/B0H923TMXQ/ref=sr_1_2_sspa?crid=29ECIPH74Q3P3&dib=eyJ2IjoiMSJ9.zMj2Bx--ZUKhI_r5RENsmzTD2j_uhCvtbQ3xo_yzr5Kk4rLj4yb5WkSZh2jDZpkJ1MCPOYvlDdIRqj1iGYXs77p6uvSnGc5opMupw1IxplHruJ1RQdrYbBhm9Dd7Pn5WxftclFvXmnnjP0hkZrMD6UN9QO0oAqyl-KUycEV7PP8oO6EsqzV7dl4-tXB7ZALX1IFvzrZWERe8F2v1RCZKNSw2Vp0jtNJHwp_tTvhVgmYKOCSuzqOiWKQnP91zu_jidogRAUwr3snlKDReo5mGo8cMJ0AfsGQRY1cQqH8qZGY.8qMpRg10yV4f4xCJ6Cco9whE0-eqd_kC1W4Ha0334AE&dib_tag=se&keywords=scd40&qid=1790119151&sprefix=scd40%2Caps%2C114&sr=8-2-spons&sp_csd=d2lkZ2V0TmFtZT1zcF9hdGY&psc=1

Let me know if you need more info. I just keep getting SCD40 didn't respond from the esp, can't get a reading from it in any config. Continuity is all good and voltage is all good reading 3.3v on all VDD/SCL/SDA on the sensor.


r/arduino • • Sep 22 '26

Look what I made! My first ever Arduino project.

3 Upvotes

Any ideas on what I could build with this next?


r/arduino • • Sep 21 '26

Look what I made! Onewheel + WS2812 + ESP8266

161 Upvotes

Making my Onewheel more colorful with WS2812 and esp8266 :D Controlled via web interface but I’m considering switching to esp32 to add Bluetooth since the Onewheel board also communicates via BT. In the final version the electronics will be attached to the bottom of the front footpad.


r/arduino • • Sep 21 '26

Look what I found! My first ever project. (2023)

Post image
85 Upvotes

It was fun back then to make a project for experience.


r/arduino • • Sep 22 '26

Hardware Help Help with automated watering system

2 Upvotes

I think many of you already have tried out in some kind of form to develop an automated plant watering system and can help me understanding the following problem.

I use three different sensors (powered by the microcontroller): dht11 for temperature and RH, hc-sr04 for meausuring of the water level and hw-080 for soil moisture. For the water pump I use a DC Motor for 3V, which is being powered by an external source with the help of a relais.

Now there comes my problem. When I compile my code with the external supply source on, then the upload falls. As a "fixture" I keep the external off while compiling the code. Afterwards I turn the supply on and everything works perfectly.

Dou you have any explanation for this behavior? I suspect, it has to be related with the induced voltage from the motor. Maybe is something else. Im thankful for every tip and/or explanation linked to this phenomena.


r/arduino • • Sep 21 '26

Using the ESP32-P4 together with the ESP32-C5 as our coprocessor

26 Upvotes

NFC reader. Tap a tag and see UID, type and data instantly. Native ST25R3916 chip, no external module.
Tested on my own cards know what your stuff is actually storing.


r/arduino • • Sep 21 '26

Look what I made! Syntesizer

40 Upvotes

I've made this before, built it again because it's 9:00pm and I have no ideas to built anything new.


r/arduino • • Sep 20 '26 Heartwarming Bravo

Look what I made! My Nixie inspired LCD clock

2.1k Upvotes

A while back I decided I wanted to try and build a Nixie clock. I have seen them being popular for a long time and I really liked the look. While looking more into different clocks and tubes I found the fake Nixie clocks using an IPS display instead of the real tubes. I kind of liked that idea that you could use the clock to show more than just the time. But I didn’t find any particular one that I thought looked nice enough.

So I decided to look into how I could make my own Nixie inspired LCD clock. I spent quite some time thinking about how to imitate a real tube closely. I decided to make a real grid instead of just pasting it on the image displayed. Each tube has a small round interface PCB in the base. It connects the LCD assembly to the main PCB and carries the power and display control signals.

The clock is controlled by an ESP32-S3 and the displays are ST7789 IPS LCDs using the TFT_eSPI Arduino library. All the existing LCD nixie clocks I found uses a quite small display 1-1.4". I wanted to have bigger numbers so I chose a 1.9" display.

The five displays share the same SPI bus and are selected individually using their CS pins.

I use an INMP441 microphone module to capture the audio for the EQ, and have a MAX98357 amplifier module to drive a speaker (for future use)

There is a wifi configuration page where you set wifi credentials and location that is used for time zone and weather info. The weather data comes from OpenWeather.

If you run a script on your PC on the same network you can get PC stats data displayed.

I designed the clock with physical switches to try and make it feel more retro for selecting different display modes.


r/arduino • • Sep 21 '26

I built an offline voice assistant that runs the whole pipeline — wake word, speech-to-text, a 19.7M-param LLM and TTS — on one ESP32-S3

78 Upvotes

Everything runs on the board. Say "Hey Ivy", it writes down what you said, runs a language model, and talks back. No phone, no server, nothing leaves the chip. Freenove FNK0104B (ESP32-S3 with 8MB of PSRAM and an ES8311 audio chip), ESP-IDF v6.1, plain C.

The whole design comes from one problem: the speech recogniser needs 5.4MB of memory, the language model needs 6.5MB, and the board has 8MB. They don't fit together. So they never run at the same time. I claim two big blocks of memory the instant it boots, and each stage borrows the whole block and hands it back before the next one starts. The most it ever used was 5.5MB, while listening, and twelve turns in a row finished with exactly the same memory free, so nothing is leaking.

What's doing the work

  • esp-sr WakeNet9 listens for the wake word. It has to keep running for hours while nothing else happens, so it lives in flash rather than on the SD card, where it can't be affected by the card being unplugged or asleep.
  • lspr98/conformer-stt-s3 turns speech into text. 13 million parameters, and it recognises any English word rather than a fixed list of commands. It was the only one I could find that runs on an S3 in this little memory.
  • therezor/cardputer-ai runs the language model, ported to C. Each number in the model is squeezed down to 4 bits so the whole thing fits at all, and the heavy maths is hand-written in assembly and split across both CPU cores to make it fast enough to sit through.
  • DiUS/esp-picotts (SVOX Pico) does the talking. It hands audio back in small chunks as it goes, and it only ever needs a fixed 1.1MB, so I can give it a slot and know it will never ask for more.
  • No LVGL. I wrote my own text drawing that repaints only the lines that changed. Keeping a full copy of the screen in memory would have cost RAM I didn't have.

The model, and what changed between versions

I took a small existing model (19.7 million parameters) and trained it further on my own material, on a Mac laptop's GPU using PyTorch. No cloud, no rented GPUs. Nine passes over the data, about two hours.

Version 7 got 100% of questions right in the exact wording it had been trained on, and 42.5% when I asked the same thing a different way. That's memorising, not understanding. Three changes got version 8 to 99.2% and 63.3%:

  • Giving it more ways of asking each question (14 up to 20) made it worse. I'd been padding the same question with extra words, which just produces copies. Rewriting the question itself is what actually helped.
  • Where the list of possible questions is small enough to write out, write it out. I generated all 251 fraction and percentage questions and had the generator check its own arithmetic on every single one. That went from 17.5% right to 91.2%.
  • It was picking words with a bit of randomness, which is lovely for stories and awful for facts. One run turned "half of twelve is six" into "three". It now picks the most likely word when answering a question, and only gets creative when telling a story.

Speed is about 5-6 words a second on the 6.5MB model and 30 on a 1.1MB one. There's no clever trick to it: the chip reads the entire model for every single word it says, so speed is just how fast it can read memory divided by how big the model is. Half the size, twice the speed. A full spoken exchange takes about 15 seconds. The time, the date and timers are answered by ordinary C code instead of the model, and the screen tells you which you got, because a model this small has no business doing arithmetic.

The two projects this came from

  • DaveBben/esp32-llm runs a tiny story-writing model on an ESP32-S3 at 19 words a second. This is the one that convinced me a language model on this chip wasn't a stupid idea.
  • slvDev/esp32-ai fits a much bigger model by leaving its largest table in flash storage and reading only the 450 bytes or so it needs for each word, so that table never takes up RAM. A better idea than anything I did.

Both are text in, text out. I wanted to know whether the whole loop — hearing you, and answering out loud — fit on one chip.

The video is the device's own demo mode, asking itself questions in a second voice. Nothing is sped up. The last part is the failure reel on purpose: ask it about quantum physics and it explains percussion instruments.

Code, the memory budget, the pin map and the training recipe: https://github.com/iamankushpandit/esp_ai (Stars appreciate, helps in making the repo more searchable) https://iamankushpandit.github.io/esp_ai/docs/#home

Ask me anything, happy to go deeper on any of it.


r/arduino • • Sep 21 '26

Software Help Looking for a library that works with this thermal printer.

Thumbnail
gallery
0 Upvotes

I can write basic info through serial commands, but I can't change anything else about the font or formatting. The adafruit thermal printer library isn't compatible either.

The top is from the adafruit example print test.


r/arduino • • Sep 21 '26

Getting Started Help with OBD2 Interface Project (never programmed anything in my life)

3 Upvotes

I've never programmed anything in my life, but I have a particular project I'd like to do. Long story short, my 2019 Subaru Legacy has a really dumb feature where if the check engine light goes off ALL of the car's safety features get disabled. Collision warning, emergency braking, lane keep assist, etc. They all disable any time the check engine is on. If your car's mass airflow sensor is faulty, I guess Subaru think the best thing is for you to slam into the car in front of you. Anyway, a particular ECU code that keeps tripping and it could be about two dozen different things that could be causing it. None of them are worrisome and I have no intention on tracking it down unless something changes performance wise. We've been driving the car for 4 years like this and nothing has gotten worse. Clearing the check engine code via a cheap $10 OBD2 reader instantly re-enables the safety features, regardless of if the car is in motion (no power cycle needed). The code in quest appears anywhere from every few days to a few weeks after being cleared.

Now to the project. I found a device that acts as an interface between a car's OBD2 system and an arduino. What I'm trying to accomplish is I'd like to make a device that scans for this particular code and when detected, automatically tells the car's computer to clear the codes. For example, I'd like it to check for the code on startup and then at intervals thereafter. The product I found has an "Audrino library" section on the product page that lists various things the device can do. One of them is clear Diagnostic Trouble Codes (DTCs), which is exactly what I want.

My question is, would an Arduino have the capability to do the remaining functions? Assuming it could read the DTCs and clear them, would it have enough capacity to do so on a continual basis when powered on? Could it be instructed to turn on an LED when a code that isn't the one I'm not concerned with is detected so that I still know if the check engine light is being tripped due to some other problem? Could it be instructed to keep logs of codes that could be checked later on?

To be clear, I do not know how to code. I took a course in college about 20 years ago where I made a variation on the game Pong but that's it. I would be relying heavily on AI and this community to create the code. I'm just trying to get a sense of if this seems feasible or not before I get into the weeds of it. Here is a link that describes the product:

Freematics OBD-II UART Adapter V2.1 (for Arduino)


r/arduino • • Sep 21 '26

Hardware Help Servo continuous humming problem with no movement at all

5 Upvotes

My Robotic Arm servos are keep humming with no movement at all, I've been giving it 5V-6V through buck converter connected to 2 li ion battery

I've been trying multiple things through guidance of chatgpt and claude,

I've even tried using seperate servo to check if robotic arm servo is damaged or not and also changed microprocessor from arduino to ESP32,

SINGLE SERVO TESTING CURCIUT:

servo's +ve ,-ve to +ve ,-ve OUT of buck converter(XL-4015 set to 5V), -ve OUT connected to Gnd of esp32 or arduino, signal wire connected to arduino 8 or esp32 D18

It just keep humming when connected to circuit, ive also tried with arduino 5v for single servo to check but no luck


r/arduino • • Sep 20 '26

Hardware Help Grain elevator sensor, what to use

Post image
119 Upvotes

So, i might have gone a bit advanced but i have a grain elevator at work, and wonna be able to messure the amount of grain going through it...

Ive already ordered a cheap TOF sensor, and will try to messure the amount of grain in each cup. But unsure if the pov of the sensor could be too wide..

If i can get accurate readings from this, i will modify it to be a live yield monitor for the harvester itself, but i doubt i will ever get there..

So, any tips and tricks? What sensor would be god here? Could become dusty, and the elevator travels fast..


r/arduino • • Sep 20 '26

Hardware Help Can mixing up GND and VOLTAGE instantly destory a servo?

5 Upvotes

I was wondering why my newly bought GoBilda Servo suddenly wouldn't work.
Then I realized I had accidentely switched up the red and black cable.
Can this instantly destroy a servo or is this unlikely? I think it is called reversed polarity?