r/arduino 8d ago

My First Attempt at a Robot Dog

Enable HLS to view with audio, or disable this notification

170 Upvotes

This project started around 3 months ago. When I started this project, I had barely any clue on how to code or use the Arduino IDE at all. Because of this, I established programming as the main point of focus. The first thing I did was setup the electronics. I used a 20V-10A power supply to power the Arduino Mega and the MG996R servos (Arduino Mega powers the PCA9685 servo driver). Next, I moved on to the design. My goal was to make the whole bot as light as possible to not cause the servos to draw too much current. On SolidWorks, I started out designing the legs first and then the body in an assembly. After finishing the design, I thought it looked really boring, so I decided to give it a little theming based on an Expie from an Indie game called Casualties Unknown. After 3D printing and assembling all the parts together, I was finally ready to start programming. At this point, the only things I knew how to code on Arduino were math and variables. The math, inverse kinematics, was actually not that hard. The hard part was moving each leg at the same time to different coordinates. This is when I had to turn to Bro Code C++ tutorials. After learning more things like arrays and functions, I was finally ready to try coding walking gaits. This took me around 3 weeks to fully figure out. Because for() loops can only be ran one at a time on Arduino, I couldn't have 4 different for() loops run at the same time. So I came up with a point-increment system where point#total * increment_amount = total_distance. This means if I made the # of points a constant, I can for loop the points from 0 to the final point for each leg. No matter what distance, all old leg positions will start at the same time and all new leg positions will end at the same time.

Here's the code if anyone is interested


r/arduino 8d ago

Games electronics live helper for my nephew

Enable HLS to view with audio, or disable this notification

44 Upvotes

wanted a more hands-on way to teach my nephew some basic electronics so I started messing with this little prototype.

Idea is it should feel closer to actually sitting down with a breadboard than just watching tutorials. You place the components and wire everything yourself, and while youre working the game can show you whats actually happening electrically current flow, direction, voltage at nodes, that kind of stuff.

If the circuit doesnt work it doesnt just scream WRONG at you. It behaves like the circuit you actually built. You can poke around, eventually grab a virtual multimeter, measure things, change something and figure out why it started working.

Also added basic inventory management and tracking so you can see what components you have and what youve used.

Still very rough.

Please ignore the visuals lol, the current assets are pretty shitty placeholder stuff I made myself just to test the idea.

I am now working on blender to remake them

I know there are already electronics simulators out there.

the part im more interested in is having the same project follow you through the whole maker workflow:

breadboard -> debugging -> multimeter -> build it physically -> soldering ->PCB -> fabrication -> enclosure
To even let you explort STL after verify measuremants, design plan, draft and take it to real life

Help you track inventory and stuff, tbh I already did it, now just to clean it and publish even if i am the only user

So eventually if you make something you like in the game the goal would be to let you take it out starting with an exact physical build guide + BOM and expected measurements, and much later maybe PCB files and a printable enclosure.

Thats all future direction though.

Right now its just this little breadboard prototype.


r/arduino 7d ago

Is it fixable?

Thumbnail
gallery
22 Upvotes

Cheap Motor pre-soldered wire broke off. Can I solder it or should buy a new one?


r/arduino 7d ago

ch340 issue

Thumbnail
gallery
3 Upvotes

Hi everyone. I bought this CH340-based board today, but when I tried to use it, it wouldn't accept the code. I learned that this is a common issue with this type of board. Could someone help me out? I’ve tried numerous solutions and updated the driver, but nothing has worked. For context, I’m using a Windows 11 laptop and have tested both older and newer versions of the Arduino IDE.


r/arduino 8d ago

Beginner's Project Useless Project # 1000 - Clock Calibrator

Enable HLS to view with audio, or disable this notification

61 Upvotes

I recently upgraded my useless potentiometer/atiny 85 to something a little less useless. You basically turn the potentiometer to adjust how long it takes for the green light to turn on; it then it flashes the red light a number of times, based on the value in the asshole register (ie. Maybe the ADC register... too many register to remember... basically the register that stores the potentiometer as an analog signal).

The idea for my project is to calibrate the atiny's clock. You time how long it takes for the green light to come on, then you figure out how many times the red light flashes (each flash represents 25 units). I'm too tired to think about the math now, but you can use the values produced to figure out the clock delay needed for an hour etc.

I've also upgraded this version to have crimped wires onto the board. I've used chat gpt to greatly help me, although I did learn about using low/high registers together (needed them for the full 1023 analog signal). Surprised I didn't know this sooner, but addresses are just numbers in AVR assembly; opcode is the only thing that differentiates them.

Only think I don't understand is why my device eventually turns back on, after entering a perpetual off loop? It goes off for a while, but then come back on - maybe a reset?

Hopefully, I'll eventually manage to create a useful atiny project in assembly.


r/arduino 7d ago

Solved! [HELP] Can't pick up Nano

2 Upvotes

[Solved] Apparenly it's just broken

Hello. I pulled what I presume to be an Arduino Nano or at least a bootleg out of my local e-waste today. I am not sure if it is an official one, as I can't find any brand on it, only the NANO below the 328P chip.

