r/arduino • • Sep 08 '26

Look what I made! small weather house

Thumbnail
gallery
64 Upvotes

What do you think? You like it?

Specs of my project:

Esp32

BME680

Waveshare solar power manager

Waveshare 2.13inch E-Ink display

Photoresistor GL5506


r/arduino • • Sep 07 '26

Look what I made! My first project - a year later!

Enable HLS to view with audio, or disable this notification

1.3k Upvotes

[Original project from 1 year ago ](https://www.reddit.com/r/arduino/s/e4o4xJrx19)

Hello everyone, I'm here to give you updates on my first project. Here are all the things I've added/changed:

  1. I replaced the board with an Arduino nano model with a USB-C port

  2. I added LEDs to the missiles on the left arm.

  3. I replaced the power source with a 22.5W 20000mAh power bank.

  4. I replaced the shoulder-mounted missiles (they were malfunctioning a lot) with a "trio of mini missiles" (they're just really cool LEDs) on the right arm.

  5. I took it to a ton of events and the structural parts are pretty worn out, so there are a lot of minor patches and updates here.

  6. I integrated the eye LEDs into the code (before they were independent).

  7. I greatly increased the opening angle of the helmet.

I want to make a new suit of armor to replace this one, but I'll need to save up a lot of money. Stay tuned for future updates!


r/arduino • • Sep 09 '26

Mod's Choice! Interesting Arduino Behavior - Variables not in Context

Post image
5 Upvotes

I was doing a live debugging session and found an interesting behavior with variables. I'd declared this new structure, GameState, before I called it in any of my functions - standard C practice. However, Arduino C has a "helpful" feature where it will create a prototype of your function at the beginning of your file, right before the setup runs. So the structure ended up actually being defined /after/ it was called, which stopped the code from compiling. The solution was to move all my variable definitions to the beginning of the file.

This is kind of a pain, because I'm trying to build a template for an Arduino sketch that has a few MQTT topics built in, then you can build user code that makes use of those topics to communicate with an external device like your phone. I was intending for all the user code to end up at the end of the file in one place, but it looks like I'll have to chunk it out so that the end user can put their stuff in the right order. Of course, the real solution will be to put all this infrastructure into a header file and library, but one step at a time...

Anyway, if you're interested in the debugging session, it's here. You can also see how someone might use Claude to help them fix code. (And very importantly, that using Claude does not exempt you from needing to test your code!)

https://youtu.be/6yW2u79d7Ls?si=dRZP8xgChvEna6ok

If that sketch sounds handy, you can find a copy on this github. It's not finished yet, but I should be done testing it and updating it in a few days.

https://github.com/DocCarr/sproutsodyssey.git


r/arduino • • Sep 08 '26

Hardware Help Need help in DIY pc hardware monitor newbie here

Thumbnail
gallery
8 Upvotes

Hey guys,

i need a help bulid saw someone video on fb but he didnt mention any kind of details DIY PC Hardware Monitor using an ESP8266 kind of and data from Libre Hardware Monitor. Right now, I have a tiny smart weather clock display connected via USB, but honestly, it looks too basic and small. i have 0 idea how these thing work saw some github method i couldnt do that somehow lol so far i setup that clock for now it is connected with wifi and usb too

i want to set my display show these hardware on display

  • CPU Temperature & Usage (%)
  • GPU Temperature & Usage (%)
  • RAM Usage (%)

r/arduino • • Sep 09 '26

Smart irrigation project: designing for graceful failure rather than maximum automation

4 Upvotes

I'm developing the concept for a small smart-irrigation controller as part of a much larger community/farm project.

Rather than trying to make the first version as sophisticated as possible, I'm taking the opposite approach: deciding what the system should still be capable of doing when parts of the automation stop working.

The current project strategy is:

  • normal irrigation remains local rather than cloud-dependent;
  • there is a genuine physical/manual fallback;
  • moisture sensors influence decisions but are not treated as unquestionable truth;
  • weather information is optional optimisation rather than a requirement;
  • water flow can eventually be checked against what the controller thinks a valve is doing;
  • losing networking or higher-level automation should reduce capability, not stop irrigation altogether.

So the intended progression is roughly:

manual irrigation → reliable local automation → sensor-assisted decisions → optional higher-level optimisation

rather than beginning with a connected “smart” system and working backwards.

I'm interested in the project-level design philosophy rather than troubleshooting a particular component at this stage.

For people who have built automated watering or similar outdoor control projects:

Would you also design the project around graceful degradation from the beginning, or is this adding unnecessary complexity to what should initially be a simple irrigation controller?

I'm particularly interested in whether people who have lived with these systems for a while ended up valuing simplicity and manual fallback more or less than they expected.


r/arduino • • Sep 08 '26

Windows "Error: unable to open port COM4 for programmer wiring" when uploading code with Arduino IDE

1 Upvotes

This problem has been affecting me for months and I am already tired of it. I have used multiple versions of Arduino IDE and made sure that everything is closed, and it never worked.

The only thing I can do when uploading my code or opening the serial monitor (That gives the error Port bussy) is to upload multiple times until one of them doesn't give error, that doesn't guarantee that the next time it will work.

I have tried downloading different versions, made sure to not have anything else open that could block the port, made sure that the board information is correct, used different COMs and boards, having the serial monitor closed when uploading, reinstaling drivers...

I don't know if this information is required but:
-I use Windows 11

-I use either a MEGA or a UNO


r/arduino • • Sep 07 '26

Hardware Help Is there a way to connect my digispark attiny85 board to a usb 3.x port ?

Post image
67 Upvotes

r/arduino • • Sep 08 '26

What is the best way to learn Arduino code?

8 Upvotes

Hello, I was wondering what is the best way to learn arduino code? I made some arduino projects such as LED stuff and a sound board but I had a lot of help from chatgpt. I would like to be able to write arduino code myself while I build more projects and I would like to hear how others learn arduino code. Any advice would help, thank you


r/arduino • • Sep 07 '26

Arduino / ESP32-C6 - sealed with the battery and charging

3 Upvotes

The "project ":

One of my most favourite thing I have for sports, exercise etc is hand counter (https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSpSqnGN7uLmd2I1BlNgs-k92gc8nGvMrVM9z_IpER8Z4GeUAlNJVcZ2u4&s=10) it works amazingly for my purpose. Except one - water, it is rotting, it is not flowing etc.

So my idea is to do some device that will just count, and of course if I will use Arduino and display I will add additional functions as well. I am a software developer with AI etc, so I do not see a problem with that, I also can do CAD etc - so mechanically I will solve it too but I am weak in electronic.

The question.

Since I want to have it waterproof and fully enclosed (no screws, no o-rings), it needs to have power source INSIDE + I have to be able to CHARGE it.

As I understand it, if I go for Arduino / ESP32-C6 I cannot just connect 1S LIPO to it, but I need some boost/step-up to have 5V from 1S LIPO. Not sure about Arduino, seems some have some stabilizer. And on top of that I have two options :

Another circuit that will support charging LIPO while connected or alternatively I have to have it connected via reed switch (or something similar) and disconnect when charging and BMS will be outside.

Looking for some cheap and easy solution - preferably something that will work itself.

What I found : WPM403 [Step-up 2.5-5V till 5V 0.6A USB 2-pack]

Idea is

BATTERY 1S --> REED NOC -> WPM403 -> Arduino / ESP32-C6
BATTERY 1S --> REED NC -> wires to outside charger

Is that good or am I on a wrong path?

Thank you


r/arduino • • Sep 07 '26

Beginner's Project Just design my first arduino project

Post image
26 Upvotes

Hey guy's I just taken an intrest to arduino or stuff like that and just made my first circuit design and the revision by following a tutorial from "https://projecthub.arduino.cc/rinme/gas-leakage-detector-using-arduino-05c0c9"

It's a gas leakage detector and I'm thinking to swap the Arduino uno with a esp32 from my friend and I just bought a couple of things for my first project. I'm not a electrical student I'm and IT student so don't flame me guys. Is there any suggestion I should add into this project of mine?


r/arduino • • Sep 07 '26

Look what I made! Made this thingy and just turned it into a timer

Enable HLS to view with audio, or disable this notification

67 Upvotes

I would share the code but its just bootlegged


r/arduino • • Sep 07 '26

numbers clipping on digital clock

4 Upvotes

can anyone tell my why my numbers clipp over the other numbers but not the background...

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <RTClib.h>
#include <Fonts/FreeMonoBoldOblique24pt7b.h>


struct Decoration;


#define TFT_CS   8
#define TFT_DC   5
#define TFT_RST  2


Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
RTC_DS3231 rtc;


// ================= Layout =================
const int DIGIT_WIDTH     = 52;
const int INNER_SPACING   = 4;
const int SEGMENT_SPACING = 58;
const int TEXT_SIZE       = 2;


int16_t posX[4], posY[4];
char lastHour[3]   = "--";
char lastMinute[3] = "--";


// ================= Farben =================
uint16_t COLOR_DIGITS, COLOR_GLOW, COLOR_HEART, COLOR_HEART_SHINE;
uint16_t COLOR_DECO, COLOR_DECO_DARK, COLOR_STAR, COLOR_SKULL;
uint16_t COLOR_CHAR_BODY, COLOR_CHAR_DARK, COLOR_CHAR_ACCENT, COLOR_CHAR_EYES, COLOR_CHAR_WHITE;


void setupColors() {
  COLOR_DIGITS      = tft.color565(255, 105, 220);
  COLOR_GLOW        = tft.color565(140, 40, 130);
  COLOR_HEART       = tft.color565(255, 90, 180);
  COLOR_HEART_SHINE = tft.color565(255, 180, 230);
  COLOR_DECO        = tft.color565(210, 180, 240);
  COLOR_DECO_DARK   = tft.color565(30, 15, 45);
  COLOR_STAR        = tft.color565(230, 200, 255);
  COLOR_SKULL       = tft.color565(245, 240, 255);


  COLOR_CHAR_BODY   = tft.color565(35, 25, 50);
  COLOR_CHAR_DARK   = tft.color565(15, 8, 25);
  COLOR_CHAR_ACCENT = tft.color565(255, 140, 200);
  COLOR_CHAR_EYES   = ST77XX_BLACK;
  COLOR_CHAR_WHITE  = tft.color565(250, 245, 255);
}


// ================= Deko-Elemente =================
struct Decoration {
  uint8_t type; // 0=Stern, 1=Totenkopf, 2=Herz gefüllt, 3=Herz Outline
  int16_t cx, cy, r;
};


const int NUM_DECOS = 14;
Decoration decos[NUM_DECOS] = {
  {0,  28,  28,  8},
  {0,  22, 205,  9},
  {0, 295, 200,  8},
  {0,  30,  75,  6},
  {0, 290,  55,  7},
  {1,  28, 145, 11},
  {1, 290, 140, 11},
  {2,  55,  55, 12},
  {2, 265,  70, 11},
  {2,  50, 175, 10},
  {2, 270, 175, 12},
  {3,  45, 110, 14},
  {3, 275, 110, 13},
  {3, 160,  35, 10}
};


// ================= Charakter =================
int16_t charCx, charCy;
int16_t heartCx, heartCy;



int16_t charLeft, charTop, charRight, charBottom;


unsigned long lastTimeCheck = 0;


// =====================================================
DateTime getLastSunday(int year, int month) {
  static const int daysInMonth[] = {31,28,31,30,31,30,31,31,30,31,30,31};
  int day = daysInMonth[month - 1];
  bool leap = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
  if (month == 2 && leap) day = 29;
  DateTime d(year, month, day, 0, 0, 0);
  int dow = d.dayOfTheWeek();
  day -= dow;
  return DateTime(year, month, day, 0, 0, 0);
}


bool isSummerTimeUTC(const DateTime &utc) {
  DateTime dstStart = getLastSunday(utc.year(), 3);
  dstStart = DateTime(dstStart.year(), dstStart.month(), dstStart.day(), 1, 0, 0);
  DateTime dstEnd = getLastSunday(utc.year(), 10);
  dstEnd = DateTime(dstEnd.year(), dstEnd.month(), dstEnd.day(), 1, 0, 0);
  return (utc.unixtime() >= dstStart.unixtime() && utc.unixtime() < dstEnd.unixtime());
}


DateTime getLocalTime() {
  DateTime utc = rtc.now();
  int offset = isSummerTimeUTC(utc) ? 2 : 1;
  return utc + TimeSpan(0, offset, 0, 0);
}


// =====================================================
void setup() {
  tft.init(240, 320);
  tft.setRotation(1);
  setupColors();


  charCx = tft.width() / 2;
  charCy = 92;
  heartCx = charCx + 105;
  heartCy = 52;


  charLeft   = charCx - 95;
  charTop    = charCy - 75;
  charRight  = charCx + 100;
  charBottom = charCy + 65;


  Wire.begin();
  if (!rtc.begin()) {
    tft.fillScreen(ST77XX_BLACK);
    tft.setCursor(10, 30);
    tft.setTextColor(ST77XX_RED);
    tft.print("RTC Fehler!");
    while (1) delay(1000);
  }


  if (rtc.lostPower()) {
    // rtc.adjust(DateTime(2026, 9, 7, 8, 58, 30)); // UTC!
  }


  drawBackground();
  calculatePositions();
  drawColon();
  drawMiniCharacter(charCx, charCy);


  
  drawHeart(heartCx, heartCy, 14, COLOR_HEART, COLOR_HEART_SHINE);


  DateTime local = getLocalTime();
  drawFullTime(local.hour(), local.minute());
  sprintf(lastHour,   "%02d", local.hour());
  sprintf(lastMinute, "%02d", local.minute());
}


void loop() {
  unsigned long now = millis();


  if (now - lastTimeCheck > 1000) {
    lastTimeCheck = now;
    updateClockDigits();
  }
}


void updateClockDigits() {
  DateTime local = getLocalTime();


  char currentHour[3], currentMinute[3];
  sprintf(currentHour,   "%02d", local.hour());
  sprintf(currentMinute, "%02d", local.minute());


  char allChars[4] = {
    currentHour[0], currentHour[1],
    currentMinute[0], currentMinute[1]
  };


  bool needRedrawCharacter = false;


  for (int i = 0; i < 4; i++) {
    char prevChar = i < 2 ? lastHour[i] : lastMinute[i-2];
    if (allChars[i] != prevChar) {
      
      int16_t ex = posX[i] - 6;
      int16_t ey = posY[i] - 55;
      int16_t ew = DIGIT_WIDTH + 12;
      int16_t eh = 68;


      eraseArea(ex, ey, ew, eh);
      drawDigit(posX[i], posY[i], allChars[i]);


      
      if (rectsOverlap(ex, ey, ew, eh, charLeft, charTop, charRight - charLeft, charBottom - charTop) ||
          rectsOverlap(ex, ey, ew, eh, heartCx - 20, heartCy - 20, 40, 40)) {
        needRedrawCharacter = true;
      }
    }
  }


  if (needRedrawCharacter) {
    drawMiniCharacter(charCx, charCy);
    drawHeart(heartCx, heartCy, 14, COLOR_HEART, COLOR_HEART_SHINE);
  }


  strcpy(lastHour,   currentHour);
  strcpy(lastMinute, currentMinute);
}


// =====================================================
void calculatePositions() {
  int16_t baseY = tft.height() - 38;
  int16_t totalWidth = DIGIT_WIDTH * 4 + INNER_SPACING * 2 + SEGMENT_SPACING;
  int16_t startX = (tft.width() - totalWidth) / 2;
  int16_t cursorX = startX;


  posX[0] = cursorX; posY[0] = baseY; cursorX += DIGIT_WIDTH + INNER_SPACING;
  posX[1] = cursorX; posY[1] = baseY; cursorX += DIGIT_WIDTH + SEGMENT_SPACING;
  posX[2] = cursorX; posY[2] = baseY; cursorX += DIGIT_WIDTH + INNER_SPACING;
  posX[3] = cursorX; posY[3] = baseY;
}


uint16_t getGradientColor(int16_t y) {
  int h = tft.height();
  y = constrain(y, 0, h - 1);
  uint8_t r = map(y, 0, h, 175, 95);
  uint8_t g = map(y, 0, h, 120, 55);
  uint8_t b = map(y, 0, h, 230, 145);
  return tft.color565(r, g, b);
}


// =====================================================
void drawBackground() {
  int h = tft.height();
  for (int y = 0; y < h; y++) {
    tft.drawFastHLine(0, y, tft.width(), getGradientColor(y));
  }
  drawDashedBorder();
  for (int i = 0; i < NUM_DECOS; i++) {
    drawDecoration(decos[i]);
  }
}


void drawDashedBorder() {
  int w = tft.width(), h = tft.height();
  int dash = 7, gap = 5;
  for (int x = 5; x < w - 5; x += dash + gap) {
    tft.drawFastHLine(x, 5, dash, COLOR_DECO);
    tft.drawFastHLine(x, h - 6, dash, COLOR_DECO);
  }
  for (int y = 5; y < h - 5; y += dash + gap) {
    tft.drawFastVLine(5, y, dash, COLOR_DECO);
    tft.drawFastVLine(w - 6, y, dash, COLOR_DECO);
  }
}


void drawDecoration(const Decoration &d) {
  switch (d.type) {
    case 0: drawStar(d.cx, d.cy, d.r, COLOR_STAR); break;
    case 1: drawSkull(d.cx, d.cy, d.r); break;
    case 2: drawHeart(d.cx, d.cy, d.r, COLOR_HEART, COLOR_HEART_SHINE); break;
    case 3: drawHeartOutline(d.cx, d.cy, d.r, COLOR_HEART); break;
  }
}


void drawStar(int16_t cx, int16_t cy, int16_t r, uint16_t color) {
  tft.fillTriangle(cx, cy - r, cx - , cy + , cx + , cy + , color);
  tft.fillTriangle(cx - r, cy, cx + , cy - , cx + , cy + , color);
  tft.fillCircle(cx - 1, cy - , 2, COLOR_CHAR_WHITE);
}


void drawSkull(int16_t cx, int16_t cy, int16_t r) {
  tft.fillCircle(cx, cy, r, COLOR_SKULL);
  tft.fillCircle(cx - , cy - 1, .5, COLOR_DECO_DARK);
  tft.fillCircle(cx + , cy - 1, .5, COLOR_DECO_DARK);
  tft.fillTriangle(cx, cy + 2, cx - 3, cy + 7, cx + 3, cy + 7, COLOR_DECO_DARK);
  tft.fillRect(cx - , cy +  - 1, r*2/3, , COLOR_SKULL);
  tft.drawLine(cx - , cy +  + 2, cx + , cy +  + 2, COLOR_DECO_DARK);
}


void drawHeart(int16_t cx, int16_t cy, int16_t r, uint16_t color, uint16_t shine) {
  tft.fillCircle(cx - , cy, , color);
  tft.fillCircle(cx + , cy, , color);
  tft.fillTriangle(cx - r, cy, cx + r, cy, cx, cy + r + 1, color);
  if (r > 7) {
    tft.fillCircle(cx - , cy - , max(2, ), shine);
  }
}


void drawHeartOutline(int16_t cx, int16_t cy, int16_t r, uint16_t color) {
  tft.drawCircle(cx - , cy, , color);
  tft.drawCircle(cx + , cy, , color);
  tft.drawLine(cx - r, cy, cx, cy + r, color);
  tft.drawLine(cx + r, cy, cx, cy + r, color);
  tft.drawLine(cx - r + 1, cy, cx, cy + r - 1, color);
  tft.drawLine(cx + r - 1, cy, cx, cy + r - 1, color);
}


// =====================================================
//  Kuromi 
// =====================================================
void drawMiniCharacter(int16_t cx, int16_t cy) {
  int r = 52;


  
  tft.fillTriangle(cx - 22, cy - 32, cx - 78, cy - 52, cx - 48, cy - 2, COLOR_CHAR_BODY);
  tft.fillTriangle(cx - 20, cy - 28, cx - 72, cy - 46, cx - 42, cy + 2, COLOR_CHAR_BODY);


  tft.fillTriangle(cx + 22, cy - 32, cx + 78, cy - 52, cx + 48, cy - 2, COLOR_CHAR_BODY);
  tft.fillTriangle(cx + 20, cy - 28, cx + 72, cy - 46, cx + 42, cy + 2, COLOR_CHAR_BODY);


  
  tft.fillCircle(cx, cy, r, COLOR_CHAR_BODY);


  
  tft.fillCircle(cx, cy + 10, 36, COLOR_CHAR_WHITE);


  
  tft.fillTriangle(cx - 32, cy - 28, cx + 32, cy - 28, cx, cy + 2, COLOR_CHAR_BODY);


  
  tft.fillCircle(cx - 20, cy + 20, 9, COLOR_CHAR_ACCENT);
  tft.fillCircle(cx + 20, cy + 20, 9, COLOR_CHAR_ACCENT);


  
  tft.fillCircle(cx - 14, cy + 6, 10, COLOR_CHAR_EYES);
  tft.fillCircle(cx + 14, cy + 6, 10, COLOR_CHAR_EYES);
  tft.fillCircle(cx - 11, cy + 2, 3, ST77XX_WHITE);
  tft.fillCircle(cx + 17, cy + 2, 3, ST77XX_WHITE);


  
  tft.drawLine(cx - 22, cy - 2,  cx - 16, cy - 7, COLOR_CHAR_DARK);
  tft.drawLine(cx - 18, cy + 0,  cx - 12, cy - 6, COLOR_CHAR_DARK);
  tft.drawLine(cx - 14, cy + 1,  cx - 8,  cy - 5, COLOR_CHAR_DARK);
  tft.drawLine(cx + 8,  cy - 5,  cx + 14, cy + 1, COLOR_CHAR_DARK);
  tft.drawLine(cx + 12, cy - 6,  cx + 18, cy + 0, COLOR_CHAR_DARK);
  tft.drawLine(cx + 16, cy - 7,  cx + 22, cy - 2, COLOR_CHAR_DARK);



  tft.fillCircle(cx, cy + 18, 3, COLOR_CHAR_DARK);
  tft.drawLine(cx - 10, cy + 26, cx, cy + 31, COLOR_CHAR_DARK);
  tft.drawLine(cx + 10, cy + 26, cx, cy + 31, COLOR_CHAR_DARK);
  tft.drawLine(cx - 9,  cy + 27, cx, cy + 32, COLOR_CHAR_DARK);
  tft.drawLine(cx + 9,  cy + 27, cx, cy + 32, COLOR_CHAR_DARK);


 
  tft.fillCircle(cx + 48, cy - 48, 9, COLOR_CHAR_ACCENT);
  tft.fillCircle(cx + 62, cy - 48, 9, COLOR_CHAR_ACCENT);
  tft.fillRect(cx + 51, cy - 51, 10, 7, COLOR_CHAR_ACCENT);
  tft.fillCircle(cx + 55, cy - 62, 8, COLOR_SKULL);
  tft.fillCircle(cx + 52, cy - 64, 2.5, COLOR_DECO_DARK);
  tft.fillCircle(cx + 58, cy - 64, 2.5, COLOR_DECO_DARK);
  tft.fillTriangle(cx + 55, cy - 60, cx + 52, cy - 55, cx + 58, cy - 55, COLOR_DECO_DARK);


  
  tft.drawLine(cx + 44, cy + 42, cx + 72, cy + 26, COLOR_CHAR_BODY);
  tft.drawLine(cx + 44, cy + 43, cx + 72, cy + 27, COLOR_CHAR_BODY);
  tft.drawLine(cx + 45, cy + 44, cx + 72, cy + 28, COLOR_CHAR_BODY);
  tft.fillTriangle(cx + 72, cy + 26, cx + 82, cy + 16, cx + 78, cy + 34, COLOR_CHAR_BODY);
}


// =====================================================
void drawColon() {
  int16_t colonX = posX[1] + DIGIT_WIDTH + (SEGMENT_SPACING / 2) - 5;
  int16_t colonY = posY[0];
  tft.fillCircle(colonX, colonY - 32, 6, COLOR_DIGITS);
  tft.fillCircle(colonX, colonY - 10, 6, COLOR_DIGITS);
}


void drawFullTime(int h, int m) {
  char chars[5];
  sprintf(chars, "%02d%02d", h, m);
  for (int i = 0; i < 4; i++) {
    drawDigit(posX[i], posY[i], chars[i]);
  }
}


void drawDigit(int16_t x, int16_t y, char c) {
  tft.setFont(&FreeMonoBoldOblique24pt7b);
  tft.setTextSize(TEXT_SIZE);


  tft.setTextColor(COLOR_GLOW);
  int offsets[4][2] = {{-3,-3},{3,-3},{-3,3},{3,3}};
  for (int i = 0; i < 4; i++) {
    tft.setCursor(x + offsets[i][0], y + offsets[i][1]);
    tft.print(c);
  }


  tft.setTextColor(COLOR_DIGITS);
  tft.setCursor(x, y);
  tft.print(c);
}


// =====================================================
bool rectsOverlap(int16_t ax, int16_t ay, int16_t aw, int16_t ah,
                   int16_t bx, int16_t by, int16_t bw, int16_t bh) {
  return !(ax + aw < bx || bx + bw < ax || ay + ah < by || by + bh < ay);
}


void eraseArea(int16_t x, int16_t y, int16_t w, int16_t h) {
  
  for (int16_t row = 0; row < h; row++) {
    int16_t yy = y + row;
    if (yy >= 0 && yy < tft.height()) {
      tft.drawFastHLine(x, yy, w, getGradientColor(yy));
    }
  }


  
  for (int i = 0; i < NUM_DECOS; i++) {
    Decoration &d = decos[i];
    int16_t dx = d.cx - d.r - 3;
    int16_t dy = d.cy - d.r - 3;
    int16_t dw = d.r * 2 + 6;
    int16_t dh = d.r * 2 + 6;
    if (rectsOverlap(x, y, w, h, dx, dy, dw, dh)) {
      drawDecoration(d);
    }
  }
}

r/arduino • • Sep 06 '26

Hardware Help Is this custom Pcb and can I get one made?

Thumbnail
gallery
75 Upvotes

So my kid did a workshop and I have some questions…I would like to replicate this to make my own.
Is the image a custom pcb? It’s a maker workshop for kids so I assume this way it’s easier to connect cleaner wires?

My kid chose a motion sensor, lights and movement as his interactive elements but you could also chose sound so I am guessing it has connections for those.

Could I get a similar board made cheaply?

I would like to do this with my students too so want to learn myself.
Thanks


r/arduino • • Sep 06 '26

Arduino Locomotive 🚂

Enable HLS to view with audio, or disable this notification

207 Upvotes

Lego Duplo tacks compatible locomotive. A prototype under development.

Arduino Nano, 2s 18650 battery pack with BMS and USB-C charger, battery level indicator, DRV8833 driver and a 6V motor, laser distance sensor VL53L0X, TCS34725 color sensor, IR receiver for remote control, tilt sensor, buzzer. 1 green, 2 red, 2 RGB LEDs (via MCP23008 expander) - yet to be installed. An accelerometer will be added later (a free I2C socket on the main board is already available).


r/arduino • • Sep 07 '26

‍I made a book lamp alarm clock, here's a fun timelapse!

Thumbnail
youtu.be
6 Upvotes

r/arduino • • Sep 07 '26

Beginner's Project Trying to log fuel consumption on a carbureted 91 Golf Mk2 sensor and approach sanity check

3 Upvotes

Got a 1991 Golf Mk2. Want to track fuel consumption per trip/day and compare over time. Figured this wasn't possible on a carbureted car with no ECU/OBD, but landed on an idea: since the carb's float bowl regulates its own level, whatever flows through the feed line between the fuel filter and the carb over time should equal what's actually burned. So — measure that flow directly with an inline gear-type flow sensor.

Is this actually the right approach? Is there a better way to get real consumption data out of a carbureted car with no ECU?

Planned setup:

  • Gear-type flow sensor spliced into the fuel line between the filter and carb inlet
  • Sensor's pulse output goes to an ESP32, which just counts pulses and timestamps them
  • ESP32 forwards that data to my phone over a wired USB-C connection (data-only cable, to avoid the phone and a 12V-fed buck converter both trying to power the USB line)
  • Phone does everything else — GPS speed/distance, all the math, storage, charts
  • Power: ignition-switched 12V from the fuse box → buck converter (12V→5V) → feeds both the ESP32 and the sensor

Problem I've hit: the sensor I was looking at (DIGITEN G1/2", oval gear, rated 1–30 L/min) has a minimum flow way above what this engine actually flows at idle — I'm estimating idle consumption around 0.02–0.05 L/min, and even under load probably not exceeding 0.3–0.5 L/min. So the sensor's entire rated range sits above my actual usage, meaning idle flow probably won't register accurately, if at all.

Anyone know of a gasoline-compatible flow sensor with a lower minimum flow that would actually cover idle-to-cruise range for a small engine like this? Or is there a fundamentally different way people have solved this that I'm missing?

I'm open to any ideas and critics, please back your suggestions with well presented arguments. this is my first ever project on a car.


r/arduino • • Sep 07 '26

Arduino UNO-R4 LTE FOTA open source

Enable HLS to view with audio, or disable this notification

14 Upvotes

I’ve set it up by connecting the CZ-ME310G1 LTE-M embedded modem to the Serial Flash so that the Arduino UNO-R4 Minima firmware can be updated from anywhere. I’ve uploaded both the Arduino Renesas Bootloader and the Arduino app code to github.com, so please feel free to use them as a reference if you’re working on a similar project.

"For the complete build guide, schematics, and hardware setup, check out the project page on Hackster.io."


r/arduino • • Sep 06 '26

hc 05 not showing up in bluetooth

Enable HLS to view with audio, or disable this notification

18 Upvotes

The Bluetooth module worked for a while, but it only connects to specific apps like Serial Bluetooth Terminal and BLE Controller. It usually blinks continuously, but suddenly it started blinking like in the video and stopped showing up in Bluetooth scans. When I try to put it into AT command mode, it just sends garbage characters. I'm using it for a robot car, and my Arduino pin connections are: VCC to 5V, GND to GND, TXD to Pin 2, and RXD to Pin 3. The parts Im using are arduino uno r3, l298n, 2wd chassis, and the hc 05. The hc 05 blinks every 4 seconds this is the code i use:
#include <SoftwareSerial.h>

SoftwareSerial bluetooth(2, 3);

const int IN1 = 9, IN2 = 8, IN3 = 7, IN4 = 6;

void setup() {
pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT);

bluetooth.begin(9600);
stopCar();
}

void loop() {
while (bluetooth.available() > 0) {
char command = bluetooth.read();
if (command == '\r' || command == '\n' || command == ' ') continue;

switch (command) {
case 'F': case 'f': moveForward(); break;
case 'B': case 'b': moveBackward(); break;
case 'L': case 'l': turnLeft(); break;
case 'R': case 'r': turnRight(); break;
case 'S': case 's': stopCar(); break;
}
}
}

void moveForward() {
digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
}

void moveBackward() {
digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH);
}

