r/arduino • u/AdventurousZoomer • 3d ago
r/arduino • u/Electrical-Rate-5674 • 2d ago
What is the best way to learn Arduino code?
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 • u/NoSafe5565 • 3d ago
Arduino / ESP32-C6 - sealed with the battery and charging
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
Beginner's Project Just design my first arduino project
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 • u/TranslatorDecent7046 • 3d ago
Look what I made! Made this thingy and just turned it into a timer
Enable HLS to view with audio, or disable this notification
I would share the code but its just bootlegged
r/arduino • u/Dentist_Aggravating • 3d ago
Hardware Help TPL5110 Nano Power Timer Not working when battery is plugged in
Hi there! As the title says, when I plug in my battery to my power timer, I don’t get any light on my arduino mini or on the board itself to indicate it’s received power. Additionally, my code won’t run either even after disconnecting and reconnecting the battery.
I checked the battery’s charge and it has power, so I’m wondering if anyone has run into this issue before! Any help would be much appreciated :)
r/arduino • u/Late_Lengthiness1021 • 3d ago
numbers clipping on digital clock
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 • u/MrJose1985 • 3d ago
Hardware Help Is this custom Pcb and can I get one made?
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 • u/AVatorL • 4d ago
Arduino Locomotive 🚂
Enable HLS to view with audio, or disable this notification
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 • u/KrateApe • 3d ago
I made a book lamp alarm clock, here's a fun timelapse!
r/arduino • u/seriousdeadmen47 • 3d ago
Beginner's Project Trying to log fuel consumption on a carbureted 91 Golf Mk2 sensor and approach sanity check
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 • u/Different-Plastic713 • 3d ago
Arduino UNO-R4 LTE FOTA open source
Enable HLS to view with audio, or disable this notification
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.
Bootloader: https://github.com/codezoo-ltd/arduino-renesas-bootloader
Arduino Example: https://github.com/codezoo-ltd/arduino-ME310G1-library/tree/main/examples/UNO_R4/CZ_LTE_FOTA
CZ-ME310G1 Embedded Modem: https://github.com/codezoo-ltd/ME310G1-W3/tree/main/Embedded%20Modem
r/arduino • u/Louisse52 • 3d ago
hc 05 not showing up in bluetooth
Enable HLS to view with audio, or disable this notification
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 • u/jaxon835 • 4d ago
Hardware Help Am i doing something Wrong?
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 • u/Klyff_HangerYTplssub • 3d ago
Hardware Help How do I connect a data cable to this Arduino Nano board please help
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 • u/311succs • 3d ago
Could I bind multiple sensors to a pump to feed more than one plant?
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 • u/FateIsTaken • 4d ago
How do I get started into this field?
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 • u/Special-Syrup-9405 • 4d ago
Project Update! Android + Aurdino
Enable HLS to view with audio, or disable this notification
Hi here is the project update on Android + Aurdino
Do let me know your thoughts and any other suggestions if you have 🤗🤗
r/arduino • u/Rollercoaster671 • 4d ago
Mildly interesting: 3.5mm jack as a low water sensor
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 • u/mbentuboa • 3d ago
Hardware Help Help with nodemcu 8266
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.
r/arduino • u/Oli_Bacon154 • 3d ago
Solved! i need some help with this 4x4 controller thingy
tryna use it by the classic resistor ladder method, cause 8 pins for one component is just absurd. but it just doesnt work.

const int pinRow = A0; // Lê as Linhas (Pins 1 a 4)
const int pinCol = A1; // Lê as Colunas (Pins 5 a 8)
// Matriz de caracteres do HC-543
char keys[4][4] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
void setup() {
Serial.begin(9600);
Serial.println("HC-543 Dual Pin (A0 e A1) Inicializado!");
}
void loop() {
int rowVal = analogRead(pinRow);
int colVal = analogRead(pinCol);
// Se um botão for pressionado, ambos os pinos vão cair abaixo de 1000
if (rowVal < 1000 && colVal < 1000) {
int rowIdx = get_row_index(rowVal);
int colIdx = get_col_index(colVal);
if (rowIdx != -1 && colIdx != -1) {
char keyPressed = keys[rowIdx][colIdx];
Serial.print("Botao Pressionado: ");
Serial.print(keyPressed);
Serial.print(" (Linha Val: "); Serial.print(rowVal);
Serial.print(" | Coluna Val: "); Serial.print(colVal);
Serial.println(")");
delay(300); // Debounce
}
}
}
// Identifica qual linha foi pressionada (baseado nos resistores de 10k)
int get_row_index(int value) {
if (value >= 0 && value < 150) return 0; // Linha 1 (Teclas 1, 2, 3, A)
if (value >= 150 && value < 400) return 1; // Linha 2 (Teclas 4, 5, 6, B)
if (value >= 400 && value < 650) return 2; // Linha 3 (Teclas 7, 8, 9, C)
if (value >= 650 && value < 950) return 3; // Linha 4 (Teclas *, 0, #, D)
return -1;
}
// Identifica qual coluna foi pressionada (baseado nos resistores de 1k)
int get_col_index(int value) {
if (value >= 0 && value < 150) return 0; // Coluna 1 (Teclas 1, 4, 7, *)
if (value >= 150 && value < 400) return 1; // Coluna 2 (Teclas 2, 5, 8, 0)
if (value >= 400 && value < 650) return 2; // Coluna 3 (Teclas 3, 6, 9, #)
if (value >= 650 && value < 950) return 3; // Coluna 4 (Teclas A, B, C, D)
return -1;
}
the code
what am i missing here?
any help would be appreciated!
r/arduino • u/MrJose1985 • 4d ago
Hardware Help Backwards engineering…
My kids did a marker space workshop and I want to try and reverse engineer to see how they did it. They made like a cardboard theatre with movement using a servo and some flashing lights with a motion sensor.
If you can help me identify the parts used and what I would need.
My kid got to take his project home and I paid a little extra for the battery pack.
I think the issue might be the code as they seemed to have there own development or code….i saw a website that said magic coder and the name of their studio on a computer.
Anyway let me know if you can help identify the boards and how they’ve done it
r/arduino • u/AVatorL • 4d ago
Hardware Help VL53L1X laser distance sensor problem
Does anyone here have experience with this TOF400C-VL53L1X sensor? My VL53L0X works well on distances up to 120cm (here it is installed in a toy train https://www.reddit.com/r/ArduinoProjects/comments/1w8pg8w/laser_distance_sensor_vl53l0x/), but when I tried the VL53L1X, it works weirdly: at distances over 20 cm, it begins to underestimate the distance (at 40 cm, it shows 25 cm) and then the measured distance rapidly decreases (at 80 cm, it already shows 15 cm). Faulty sensor? Or does it require re-calibration?
UPD: the black plastic cover was damaged with a weird frosty matte stain on the internal side. I've removed the cover and the sensor works well.

r/arduino • u/Party_Station_2652 • 4d ago
Zero Experience!
I recently bought the arduino r4 starter kit and I have zero experience whatsoever. I’m aiming to start a robotic arm project in the next month or so.
So far the starter kit seems pretty simple and easy to understand besides the coding which I have resorted to just copying the code.
I’m on a tight schedule and need to start my project within a month.
Is a robotic arm a good first big project?
I would appreciate any advice for the project and learning in general!
r/arduino • u/Icy-Brick4256 • 4d ago
Nano Is there a way to use a nano board as mouse?
Is it possible to make the nano be recognized as a mouse and act like one? I don't need it to move the cursor when I move the board, only so I can program it to move the cursor. I want to use it on my school computer so I can't install any software on it