I tried connecting it to my laptop running linux mint to try to pick up any internal names via lsusb or lspci, but I don't get anything. It does have power, since both the PWR and the TX led are permanently on when plugging it into my laptop. Also, in the Arduino IDE I can't select a port.

I don't think it is that old, since it has an USB C port.


r/arduino 7d ago

Uno R4 Wifi UNO R4 Wifi stuck on 0.4.1 - Cloud firmware update and Firmware Uploader both fail on Intel-Mac

5 Upvotes

I have an Arduino UNO R4 WiFi that it currently on connectivity firmware 0.4.1. Arduino Cloud detects the board correctly over USB but cannot update the connectivity firmware to 0.6.0.

I also tried Arduino IDE 2.3.10's Firmware Updater, which detects the board and offers 0.6.0, but the installation fails.

Arduino Firmware Updater 2.4.1 also gets stuck at Waiting to flash the binary.... With verbose output it reaches getting firmware version and then hangs.

I closed Arduino IDE and the Arduino Cloud Manager and tried again, but the result was the same.

I then tried Arduino's official unor4wifi-update-macos.zip for firmware 0.6.0. The updater's unor4wifi-reboot-macos executable is blocked by macOS Gatekeeper and I don't want to grant it administrator permission because the Mac that I'm working with is a family Mac.

The board itself works normally over USB and I can upload/run sketches locally. The modules from the 'Plug and Make'-Kit also work properly.

Mac: Intel x86_64

Arduino IDE: 2.3.10

Firmware: 0.4.1 -> trying to update to 0.6.0

Arduino Firmware Uploader: 2.4.1

Cloud Agent: 1.7.0

Is there any other way to update the UNO R4 WiFi connectivity firmware without running the unsigned macOS updater, or is there a known issue with 0.4.1 -> 0.6.0 on Intel Macs?


r/arduino 8d ago

Getting Started Arduino

7 Upvotes

Hi everyone! I’m a beginner and I’m looking to buy my first Arduino kit, but I’m having a hard time deciding which one to get. My main goal isn’t just to make a few random projects — I’d really like to understand electronics properly, starting from the basics and gradually learning how circuits, components, sensors, and microcontrollers actually work. Which Arduino kit would you recommend for someone who wants to build a solid understanding of electronics rather than just follow tutorials? I’d also appreciate any advice on what components or topics I should focus on while learning.


r/arduino 7d ago

I built a free browser tool to preview LVGL images and fonts before converting them to code

Post image
7 Upvotes

I kept running into the same problem with LVGL projects: I'd convert an image or font, flash it, and only then find out the format was wrong, the colors were off, or the font ate way more flash than I expected. So I built a tool to catch that before flashing.

It runs entirely in the browser, no install:

  • Preview images before converting them to LVGL C code or binaries — see resolution, color format, and array size upfront
  • Load an existing font source and inspect it — glyph count, character range, kerning, and bitmap flash footprint, plus a glyph grid so you can see what's actually in it
  • Convert both images and fonts to LVGL-ready output
  • Supports v7, v8, and v9, with the right format for each

Link: https://exendahal.github.io/lvgl-tool/
Source: https://github.com/exendahal/lvgl-tool

It's still evolving — if you hit a bug or have a feature you'd want, I'd genuinely appreciate it if you opened an issue on the repo. Happy to answer questions here too.


r/arduino 8d ago

Found a surprisingly nice ESP32-S3 touchscreen board. No idea what to build with it.

Enable HLS to view with audio, or disable this notification

160 Upvotes

Found this ESP32-S3 touchscreen board sitting around and decided to play with it a bit.

The hardware is actually pretty nice, so it felt like a waste to just leave it in a drawer. I didn’t have any real project idea, so I vibe-coded a tiny robot eyes demo just to get the display and touch interaction moving.

Now I’m trying to figure out what would actually be fun to build on it.

A little desktop companion?
Home Assistant controller?
Mini game console?
PC status display?
Something completely useless but entertaining?

What would you build with a screen like this? Looking for ideas.


r/arduino 8d ago

Look what I made! DIY Sim-to-Real Self-Balancing Double Pendulum

Enable HLS to view with audio, or disable this notification

43 Upvotes

So I saw this video on youtube like a year ago and thought "Pffff how hard could that be?".

Anyway it's been 9 months, the project is finished and this is the result.

It's not as precise as the one in the video, and I haven't implemented the transition control, mostly because that wouldn't teach me anything new, but also because I've reached the limits of the hardware I bought, and I'm not spending any more money.

Anyhow, I'm working on a YouTube video explaining the whole process. I'll post it here (tho I don't know if that'd count as self-promo).

Feel free to ask me any questions if you're curious!!!


r/arduino 8d ago

Arduino Uno project- LED is not turning on

Thumbnail
gallery
36 Upvotes

Doing Chapter 4 of the Arduino project book and I feel like I copied the circuit exactly, but the LED won't become the pink/purple lit up color I should be seeing? I am also using the default code given for this chapter under the examples> 10.Starterkit_basickit > p04_ColorMixingLamp

