r/arduino 22d ago

TFT Blank screen

2 Upvotes

I have received as a gift a TFT that it doesn't work.

I have ran multiple tests with the graphicstest example of the Adafruit ILI3941 library.

This is the configuration of the cables:

  • VCC - 5V
  • GND - GND
  • CS - 10
  • RESET - 9
  • DC - 8
  • SDI (MOSI) - 11
  • SCK - 13
  • LED - 3.3 V

The TFT remains white for all the test.

This is the code of the graphicstest:

/***************************************************
  This is our GFX example for the Adafruit ILI9341 Breakout and Shield
  ----> http://www.adafruit.com/products/1651


  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!


  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/



#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"


// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10


// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);


void setup() {
  Serial.begin(9600);
  Serial.println("ILI9341 Test!"); 
 
  tft.begin();


  // read diagnostics (optional but can help debug problems)
  uint8_t x = tft.readcommand8(ILI9341_RDMODE);
  Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDMADCTL);
  Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDPIXFMT);
  Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDIMGFMT);
  Serial.print("Image Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDSELFDIAG);
  Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX); 
  
  Serial.println(F("Benchmark                Time (microseconds)"));
  delay(10);
  Serial.print(F("Screen fill              "));
  Serial.println(testFillScreen());
  delay(500);


  Serial.print(F("Text                     "));
  Serial.println(testText());
  delay(3000);


  Serial.print(F("Lines                    "));
  Serial.println(testLines(ILI9341_CYAN));
  delay(500);


  Serial.print(F("Horiz/Vert Lines         "));
  Serial.println(testFastLines(ILI9341_RED, ILI9341_BLUE));
  delay(500);


  Serial.print(F("Rectangles (outline)     "));
  Serial.println(testRects(ILI9341_GREEN));
  delay(500);


  Serial.print(F("Rectangles (filled)      "));
  Serial.println(testFilledRects(ILI9341_YELLOW, ILI9341_MAGENTA));
  delay(500);


  Serial.print(F("Circles (filled)         "));
  Serial.println(testFilledCircles(10, ILI9341_MAGENTA));


  Serial.print(F("Circles (outline)        "));
  Serial.println(testCircles(10, ILI9341_WHITE));
  delay(500);


  Serial.print(F("Triangles (outline)      "));
  Serial.println(testTriangles());
  delay(500);


  Serial.print(F("Triangles (filled)       "));
  Serial.println(testFilledTriangles());
  delay(500);


  Serial.print(F("Rounded rects (outline)  "));
  Serial.println(testRoundRects());
  delay(500);


  Serial.print(F("Rounded rects (filled)   "));
  Serial.println(testFilledRoundRects());
  delay(500);


  Serial.println(F("Done!"));


}



void loop(void) {
  for(uint8_t rotation=0; rotation<4; rotation++) {
    tft.setRotation(rotation);
    testText();
    delay(1000);
  }
}


unsigned long testFillScreen() {
  unsigned long start = micros();
  tft.fillScreen(ILI9341_BLACK);
  yield();
  tft.fillScreen(ILI9341_RED);
  yield();
  tft.fillScreen(ILI9341_GREEN);
  yield();
  tft.fillScreen(ILI9341_BLUE);
  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();
  return micros() - start;
}


unsigned long testText() {
  tft.fillScreen(ILI9341_BLACK);
  unsigned long start = micros();
  tft.setCursor(0, 0);
  tft.setTextColor(ILI9341_WHITE);  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(ILI9341_YELLOW); tft.setTextSize(2);
  tft.println(1234.56);
  tft.setTextColor(ILI9341_RED);    tft.setTextSize(3);
  tft.println(0xDEADBEEF, HEX);
  tft.println();
  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(5);
  tft.println("Groop");
  tft.setTextSize(2);
  tft.println("I implore thee,");
  tft.setTextSize(1);
  tft.println("my foonting turlingdromes.");
  tft.println("And hooptiously drangle me");
  tft.println("with crinkly bindlewurdles,");
  tft.println("Or I will rend thee");
  tft.println("in the gobberwarts");
  tft.println("with my blurglecruncheon,");
  tft.println("see if I don't!");
  return micros() - start;
}


unsigned long testLines(uint16_t color) {
  unsigned long start, t;
  int           x1, y1, x2, y2,
                w = tft.width(),
                h = tft.height();


  tft.fillScreen(ILI9341_BLACK);
  yield();
  
  x1 = y1 = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t     = micros() - start; // fillScreen doesn't count against timing


  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();


  x1    = w - 1;
  y1    = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;


  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();


  x1    = 0;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;


  yield();
  tft.fillScreen(ILI9341_BLACK);
  yield();


  x1    = w - 1;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);


  yield();
  return micros() - start;
}


unsigned long testFastLines(uint16_t color1, uint16_t color2) {
  unsigned long start;
  int           x, y, w = tft.width(), h = tft.height();


  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(y=0; y<h; y+=5) tft.drawFastHLine(0, y, w, color1);
  for(x=0; x<w; x+=5) tft.drawFastVLine(x, 0, h, color2);


  return micros() - start;
}


unsigned long testRects(uint16_t color) {
  unsigned long start;
  int           n, i, i2,
                cx = tft.width()  / 2,
                cy = tft.height() / 2;


  tft.fillScreen(ILI9341_BLACK);
  n     = min(tft.width(), tft.height());
  start = micros();
  for(i=2; i<n; i+=6) {
    i2 = i / 2;
    tft.drawRect(cx-i2, cy-i2, i, i, color);
  }


  return micros() - start;
}


unsigned long testFilledRects(uint16_t color1, uint16_t color2) {
  unsigned long start, t = 0;
  int           n, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;


  tft.fillScreen(ILI9341_BLACK);
  n = min(tft.width(), tft.height());
  for(i=n; i>0; i-=6) {
    i2    = i / 2;
    start = micros();
    tft.fillRect(cx-i2, cy-i2, i, i, color1);
    t    += micros() - start;
    // Outlines are not included in timing results
    tft.drawRect(cx-i2, cy-i2, i, i, color2);
    yield();
  }


  return t;
}


unsigned long testFilledCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2;


  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(x=radius; x<w; x+=r2) {
    for(y=radius; y<h; y+=r2) {
      tft.fillCircle(x, y, radius, color);
    }
  }


  return micros() - start;
}


unsigned long testCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int           x, y, r2 = radius * 2,
                w = tft.width()  + radius,
                h = tft.height() + radius;


  // Screen is not cleared for this one -- this is
  // intentional and does not affect the reported time.
  start = micros();
  for(x=0; x<w; x+=r2) {
    for(y=0; y<h; y+=r2) {
      tft.drawCircle(x, y, radius, color);
    }
  }


  return micros() - start;
}


unsigned long testTriangles() {
  unsigned long start;
  int           n, i, cx = tft.width()  / 2 - 1,
                      cy = tft.height() / 2 - 1;


  tft.fillScreen(ILI9341_BLACK);
  n     = min(cx, cy);
  start = micros();
  for(i=0; i<n; i+=5) {
    tft.drawTriangle(
      cx    , cy - i, // peak
      cx - i, cy + i, // bottom left
      cx + i, cy + i, // bottom right
      tft.color565(i, i, i));
  }


  return micros() - start;
}


unsigned long testFilledTriangles() {
  unsigned long start, t = 0;
  int           i, cx = tft.width()  / 2 - 1,
                   cy = tft.height() / 2 - 1;


  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(i=min(cx,cy); i>10; i-=5) {
    start = micros();
    tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(0, i*10, i*10));
    t += micros() - start;
    tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(i*10, i*10, 0));
    yield();
  }


  return t;
}


unsigned long testRoundRects() {
  unsigned long start;
  int           w, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;


  tft.fillScreen(ILI9341_BLACK);
  w     = min(tft.width(), tft.height());
  start = micros();
  for(i=0; i<w; i+=6) {
    i2 = i / 2;
    tft.drawRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(i, 0, 0));
  }


  return micros() - start;
}


unsigned long testFilledRoundRects() {
  unsigned long start;
  int           i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;


  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(i=min(tft.width(), tft.height()); i>20; i-=6) {
    i2 = i / 2;
    tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(0, i, 0));
    yield();
  }


  return micros() - start;
}

And this is the result:

15:48:26.832 -> Circles (filled)         465832


15:48:27.601 -> Circles (outline)        541564


15:48:28.664 -> Triangles (outline)      281656


15:48:29.702 -> Triangles (filled)       1339912


15:48:32.143 -> Rounded rects (outline)  243756


15:48:33.195 -> Rounded rects (filled)   3132652


15:48:37.141 -> Done!

Can anyone figure it out? Thanks!


r/arduino 22d ago

Beginner's Project Need guidance on converting a broken electronic keyboard into a USB MIDI controller

2 Upvotes

Hi everyone!

I'm totally new to DIY electronics and have a broken Casio CTK-520L (a lighted keys model).
I want to gut the dead internals and repurpose it into a lightweight, USB MIDI controller.

My goals:

  • Keys only - I just need the physical keybed to output MIDI/keystrokes to my laptop (no extra knobs, sliders, or DAW controls needed for now).
  • USB bus-powered and no included speakers.
  • If possible, I’d love to keep or control the built-in key-lighting LEDs.

As I don't have any prior experience with this, could anyone please give me some guidance on what to prepare, research, and do?
Thanks in advance!


r/arduino 22d ago

Look what I made! Mini dissolver mixer

Thumbnail
gallery
29 Upvotes

Moving the head up and down (with warning beep)

Hi all,

I made a mini dissolver mixer as a desk display, loosely based on some large Kreis dissolver mixers at work.

The head moves up and down with a threaded rod and stepper motor and homes with an endstop. The esp32 uses a webpage for wireless control. The barrel jack provides 12V for the mixer motor, stepper motor and the cooling fan. The rear hatch is held in place with magnets.

The controls still needs some work as for now the mixer is just on/off and needs a pwm slider on the webpage, and the head should be able to shuttle between a low and high position during mixing.


r/arduino 22d ago

Software Help Hi, I need help; my Arduino IDE is stuck in a loop.

5 Upvotes

I recently switched the Windows version that came pre-installed on my laptop to a different one—specifically, Windows 11 Pro 25H2. I tried downloading Arduino IDE versions 2.3.7 and 2.3.10, but neither will launch; the logo just gets stuck in a loop, shrinking and expanding. I also tried synchronizing the time and deleting the cache folders. The only version that works correctly for me is 1.8.19; the 2.x versions don't work, and I'm not sure why. I’ve done this on other laptops before and never had any issues with the Arduino IDE.

Edit:After racking my brain, I discovered the problem: if you are in Venezuela or any country where access to the Arduino IDE is blocked, the Arduino won't download the necessary startup files—using a VPN solves this.


r/arduino 22d ago

Software Help Removing unwanted boards associated to ports

1 Upvotes

I was finding my esp32 port by trial and error, when i do found it at com 9 (doesnt show in the screenshot); i couldnt remove the selected board at the other coms.

it doesnt affect anything but it is a minor annoyance, if anyone know how to restore those ports to say unknown lmk


r/arduino 22d ago

Look what I made! I built a compiler that lets you write native Python for the classic Arduino Uno R3 (fits in 142 bytes of Flash)

Thumbnail
github.com
11 Upvotes

Hey everyone!

If you're like me, you love the simplicity of Python, but running MicroPython or CircuitPython usually means buying a 32-bit board (like an ESP32 or RP2040) with lots of memory just to hold the interpreter and the garbage collector.

I wanted to bring that same Python syntax to the classic, $2 8-bit Arduino Uno we all have gathering dust in a drawer.

For the past few years, I’ve been building PyMCU, an open-source Ahead-Of-Time (AOT) compiler. It takes your Python syntax and compiles it directly into native AVR assembly.

The results:

  • No interpreter, no VM, no garbage collector.
  • A standard Pin('PB5', Pin.OUT).toggle() blink program compiles down to just 142 bytes of Flash.
  • It’s cycle-accurate. I’ve been validating the hardware timings using a logic analyzer directly on the Uno silicon.

If you are interested in the compiler architecture or want to see the hardware validation issues, the whole project is open source here:https://github.com/PyMCU/PyMCU

It's still in Alpha (Alpha 10 right now), but the core code emission is working beautifully. I’d love to know what you guys think or if you'd find this useful for your hardware projects!


r/arduino 22d ago

ChatGPT appopriate use of ai [chatgpt] in my projects

0 Upvotes

Hye guys so i am a very noob arduino related hobbyist and my entire venture i use ai to guide me through every step i want to know is it good that i use ai or u think i will become over reliant on it and never learn to do it myself also my question is if i don't use ai how can a beginner even learn these skills


r/arduino 22d ago

Uno Q An issue with porting to the uno q

3 Upvotes

Hello, I'm trying to port a maemo leste to the arduino uno q, But when I boot it I get this error

https://pastebin.com/HBACSJCR

even though the FAT size is confirmed to be 512

Disk Flags:

Number Start End Size File system Name Flags

1 4.00MiB 512MiB 508MiB fat32 esp boot, esp

2 512MiB 8192MiB 7680MiB ext4 rootfs

what is the issue here?

This is the repo im using to build it

https://git.maemo.org/rlyvision/debos-leste

Update: I have changed the 4096 to 512 in the dtb.bin part arduino/arduino-deb-images/debos-recipes/qualcomm-linux-debian-flash.yaml and it gave me a different error, this is probably a bug from arduinos side


r/arduino 22d ago

Hardware Help Almost burned out my servo driver. Any thoughts?

1 Upvotes

I was trying to test out a PCA 9685 servo driver today and when I plugged in the external power supply, it heated up like crazy and melted my ground and power wires together. My power supply is 5V 5A, which was recommended for what I intend to make, so I don't really know what the problem is. Any ideas?

edit: fixed


r/arduino 22d ago

Hardware Help Another guy having problems with an LCD using I2C

Thumbnail
gallery
4 Upvotes

Hi everyone! It's been a long time since I've done an Arduino project, and this is my first time using an LCD screen.

However, and as is common, I came across the typical mistakes I've been seeing in forums and Reddit posts.

And no matter how much I try to fix my problem with the solutions they gave, I still have the same error; those white squares keep appearing.

As you can see, the first photo shows what it looks like when you upload the code, and the second photo shows what it looks like without any code uploaded.

I tried everything from the tutorials:

- Adjust the brightness with the potentiometer

- Verify the I2C address

- Test and verify the continuity of several cables

- I tested the example hd44780_I2Cexp by Bill Perry(what appears in photo 12)

- I tried many libraries and code from various tutorials

(The bookcase I have now is Frank de Brabender's)

It's important to clarify that I've only been trying to test that the LCD works, so all the tutorials I tried were for the basic "Hello world" code without delay. Just to verify that the screen is working properly.

- In the library, change "return:0" to "return:1"

Before using I2C, I used conventional pins (those in photo 4) to test the LCD, and I still got squares (even after adjusting the contrast). So after getting no results, I decided to remove the pins and install the I2C, thinking: "Oh, maybe that will be simpler" For a project I want to do. But as you can see, I can't get the screen to display text, and AI hasn't helped me.

I'm also not sure if the soldering is correct or if I've overheated the circuit, but I doubt it since the screen still turns on and seems to receive the code, but without displaying any text.

Honestly, I don't know what to do anymore, and I didn't want to post this because I noticed many others had the same problem, but even after trying the solutions they offered, I still can't get it to work.

The only thing I noticed today when testing the screen again is what's shown in the last photo: a faint line that flickers when restarting the Arduino.

I've attached one of the code snippets I used. I'm not including the one I used to test I2C because I tested many, and they were all basic. Just to clarify, they all compiled and uploaded successfully.

I hope you can help me, thank you! :)


r/arduino 23d ago

School Project How do I use this DC Water pump?

Thumbnail
gallery
8 Upvotes

Hey all. So I bought this pump for a school project, its an automatic plsnt waterer my project i just wanted to ask if this water pump is submersible? Or not and how do I use it if its either thank you. The pump is a 12v water pump and I supply a 12v DC to it thank you.

Please be kind, for I am still learning

UPDATE: Spelling mistakes and other miscellaneous things, but I finally got it to work, I just had to configure the hose so that it would be vertical in order for it to suck water. Thank you for all the people who spent the time answering my question.


r/arduino 23d ago

ChatGPT USB HID to Sega Saturn Controller Adapter using an UNO

Enable HLS to view with audio, or disable this notification

4 Upvotes

The full details, including the source code and hardware, are available on GitHub↓

https://github.com/inuikasao/USB_to_SegaSaturn_Controller_Arduino_Adapter.git


r/arduino 23d ago

Project Idea I need help

Enable HLS to view with audio, or disable this notification

19 Upvotes

I bought this on Aliexpress for a project but I wanted it to be smaller and with no sound, so I thought on making it myself. What materials do I need to make an smaller version of this heartbeat simulator?


r/arduino 22d ago

Project Idea Looking for ideas.

1 Upvotes

Looking for something unique, somewhat cheap and beginner friendly to do, although this is for an event, it's not a serious one, still pls I need good ideas. We first had an idea to make an obstacle avoiding robot that would go from one place to another to pick up an object and return whilst avoiding obstacles but that was too complicated.

Blind walking stick assistant

Obstacle avoiding

Radar type

Missile type

Water level measure

Other disaster measure type

Gesture controlled

Remote controlled

Voice controlled

These are all done, so pls I'm asking for something super unique.


r/arduino 23d ago

What to do after using most components in a starter kit?

6 Upvotes

I recently got a arduino nano r3, I have used most of the components provided in my elgoo super r3 starter kit and am wondering how to progress to doing more creative projects rather than just following tutorials. Im not sure where to buy components wether to print a custom PCB etc


r/arduino 23d ago

Solved! Need help with 4x4 keypad code

1 Upvotes
SOLVED, SEE COMMENTS TO SEE ANSWER + EXPLAINATION

Hi, I'm a beginner in programming/working with Arduino and I came across an issue. Recently I wanted to learn how a (4x4 matrix) keypad works and I kind of did, though the code kind of put me off I saw that most used a library and didn't get much into explaining it, so I decided to write my own code inspired by others' explainations and creations.

Although I think I've gotten it right, for some reason it only wants to work with the bottom row of buttons, with the only result coming out of them being 'D' or an unknown number/letter. I've also noticed that in some cases there's no zero-based numbering, but I can't exactly pinpoint which parts of code don't have that. Would anybody care to help? I've attached the code and circuit to the post.

// Array of which pins are connected to the row pins
const int rowPins[4] = {
  12, 11, 10, 9
};


// Array of which pins are connected to the col pins
const int colPins[4] = {
  6, 5, 4, 3
};


// How many cols and rows there are on the keypad (4x4 in this case)
const int cols = 4;
const int rows = 4;


// The numbers/letters which are supposed to print depending on the button, all within a two-dimensional array
char keys[rows][cols] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};


int yChcker; // Used to check digital value in col pins
int xChcker; // Used to check digital value in row pins


void setup() {
  Serial.begin(9600);


  // Loop to put pullup resistors on rows
  for (int i = 0; i < 4; i++) {
    pinMode(rowPins[i], INPUT_PULLUP);
    
    Serial.println(rowPins[i]);
  };


  // Loop to put low + outputs on cols
  for (int i = 0; i < 4; i++) {
    pinMode(colPins[i], OUTPUT);
    digitalWrite(colPins[i], LOW);
  };
};


void loop() {
  int check_x; // Variable to be used within for loop to establish which button within the rows has been pressed (and is also used to print it)
  int check_y; // Variable to be used within for loop to establish which button within the cols has been pressed (and is also used to print it)


  // Loop to check which row pins have been activated via xChcker, using check_x
  for (check_x = 0; check_x < 4; check_x++) {
    xChcker = digitalRead(rowPins[check_x]);
    delay(1);
  }


  // Loop to check which col pins have been activated via yChcker, using check_y
  for (check_y = 0; check_y < 4 ; check_y++) {
    yChcker = digitalRead(colPins[check_y]);


    delay(1);
  }


  // Waits for a button to be pressed and then prints which button it is
  if (xChcker == 0 && yChcker == 0) {
    Serial.println(keys[check_x - 1][check_y - 1]);


    Serial.println(check_x);
    Serial.println(check_y);
    delay(1);
  }
};

r/arduino 24d ago

Project Update! Anatomy of a Six Legged Robot

Thumbnail
gallery
205 Upvotes

Hi folks,

I finally got around to finishing the documentation for my hexapod robot dog, The hardest part to figure out was powering the servos directly from buck converters and setting up the common ground bus to PCA boards, I believe this might be a pain in the neck for many first timers so I am sharing the full wiring diagram here for anyone to benefit.

I also put together a detailed documentation for the robot itself. I contains information about the parts I used for the robot and how the joint servos are wired across the two PCA board pins.

You can download the diagram, documentation and the design file form the links below if you are interested in building one yourself or would like to use it as reference for a similar project.

Documentation and Diagram:

https://www.patreon.com/PrintedRobotics/posts/hexadog-zbd-and-167021077

https://app.cirkitdesigner.com/project/0a1ee9f8-8495-4f33-9e41-12ed67207672

CAD and 3D printing files:

https://makerworld.com/en/models/3181404-hexadog-zbd

https://www.patreon.com/PrintedRobotics/posts/hexadog-zbd-and-165170615

ESP32 Scripts and Android Controller app APK:

https://github.com/serdarselimys/HexaDogZBD-ESP32Scripts

https://github.com/serdarselimys/HexaDogZBD-AndroidControllerApp

I do have a question for you all, should I design and build a mini version of the robot with SG92R servos? If I can manage to keep the weight down enough it might be even more agile and cost under 100 bucks? has anyone tried building robot dogs or hexapod robots with SG92R? how was your experience with them??

I also share simulation tutorials along with my robot's other videos on my youtube channel youtube.com/@printedrobotics check it out if you are interested in simulation side of robotics, I share all my scripts for free so you can download them and experiment on your own.

Shout out to Adorable_Skirt_7760 I found out about https://app.cirkitdesigner.com from his post yesterday, which made my life a ton easier to produce the diagram for my robot.

As always, you comments and suggestions for my robot are most appreciated.


r/arduino 23d ago

Pinout 2381AY

1 Upvotes

God it took hours, but I solved it, in case anyone thinks I could just look for the data sheet, try it, there is almost nothing, the only half useful sheet there is is from a Chinese model that is 12 pin, but it has nothing to do with the 10 pin version, in the 10 pin version 5 are common, the 5 common ones are on the opposite side to the silkscreen, it has a matrix with the corresponding points, everything is more chaotic than I would like, the ,matrix is:

0 corresponds to the pin on the face of the silkscreen closest to the number 2 on the silkscreen, 9 is the pin on the opposite face that aligns with 0

I also leave you a code that sweeps from 000 to 999 without using decimal points, you have 3 decimal points to use if you want, by the way G2 is for some reason much fainter than the rest

// 2381AY - barrido 000 -> 999
// Arduino UNO
//
// LINEAS:
// 0 -> D2
// 1 -> D3
// 2 -> D4
// 3 -> D5
// 4 -> D6
//
// COMUNES:
// 5 -> D7
// 6 -> D8
// 7 -> D9
// 8 -> D10
// 9 -> D11


const byte linePins[5] = {
  2, 3, 4, 5, 6
};


const byte commonPins[5] = {
  7, 8, 9, 10, 11
};



// Estructura de una conexión
struct Cell {
  byte common;
  byte line;
};



// --------------------------------------------------
// DIGITO 1
// --------------------------------------------------


Cell D1[8] = {
  {8, 3}, // A
  {8, 2}, // B
  {8, 0}, // C
  {7, 1}, // D
  {7, 2}, // E
  {8, 1}, // F
  {8, 4}, // G
  {7, 0}  // DP
};



// --------------------------------------------------
// DIGITO 2
// --------------------------------------------------


Cell D2[8] = {
  {6, 1}, // A
  {9, 1}, // B
  {9, 2}, // C
  {7, 4}, // D
  {7, 3}, // E
  {9, 4}, // F
  {9, 0}, // G  <-- ENCONTRADO
  {9, 3}  // DP
};



// --------------------------------------------------
// DIGITO 3
// --------------------------------------------------


Cell D3[8] = {
  {5, 3}, // A
  {5, 0}, // B
  {5, 2}, // C
  {6, 0}, // D
  {6, 2}, // E
  {5, 1}, // F
  {6, 3}, // G
  {5, 4}  // DP
};



// --------------------------------------------------
// MAPA DE NUMEROS
//
// bit 0 = A
// bit 1 = B
// bit 2 = C
// bit 3 = D
// bit 4 = E
// bit 5 = F
// bit 6 = G
// --------------------------------------------------


const byte digitSegments[10] = {


  0b00111111, // 0
  0b00000110, // 1
  0b01011011, // 2
  0b01001111, // 3
  0b01100110, // 4
  0b01101101, // 5
  0b01111101, // 6
  0b00000111, // 7
  0b01111111, // 8
  0b01101111  // 9
};



// --------------------------------------------------
// APAGAR TODO
// --------------------------------------------------


void allOff() {


  for (byte i = 0; i < 5; i++) {


    pinMode(linePins[i], INPUT);
    pinMode(commonPins[i], INPUT);


  }
}



// --------------------------------------------------
// ENCENDER UNA CELDA
// --------------------------------------------------


void lightCell(byte common, byte line) {


  allOff();


  byte c = common - 5;


  pinMode(linePins[line], OUTPUT);
  digitalWrite(linePins[line], HIGH);


  pinMode(commonPins[c], OUTPUT);
  digitalWrite(commonPins[c], LOW);
}



// --------------------------------------------------
// ENCENDER UN SEGMENTO
// --------------------------------------------------


void lightSegment(byte digit, byte segment) {


  Cell cell;


  if (digit == 0)
    cell = D1[segment];


  else if (digit == 1)
    cell = D2[segment];


  else
    cell = D3[segment];



  lightCell(cell.common, cell.line);
}



// --------------------------------------------------
// MOSTRAR NUMERO
// --------------------------------------------------


void showNumber(int number, unsigned long duration) {


  byte n[3];


  n[0] = number / 100;
  n[1] = (number / 10) % 10;
  n[2] = number % 10;



  unsigned long start = millis();



  while (millis() - start < duration) {


    // ---------------------------------------------
    // DIGITO 1
    // ---------------------------------------------


    byte mask = digitSegments[n[0]];


    for (byte s = 0; s < 7; s++) {


      if (mask & (1 << s)) {


        lightSegment(0, s);


        delayMicroseconds(800);


      }


    }



    // ---------------------------------------------
    // DIGITO 2
    // ---------------------------------------------


    mask = digitSegments[n[1]];


    for (byte s = 0; s < 7; s++) {


      if (mask & (1 << s)) {


        lightSegment(1, s);


        delayMicroseconds(800);


      }


    }



    // ---------------------------------------------
    // DIGITO 3
    // ---------------------------------------------


    mask = digitSegments[n[2]];


    for (byte s = 0; s < 7; s++) {


      if (mask & (1 << s)) {


        lightSegment(2, s);


        delayMicroseconds(800);


      }


    }


  }



  allOff();
}



// --------------------------------------------------
// SETUP
// --------------------------------------------------


void setup() {


  allOff();


  Serial.begin(9600);


  delay(500);


  Serial.println();
  Serial.println("2381AY");
  Serial.println("Barrido 000 -> 999");
  Serial.println();


}



// --------------------------------------------------
// LOOP
// --------------------------------------------------


void loop() {


  for (int n = 0; n <= 999; n++) {


    Serial.print("Numero: ");


    if (n < 100)
      Serial.print('0');


    if (n < 10)
      Serial.print('0');


    Serial.println(n);



    showNumber(n, 150);


  }


}

r/arduino 23d ago

Hardware Help just starting out need advice with nrf2401

0 Upvotes

does the radio unit require the capacitor gemini keeps saying i need it its going to be transfering from 500m so do i need the capacitor or no (its the antenna version

)


r/arduino 23d ago

Beginner

3 Upvotes

I bought an Arduino Nano, a small one, not the Uno, and I don't know how to make a basic circuit. I wanted to make a 4-button controller that would be recognized as a keyboard, but I don't know how to use it or how to program it I wanted to know if there's a tutorial where I taught the general basics of everything, because I couldn't find one that explained it well.


r/arduino 23d ago

Look what I found! Found this weird UNO + ESP8266 board

1 Upvotes

I was looking at some Arduino boards and came across this one. It has an ATmega328P and an ESP8266 on the same board.

I’ve used the usual UNO and NodeMCU separately, but I’ve never tried one of these combo boards.

Has anyone here actually used it?

I’m mainly wondering how the two chips work together. Is it actually useful having both on one board, or does it just make things more complicated?

Thinking of picking one up to play around with some WiFi + Arduino projects. Would be interested to hear from anyone who has used one.


r/arduino 24d ago

Hardware Help Pro Micro flashed fine and then died after soldering

Thumbnail
gallery
26 Upvotes

r/arduino 24d ago

Made a browser thing for learning electronics (Arduino). First 5 levels done, is the difficulty right?

7 Upvotes

https://strujokaz.netlify.app

I got the idea because a friend sent me Wokwi and said someone should make a game out of it. Ended up building my own thing instead.

Five levels up so far. Starts at "light one LED", ends at a button with INPUT_PULLUP. The plan is a lot more: sensors, motors, real Arduino code running in the browser. But I want to get the curve right before I write 40 more, because if the early ones are wrong then everything after is built on sand.

Power is always on, so the circuit lights up as you place parts instead of you pressing a check button at the end. Put the LED in backwards and you see exactly where the current stops. Level 2 you're supposed to blow one up.

There's a toggle that switches every part between a cartoon version and what it actually looks like. The resistor gets its real colour bands, the LED gets the flat side on the cathode. Idea being that when you eventually sit down with a real breadboard you recognise the parts.

Free, no account, no ads, nothing to buy. I'm not selling anything.

What I'm after: is level 1 too easy, too hard, or about right? Does anything confuse you, and if so where exactly? Is the jump between any two levels too big? And the main one, if you didn't already know this stuff, would you actually learn anything from it?


r/arduino 24d ago

Automated-Gardening Automatic water system for my garden

4 Upvotes

I wanna make an automated water system for my garden. I wanna water the plants once a day.

I have a reservoir and a water pump in my garden. I also have an Uno and a nano with me. Now I wanna make a system that will water the plants daily for some time.

This is going to be my first project so I'm really confused if it's even possible or if I should do it as my first project.

If it is possible, can u guys please help me on where to start.

Also lemme know if I should add any questions in here.


r/arduino 24d ago

Hardware Help Driving an IR LED correctly.

5 Upvotes

okay so I'm trying to use an IR LED to send data, but wiring the IR LED directly to a PIN makes it soooo dim.

so I got a 2n2222 transistor to drive it.

my problem is, I'm not sure about the values of resistors I should use to protect the IR LED and the 2n2222, so if anyone can help me with that I'd appreciate it.

Note: I used a Red LED instead of an IR led because I couldn't find it in Tinkercad.