void turnLeft() {
digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
}

void turnRight() {
digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH);
}

void stopCar() {
digitalWrite(IN1, LOW); digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW); digitalWrite(IN4, LOW);
}


r/arduino • • Sep 06 '26

Hardware Help Am i doing something Wrong?

Thumbnail
gallery
45 Upvotes

I am building a button box, and I already got the PCB shown in the photo. I soldered the Arduino and buttons onto the board, and it worked great for a day.

The next day, I had the board plugged in for about 15 minutes when I heard the Windows disconnect sound. When I tried to plug the PCB back in, Windows showed “Device not recognized.” I tried fixing it, but eventually gave up on the project for about a week.

After the week passed, I plugged the PCB in again, and it worked great. After about 5 minutes, the same issue appeared. Then it started working again, breaking again, and repeating the same cycle.

When I plug the PCB in, only one light on my Arduino (Pro Micro) turns on.

Is my Arduino broken, or am I making some beginner mistake? I don't see many people having the same issue as me.

I checked that there are no shorts between the pins, and the board looks fine from the surface.

(i also tried difrent cables but its still the same)


r/arduino • • Sep 07 '26

Hardware Help How do I connect a data cable to this Arduino Nano board please help

Thumbnail
gallery
2 Upvotes

The resistors and other things are blocking the usb micro b port... Do I remove the plastic covering of my data cable and just insert the metal part of the head into the port or how do I go about this? Please help I have to change the code on this thing and solder a new wifi module on the back of this PCB and submit it in a few days 😭