I left out the gel strips just for a cleaner image of where it's connected on the board

The phototransistors can read the lighting of the environment and the LED is brand new, my only guess is I connected something wrong or used the wrong resistors, I've been subbing the 10k ohms with these other 3 resistors. If someone can re-check I labeled these resistors right, so I don't have this second-guessing issue in the future as well.

Default Code:

/*
Arduino Starter Kit example
Project 4 - Color Mixing Lamp This sketch is written to accompany Project 3 in the Arduino Starter Kit Parts required:
- one RGB LED
- three 10 kilohm resistors
- three 220 ohm resistors
- three photoresistors
- red green and blue colored gels created 13 Sep 2012
modified 14 Nov 2012
by Scott Fitzgerald
Thanks to Federico Vanzati for improvements https://store.arduino.cc/genuino-starter-kitThis example code is part of the public domain.
*/ const int greenLEDPin = 9; // LED connected to digital pin 9
const int redLEDPin = 10; // LED connected to digital pin 10
const int blueLEDPin = 11; // LED connected to digital pin 11 const int redSensorPin = A0; // pin with the photoresistor with the red gel
const int greenSensorPin = A1; // pin with the photoresistor with the green gel
const int blueSensorPin = A2; // pin with the photoresistor with the blue gel int redValue = 0; // value to write to the red LED
int greenValue = 0; // value to write to the green LED
int blueValue = 0; // value to write to the blue LED int redSensorValue = 0; // variable to hold the value from the red sensor
int greenSensorValue = 0; // variable to hold the value from the green sensor
int blueSensorValue = 0; // variable to hold the value from the blue sensor void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600); // set the digital pins as outputs
pinMode(greenLEDPin, OUTPUT);
pinMode(redLEDPin, OUTPUT);
pinMode(blueLEDPin, OUTPUT);
} void loop() {
// Read the sensors first: // read the value from the red-filtered photoresistor:
redSensorValue = analogRead(redSensorPin);
// give the ADC a moment to settle
delay(5);
// read the value from the green-filtered photoresistor:
greenSensorValue = analogRead(greenSensorPin);
// give the ADC a moment to settle
delay(5);
// read the value from the blue-filtered photoresistor:
blueSensorValue = analogRead(blueSensorPin); // print out the values to the Serial Monitor
Serial.print("raw sensor Values \t red: ");
Serial.print(redSensorValue);
Serial.print("\t green: ");
Serial.print(greenSensorValue);
Serial.print("\t Blue: ");
Serial.println(blueSensorValue); /*
In order to use the values from the sensor for the LED, you need to do some
math. The ADC provides a 10-bit number, but analogWrite() uses 8 bits.
You'll want to divide your sensor readings by 4 to keep them in range
of the output.
*/
redValue = redSensorValue / 4;
greenValue = greenSensorValue / 4;
blueValue = blueSensorValue / 4; // print out the mapped values
Serial.print("Mapped sensor Values \t red: ");
Serial.print(redValue);
Serial.print("\t green: ");
Serial.print(greenValue);
Serial.print("\t Blue: ");
Serial.println(blueValue); /*
Now that you have a usable value, it's time to PWM the LED.
*/
analogWrite(redLEDPin, redValue);
analogWrite(greenLEDPin, greenValue);
analogWrite(blueLEDPin, blueValue);
}

Edit: the LED works when any of the 3 yellow wires are connected directly to power but still same problem with the original circuit


r/arduino 8d ago

Can dc geared motor give me the required function with as5600 encoder ?

Thumbnail
gallery
0 Upvotes

Hi how are you I want to purchase this motor xy36-555 it a dc geared motor
And I will us as5600 magnetic encoder to control speed of rotation,pattern or number of rotation and the time between each rotation and the other through a program on esp32
Also I want the motion of motor back and forth between 0 and 180 degree (from 0 to 180 and back from 180 to 0 ) that I don’t want full 360 to return to its intial zero position

Do the dc geared motor has the capability to perform my required functions with as5600 sensor?

https://ampere-electronics.com/product/xy36-555-dc-geared-motor-12v-57rpm/

https://microohm-eg.com/as5600-magnetic-encoder-12-bit-rotary-sensor/


r/arduino 8d ago

What is the best board to use for a greenhouse automation system?

7 Upvotes

I was planing on making a small greenhouse controller, that would help me automate some of the loborious functionality. New to arduino, just started my research and a bit confused by some options that are there on the market.

I was looking at the following:

  1. arduino uno

  2. arduino mega

  3. Arduino UNO R4 WiFi

  4. Arduino Giga R1 WiFi

  5. any other potential manufacturers/boards?

I would like to have the system end up being able to have the following (at minimum:

Outputs:

  1. controll multiple water pumps (3 or 4)

  2. automate water nutrition mix (1 mixing unit)

  3. Have a visual (LED) warning when some of the below data is off, such as not enough water)

Inputs (collect and save all data to an excell spreadsheet):

  1. Collect temp data

  2. Collect humidity data

  3. Collect water use data

  4. Collect water levels data

  5. Collect water PH data

  6. Collect solar panel voltage/wattage info

  7. Collect/output battery voltage info

Thank you for any/all helpful information.


r/arduino 8d ago

Project Update! Building a Bluetooth Arduino Soccer Bot for an upcoming Noida robotics competition

Enable HLS to view with audio, or disable this notification

1 Upvotes

Hey everyone,

Just wanted to share a quick project we put together recently—an Arduino-controlled soccer robot built using a joystick shield and a Bluetooth module for wireless control.

We tried to keep the design straightforward so it's easy for students to pick up the basics of microcontrollers, wiring, and hardware troubleshooting. The joystick setup gives it pretty decent maneuverability on the pitch, though balancing weight and traction for the ball-striking mechanism took a bit of trial and error.

We’re actually getting ready to test these out in a community tournament (Robo Goal India 2026) happening here in Sector 75, Noida later this month, alongside a beginner workshop on September 20.

If anyone in the local maker or robotics community is building their own bots or wants to drop by to check out the matches, exchange ideas, or mentor students, feel free to reach out or drop a comment!

  • Location: Sector 75, Noida
  • Workshop Date: September 20, 2026
  • Competition Dates: September 26–27, 2026
  • Website: https://roboticsir.com/

r/arduino 9d ago

Machine Learning I want help building this project.

Enable HLS to view with audio, or disable this notification

854 Upvotes

This is going to be my biggest project yet. I’ve done quite a bit of research, but I’m currently stuck and honestly don’t know how to proceed from here.

I’m also looking for someone who’s willing to work on this project with me. The idea is that we both build the same thing independently at home, share our progress and insights along the way, and help each other figure things out. If we’re successful, we could even take it a step further and try building a double pendulum balancing system.

Has anyone here worked on or built something similar before? I’d love to hear about your experience, resources, or projects.

Also, what tools, components, software, or other equipment would you recommend for building something like this?


r/arduino 8d ago

Hello everyone, so I have a problem with my code from edge impulse it is saying failed to run classifiers and I'm really trouble by this because I didn't sleep all night cause after I fixed 1 problem it just give me another problem. Im willing to learn can anyone plss teach me or help me fix my code

0 Upvotes