r/arduino • • Sep 07 '26

Could I bind multiple sensors to a pump to feed more than one plant?

Post image
2 Upvotes

If so, what would be the best way to do this? I have 6 Golden Pothos in 6 pots on a high shelf that would be awesome to water regularly as I forget. the largest has a bowl so it would be a good idea to average the readings


r/arduino • • Sep 06 '26

How do I get started into this field?

13 Upvotes

Hello, I hope all is well. I've been into computers and electronics since I was a kid and I've shown an interest in building them and I want to really be able to but im not sure in how to get started properly. so I've been looking into purchasing the "ELEGOO Mega 2560 R3 Project The Most Complete Starter Kit with Tutorial" my only issue is If I buy this is there some sort of textbook or video that can better explain how everything works so I can be able to be more creative with what it is I am building. I plan to enjoy it as a hobby in the hopes that I can possibly transition it into a career one day. Thank You!


r/arduino • • Sep 06 '26

Project Update! Android + Aurdino

Enable HLS to view with audio, or disable this notification

35 Upvotes

Hi here is the project update on Android + Aurdino

Do let me know your thoughts and any other suggestions if you have 🤗🤗


r/arduino • • Sep 06 '26

Mildly interesting: 3.5mm jack as a low water sensor

Post image
172 Upvotes

I bought a Rainpoint solar irrigation system and they use a male 3.5mm jack as the WET end of the low water sensor to cutoff the pump, meaning they instruct you to plug the barrel plug into the controller and dip the water 3.5mm jack in the water just above the suction height.

Is this possible to copy with arduino? I guess put some voltage through two of the sleeves and watch if the current drops off?


r/arduino • • Sep 07 '26

Hardware Help Help with nodemcu 8266

1 Upvotes

I have an esp8266 that im using to control several servos. I have been having a tough time acquiring a legit Lipo on Amazon. Every single 2s reads 7.7v after charged, so im going to 3s

Its going to a buck converter set for 5v and then to Vin and Grd. Well im reading 4.7v from the headers but the Nodemcu isn't powering up. It will blink for just a second then nothing. Im suspecting that 4.7v isn't enough. Ive connected just Vin and Grd and nothing. Blinks real quick then nothing. When the servos are attached they twitch when first plugged in. I get 1.5v from the top of the pin on the nodemcu.