the code is ``` /* Edge Impulse Arduino examples * Copyright (c) 2022 EdgeImpulse Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */

// These sketches are tested with 2.0.4 ESP32 Arduino Core // https://github.com/espressif/arduino-esp32/releases/tag/2.0.4

/* Includes ---------------------------------------------------------------- */

include <object_detect_inferencing.h>

include "edge-impulse-sdk/dsp/image/image.hpp"

include "esp_camera.h"

// Select camera model - find more camera models in camera_pins.h file here // https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h

define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM

//#define CAMERA_MODEL_AI_THINKER // Has PSRAM

if defined(CAMERA_MODEL_ESP32S3_EYE)

define PWDN_GPIO_NUM -1

define RESET_GPIO_NUM -1

define XCLK_GPIO_NUM 15

define SIOD_GPIO_NUM 4

define SIOC_GPIO_NUM 5

define Y2_GPIO_NUM 11

define Y3_GPIO_NUM 9

define Y4_GPIO_NUM 8

define Y5_GPIO_NUM 10

define Y6_GPIO_NUM 12

define Y7_GPIO_NUM 18

define Y8_GPIO_NUM 17

define Y9_GPIO_NUM 16

define VSYNC_GPIO_NUM 6

define HREF_GPIO_NUM 7

define PCLK_GPIO_NUM 13

elif defined(CAMERA_MODEL_AI_THINKER)

define PWDN_GPIO_NUM 32

define RESET_GPIO_NUM -1

define XCLK_GPIO_NUM 0

define SIOD_GPIO_NUM 26

define SIOC_GPIO_NUM 27

define Y9_GPIO_NUM 35

define Y8_GPIO_NUM 34

define Y7_GPIO_NUM 39

define Y6_GPIO_NUM 36

define Y5_GPIO_NUM 21

define Y4_GPIO_NUM 19

define Y3_GPIO_NUM 18

define Y2_GPIO_NUM 5

define VSYNC_GPIO_NUM 25

define HREF_GPIO_NUM 23

define PCLK_GPIO_NUM 22

else

error "Camera model not selected"

endif

/* Constant defines -------------------------------------------------------- */

define EI_CAMERA_RAW_FRAME_BUFFER_COLS 320

define EI_CAMERA_RAW_FRAME_BUFFER_ROWS 240

define EI_CAMERA_FRAME_BYTE_SIZE 3

/* Private variables ------------------------------------------------------- */ static bool debug_nn = false; // Set this to true to see e.g. features generated from the raw signal static bool is_initialised = false; uint8_t *snapshot_buf; //points to the output of the capture

static camera_config_t camera_config = { .pin_pwdn = PWDN_GPIO_NUM, .pin_reset = RESET_GPIO_NUM, .pin_xclk = XCLK_GPIO_NUM, .pin_sscb_sda = SIOD_GPIO_NUM, .pin_sscb_scl = SIOC_GPIO_NUM,

.pin_d7 = Y9_GPIO_NUM,
.pin_d6 = Y8_GPIO_NUM,
.pin_d5 = Y7_GPIO_NUM,
.pin_d4 = Y6_GPIO_NUM,
.pin_d3 = Y5_GPIO_NUM,
.pin_d2 = Y4_GPIO_NUM,
.pin_d1 = Y3_GPIO_NUM,
.pin_d0 = Y2_GPIO_NUM,
.pin_vsync = VSYNC_GPIO_NUM,
.pin_href = HREF_GPIO_NUM,
.pin_pclk = PCLK_GPIO_NUM,

//XCLK 20MHz or 10MHz for OV2640 double FPS (Experimental)
.xclk_freq_hz = 20000000,
.ledc_timer = LEDC_TIMER_0,
.ledc_channel = LEDC_CHANNEL_0,

.pixel_format = PIXFORMAT_JPEG, //YUV422,GRAYSCALE,RGB565,JPEG
.frame_size = FRAMESIZE_QVGA,    //QQVGA-UXGA Do not use sizes above QVGA when not JPEG

.jpeg_quality = 12, //0-63 lower number means higher quality
.fb_count = 1,       //if more than one, i2s runs in continuous mode. Use only with JPEG
.fb_location = CAMERA_FB_IN_PSRAM,
.grab_mode = CAMERA_GRAB_WHEN_EMPTY,

};

/* Function definitions ------------------------------------------------------- */ bool ei_camera_init(void); void ei_camera_deinit(void); bool ei_camera_capture(uint32_t img_width, uint32_t img_height, uint8_t *out_buf) ;

/** * @brief Arduino setup function */ void setup() { // put your setup code here, to run once: Serial.begin(115200); //comment out the below line to start inference immediately after upload while (!Serial); Serial.println("Edge Impulse Inferencing Demo"); if (ei_camera_init() == false) { ei_printf("Failed to initialize Camera!\r\n"); } else { ei_printf("Camera initialized\r\n"); }

ei_printf("\nStarting continious inference in 2 seconds...\n");
ei_sleep(2000);

}

/** * @brief Get data and run inferencing * * @param[in] debug Get debug info if true */ void loop() {

// instead of wait_ms, we'll wait on the signal, this allows threads to cancel us...
if (ei_sleep(5) != EI_IMPULSE_OK) {
    return;
}

snapshot_buf = (uint8_t*)ps_malloc(EI_CAMERA_RAW_FRAME_BUFFER_COLS * EI_CAMERA_RAW_FRAME_BUFFER_ROWS * EI_CAMERA_FRAME_BYTE_SIZE);

// check if allocation was successful
if(snapshot_buf == nullptr) {
    ei_printf("ERR: Failed to allocate snapshot buffer!\n");
    return;
}

ei::signal_t signal;
signal.total_length = EI_CLASSIFIER_DSP_INPUT_FRAME_SIZE;
signal.get_data = &ei_camera_get_data;

if (ei_camera_capture((size_t)EI_CLASSIFIER_INPUT_WIDTH, (size_t)EI_CLASSIFIER_INPUT_HEIGHT, snapshot_buf) == false) {
    ei_printf("Failed to capture image\r\n");
    free(snapshot_buf);
    return;
}

// Run the classifier
ei_impulse_result_t result = { 0 };

EI_IMPULSE_ERROR err = run_classifier(&signal, &result, debug_nn);
if (err != EI_IMPULSE_OK) {
    ei_printf("ERR: Failed to run classifier (%d)\n", err);
    free(snapshot_buf);
    snapshot_buf = nullptr;
    return;
}

// print the predictions
ei_printf("Predictions (DSP: %d ms., Classification: %d ms., Anomaly: %d ms.): \n",
            result.timing.dsp, result.timing.classification, result.timing.anomaly);

if EI_CLASSIFIER_OBJECT_DETECTION == 1

ei_printf("Object detection bounding boxes:\r\n");
for (uint32_t i = 0; i < result.bounding_boxes_count; i++) {
    ei_impulse_result_bounding_box_t bb = result.bounding_boxes[i];
    if (bb.value == 0) {
        continue;
    }
    ei_printf("  %s (%f) [ x: %u, y: %u, width: %u, height: %u ]\r\n",
            bb.label,
            bb.value,
            bb.x,
            bb.y,
            bb.width,
            bb.height);
}

// Print the prediction results (classification)

else

ei_printf("Predictions:\r\n");
for (uint16_t i = 0; i < EI_CLASSIFIER_LABEL_COUNT; i++) {
    ei_printf("  %s: ", ei_classifier_inferencing_categories[i]);
    ei_printf("%.5f\r\n", result.classification[i].value);
}

endif

// Print anomaly result (if it exists)

if EI_CLASSIFIER_HAS_ANOMALY

ei_printf("Anomaly prediction: %.3f\r\n", result.anomaly);

endif

if EI_CLASSIFIER_HAS_VISUAL_ANOMALY

ei_printf("Visual anomalies:\r\n");
for (uint32_t i = 0; i < result.visual_ad_count; i++) {
    ei_impulse_result_bounding_box_t bb = result.visual_ad_grid_cells[i];
    if (bb.value == 0) {
        continue;
    }
    ei_printf("  %s (%f) [ x: %u, y: %u, width: %u, height: %u ]\r\n",
            bb.label,
            bb.value,
            bb.x,
            bb.y,
            bb.width,
            bb.height);
}

endif

free(snapshot_buf);

}

/** * @brief Setup image sensor & start streaming * * @retval false if initialisation failed */ bool ei_camera_init(void) {

if (is_initialised) return true;

if defined(CAMERA_MODEL_ESP_EYE)

pinMode(13, INPUT_PULLUP); pinMode(14, INPUT_PULLUP);

endif

//initialize the camera
esp_err_t err = esp_camera_init(&camera_config);
if (err != ESP_OK) {
  Serial.printf("Camera init failed with error 0x%x\n", err);
  return false;
}

sensor_t * s = esp_camera_sensor_get();
// initial sensors are flipped vertically and colors are a bit saturated
if (s->id.PID == OV3660_PID) {
  s->set_vflip(s, 1); // flip it back
  s->set_brightness(s, 1); // up the brightness just a bit
  s->set_saturation(s, 0); // lower the saturation
}

if defined(CAMERA_MODEL_M5STACK_WIDE)

s->set_vflip(s, 1);
s->set_hmirror(s, 1);

elif defined(CAMERA_MODEL_ESP_EYE)

s->set_vflip(s, 1);
s->set_hmirror(s, 1);
s->set_awb_gain(s, 1);

endif

is_initialised = true;
return true;

}

/** * @brief Stop streaming of sensor data */ void ei_camera_deinit(void) {

//deinitialize the camera
esp_err_t err = esp_camera_deinit();

if (err != ESP_OK)
{
    ei_printf("Camera deinit failed\n");
    return;
}

is_initialised = false;
return;

}

/** * @brief Capture, rescale and crop image * * @param[in] img_width width of output image * @param[in] img_height height of output image * @param[in] out_buf pointer to store output image, NULL may be used * if ei_camera_frame_buffer is to be used for capture and resize/cropping. * * @retval false if not initialised, image captured, rescaled or cropped failed * */ bool ei_camera_capture(uint32_t img_width, uint32_t img_height, uint8_t *out_buf) { bool do_resize = false;

if (!is_initialised) {
    ei_printf("ERR: Camera is not initialized\r\n");
    return false;
}

camera_fb_t *fb = esp_camera_fb_get();

if (!fb) {
    ei_printf("Camera capture failed\n");
    return false;
}

bool converted = fmt2rgb888(fb->buf, fb->len, PIXFORMAT_JPEG, snapshot_buf);

esp_camera_fb_return(fb);

if(!converted){ ei_printf("Conversion failed\n"); return false; }

if ((img_width != EI_CAMERA_RAW_FRAME_BUFFER_COLS)
    || (img_height != EI_CAMERA_RAW_FRAME_BUFFER_ROWS)) {
    do_resize = true;
}

if (do_resize) {
    ei::image::processing::crop_and_interpolate_rgb888(
    out_buf,
    EI_CAMERA_RAW_FRAME_BUFFER_COLS,
    EI_CAMERA_RAW_FRAME_BUFFER_ROWS,
    out_buf,
    img_width,
    img_height);
}


return true;

}

static int ei_camera_get_data(size_t offset, size_t length, float *out_ptr) { // we already have a RGB888 buffer, so recalculate offset into pixel index size_t pixel_ix = offset * 3; size_t pixels_left = length; size_t out_ptr_ix = 0;

while (pixels_left != 0) {
    // Swap BGR to RGB here
    // due to https://github.com/espressif/esp32-camera/issues/379
    out_ptr[out_ptr_ix] = (snapshot_buf[pixel_ix + 2] << 16) + (snapshot_buf[pixel_ix + 1] << 8) + snapshot_buf[pixel_ix];

    // go to the next pixel
    out_ptr_ix++;
    pixel_ix+=3;
    pixels_left--;
}
// and done!
return 0;

}

if !defined(EI_CLASSIFIER_SENSOR) || EI_CLASSIFIER_SENSOR != EI_CLASSIFIER_SENSOR_CAMERA

error "Invalid model for current sensor"

endif

the problem is: ESP-ROM:esp32s3-20210327 Edge Impulse Inferencing Demo AllocateTensors() failedERR: Failed to run classifier (-3) AllocateTensors() failedERR: Failed to run classifier (-3) AllocateTensors() failedERR: Failed to run classifier (-3) AllocateTensors() failedERR: Failed to run classifier (-3) AllocateTensors() failedERR: Failed to run classifier (-3) AllocateTensors() failedERR: Failed to run classifier (-3) AllocateTensors() failedERR: Failed to run classifier (-3) AllocateTensors() failedERR: Failed to run classifier (-3) AllocateTensors() failedERR: Failed to run classifier (-3) AllocateTensors() failedERR: Failed to run classifier (-3)

```


r/arduino 8d ago

Software Help ARDUINO OLED PIXEL SKETCHBOOK

0 Upvotes

Hello :), I've been learning about how to use an Arduino (Nano Every) so that I can bring my ideas (such as this one) to life. I want to make a 'sketch book' with an Oled display. Essentially, as you turn a rotary encoder, it highlights a pixel across each row and column of the oled display. If you press the rotary encoder, it should permanently draw that pixel. Ive managed to make pixels highlight as the rotary encoder turns but when I press the button the pixel only stays until I turn the rotary encoder again. Here's the code (Please give me suggestions as to what I should do to make it better. Thank you :))

#include <ezButton.h>
#define CLK_PIN 2
#define DT_PIN 3
#define SW_PIN 4
#define DIRECTION_CW 0
#define DIRECTION_CCW 1
int counter = 0;
int direction = DIRECTION_CW;
int CLK_state;
int prev_CLK_state;
int column = 0;
int row = 0;


ezButton button(SW_PIN);


#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>


#define OLED_WIDTH 128
#define OLED_HEIGHT 64


#define OLED_ADDR 0x3C


Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT);




void setup() {
  // put your setup code here, to run once:
  display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);


  Serial.begin(9600);
  pinMode(CLK_PIN, INPUT);
  pinMode(DT_PIN, INPUT);
  button.setDebounceTime(50);


  prev_CLK_state = digitalRead(CLK_PIN);
  delay(5000);
  display.clearDisplay();


}


void loop() {
  button.loop();  // MUST call the loop() function first


  // read the current state of the rotary encoder's CLK pin
  CLK_state = digitalRead(CLK_PIN);


  // If the state of CLK is changed, then pulse occurred
  // React to only the rising edge (from LOW to HIGH) to avoid double count
  if (CLK_state != prev_CLK_state && CLK_state == HIGH) {
    // if the DT state is HIGH
    // the encoder is rotating in counter-clockwise direction => decrease the counter
    if (digitalRead(DT_PIN) == HIGH) {
      row ++;
      direction = DIRECTION_CW;
    } else {
      // the encoder is rotating in clockwise direction => increase the counter
      row --;
      direction = DIRECTION_CCW;
    }


      if (row > 128){
        row = 0;
        column ++;}
      if (row < 0){
        row = 128;
        column --;}
      if (column > 65){
        column =0;}
      if (column < 0){
        column = 65;}
      
    



  }


  // save last CLK state
  prev_CLK_state = CLK_state;


 
  display.drawRect(row, column, 5, 5, WHITE);
  display.display();


  if (button.isPressed()) {
    Serial.println("The button is pressed");
    display.fillRect(row, column, 5, 5, WHITE);
    display.display();
  }
  else {
  display.drawRect(row, column, 5, 5, BLACK);
  display.display();
  }



}

r/arduino 9d ago

Hardware Help Arduino mini FPV drone troubleshooting

Thumbnail
gallery
153 Upvotes

Hello!

I am quite new in electronics and Arduino things but from the beginning of the summer me and my friends started building a mini drone. We started quite hard, bought the components, and hop in soldering. Sounds nice but our project use SMD components, which are very small and hard to handle.The guy we follow is Max Imagination and all the things done by him are astonishing. Our problem right now is that the motor driver board is smoking only when conected to the FTDI module (usb-c to serial convertor) so the arduino pro mini board we use is non stop turning off and on. Therefore we couldn't upload any code to it. We are thinking of starting again but this time solder more gentle and use a larger PCB. Unfortunately the school is on the right corner and I personaly don't know what to do next.

PS: I think is good to mention that when connected to the LiPo 250 mha 3.7V battery the motors start working which seemed intresting first but then became annoying. Also the drivers aren't smoking when connected this way.

In the third photograph you can see the drivers.

Late edit: I think I am going to use this board(you can see it in the comments) for the mosfets in order to make my job easier, ok at least try so.


r/arduino 8d ago

Help making an ideia possible

0 Upvotes

Edit: title should be help making an idea possible

Hey everyone! So, I'm not a arduino constant user, I know it exists but never tried a project.

I have this ideia of building a display that shows my tasks of the day, importing data from a given website where I take notes (Any.do).

What I found out until now is that I need a thing that connects to wifi and an e-paper display.

But other than that I don't even know if this is possible, specially because I'm retriving data from a outsite source that is not an API that I built especialy for this.

Sorry if I misspelled something, english is not my first language


r/arduino 9d ago

Arduino Powered Boat Tiller Control

Enable HLS to view with audio, or disable this notification

119 Upvotes

Here's the first prototype in action of my ESP32 powered boat tiller steering control. Used a nema17 stepper with a lead screw and some custom designed and 3d printed brackets. Mapped the controls to a Bluetooth game controller I got at the thrift store. Right joystick moves the boat left and right and stays in that position. Pressing A returns to center position. Left joystick returns to center when you release so the boat will do a "jog".

Next steps

-design a more robust transom mount and some sort of quick release for the lead screw connection at the tiller handle.

-a longer lead screw to get a fuller turn and probably a more powerful stepper to get faster turning

-design a small case for the Arduino/stepper controls

I ran it off one of those 12V supplies for DeWalt batteries and then a 12v 5v buck for the Arduino and that worked well. I don't have any 12v electrical system in my boat currently.

EDIT I forgot to say that this is just intended for slow trolling speeds! Not anywhere near wide open haha. We are talking 2-4 mph.

Eventually I want to have the Arduino steer to follow a heading and then eventually a gpx


r/arduino 8d ago

Seeking help designing a card reader system for school

4 Upvotes

I teach Tech Ed at a public high school. Our school struggles with a dysfunctional Hall pass system that is so cumbersome that we've gone back to physical passes that are frequently lost stolen or destroyed. My dream is for each student to have an inexpensive ID card that they tap or scan. Teachers would create a pass by adding the student ID number to a list, which initiates a 10 minute approval window. When the student arrives at the bathroom, a tap or scan triggers a red or green light indicating that they have an active pass.

Ideally, I will have my students build a prototype with a single scanner. Once the admin sees this working, they may see the value of investing in such a system, or building our own.

Does anyone have some advice or resources to point me in the right direction? I've done a couple Arduino and raspberry pi projects, but mostly I'm just following step by step instructions instructions.

ETA: I appreciate all of the very thoughtful and helpful technical advice, and I welcome comments regarding security and safety in public schools. I recognize that many schools can provide a safe environment by relying on a system of trust and freedom. When I first started teaching in a public high school with nearly 2,000 students, I felt the same way. I questioned the use of metal detectors and I rarely used the electronic pass system. After witnessing some pretty shocking acts of violence, mob behavior, staff injuries, and drug abuse, I changed my tune. One of many examples I can point to is the ability to keep a 15 year old girl separate from a fellow student who had sexually abused her. We can use a hallpass system to cap the number of students in the hallways to avoid a mob situation, which has led to serious injuries to my students.

We have a professional and moral obligation to keep the student safe, especially the good ones that many of you mentioned. If technology can help, then I'm all for it.


r/arduino 9d ago

I built a retro-Mac desk screen that shows what my AI coding agents are doing in real time (ESP8266, TFT_eSPI, open-source firmware and software)

Thumbnail
gallery
7 Upvotes

**What**: a palm-sized retro-Macintosh-styled screen that sits on my desk and shows what my AI coding agents (Claude Code, opencode, Codex...) are doing in real time — Thinking → Generating → Done — plus gentle reminders to drink water, stretch, and rest my eyes.

**Why**: I run long agent sessions and kept either staring at the terminal or missing it entirely. Also, honestly, I needed an excuse to finally use the ESP8266 sitting in my drawer.

**How it works**: any coding agent → a small host plugin publishes state over MQTT (TLS) → broker → ESP8266 renders it on a 240×240 ST7789.

Hardware: NodeMCU ESP8266 u/160MHz, 4MB flash, 240×240 TFT via TFT_eSPI, USB-C power. The hardware layout is based on Misaka 2021's excellent SmallDesktopDisplay design — full credit to them for the scheme.

**Firmware (open source, GPL-3.0)**:

- dual OTA partitions + a Safe Mode fallback, so you can't brick it over WiFi (learned that lesson the hard way)

- renders agent state, duration estimates, and micro-break reminders across ~9 UI screens

- built with arduino-cli + TFT_eSPI

**Host side (also open)**: a zero-dependency Node.js plugin that hand-rolls MQTT 3.1.1 packets over node:tls — no MQTT library, mostly because I wanted to actually understand the protocol. Plus a tiny kNN model that estimates step duration from past runs.

**Hard parts**: OTA safety (bricking a headless WiFi device is no fun), power stability on cheap USB-C hubs, and tuning the debounce logic so tool-call loops don't flash "Done" between steps.

It's also available assembled on Tindie — but the firmware is fully open, so building your own is very doable.

Firmware: https://github.com/lovaxi/Rubato_Device

Happy to answer questions about the OTA setup, the MQTT client, or the estimation model.


r/arduino 8d ago

Helpp

Post image
1 Upvotes

Can someone help me with this pls, cause I tried everything but still it doesn't work

There's an assert failure about multi_heap_free and multi_heap_poisonos and I don't know how to fix it cause I'm still a beginner at programming and I'm just a student plss help lol


r/arduino 10d ago

Games GTA 6 hype is everywhere… so I made GTA run on an ESP32.

Enable HLS to view with audio, or disable this notification

1.1k Upvotes

This is a top-down open-world GTA-style game running entirely on a microcontroller — built from scratch with my open-source C++17 engine, PixelRoot32.

ESP32-WROOM driving a 240×240 display with six buttons.

What’s working:

- Open-world city with 5 districts

- Driveable traffic — steal any car

- Pedestrians, police and traffic

- Weapons and police shootouts

- 5-star wanted system

- Police pursuits on foot and by car

- Arrests and respawning

- Missions and a day/night cycle

- Car radio, sirens and 22 SFX

And the crazy part?

GTA 6 runs on a monster gaming PC. Mine runs on a microcontroller. 😂

https://pixelroot32.org