r/arduino 4d ago

Software Help Is my code okay? (in desc)

9 Upvotes
/*
tests the following:
Potentiometer on VP(36) 
Potentiometer on VN(39) 
MQ2 A0 on 34, D0 on 35 
Joystick X on 33, Y on 32, SW on 25 
Ultrasonic Sensor Trig 26, Echo 27 
Servo on 14 
Ir on 12 
DHT11 on 13 
L298N on (look down) //L298NONLY LEFT
OLED SDA on 21, SCL on 22
*/


//one pushbutton on 19
//one pushbutton on 18
//one pushbutton on 5


const int pot = 36;
const int pot2 = 39;
const int MQAO = 34;
const int MQDO = 35;
const int JoyX = 33;
const int JoyY = 32;
const int JoySW = 25;
const int trig = 26;
const int echo = 27;
const int IR = 12;
const int button1 = 19;
const int button2 = 18;
const int button3 = 5;
const int IN1 = 17;
const int IN2 = 16;
const int IN3 = 4;
const int IN4 = 23;
const int InputPins[] = { pot, pot2, MQAO, MQDO, JoyX, JoyY, JoySW, echo, IR };
const int OutputPins[] = { IN1, IN2, IN3, IN4, trig };
const int BUTTONS[] = { button1, button2, button3 };


#include <Arduino.h>


#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#include <Wire.h>
Adafruit_SSD1306 display(128, 64, &Wire, -1);


#include <DHT.h>
DHT dht(13, DHT11);


#include <ESP32Servo.h>
Servo Servo;


#include "BluetoothSerial.h"
BluetoothSerial SerialBT;



float temperature;
float humidity;
int potVal;
int potVal2;
unsigned long duration;
int distance;
int Xval;
int Yval;
int ClickVal;
int angle;
int GasA;
int GasD;
int ir_value;


void setup() {
  for (int i = 0; i < 9; i++) {
    pinMode(InputPins[i], INPUT);
  }
  for (int i = 0; i < 5; i++) {
    pinMode(OutputPins[i], OUTPUT);
  }
  for (int i = 0; i < 3; i++) {
    pinMode(BUTTONS[i], INPUT_PULLUP);
  }
  Servo.attach(14);
  Servo.write(0);
  SerialBT.begin("COMPONENT TESTER");
  dht.begin();
  Serial.begin(115200);
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    for (;;)
      ;
  }
  display.clearDisplay();
  display.display();
  display.setTextColor(SSD1306_WHITE);
  display.setTextSize(2);
  display.setCursor(0, 0);
  display.println("COMPONENT");
  display.println("TESTER");
  display.println("INITIAZLING");
  display.display();
  delay(2000);
  display.clearDisplay();
  display.display();
}


void dhtRead() {
  temperature = dht.readTemperature();
  humidity = dht.readHumidity();
  Serial.print("Temperature: ");
  Serial.println(temperature);
  Serial.print("Humidity: ");
  Serial.println(humidity);
}


void dhtPrint() {
  display.clearDisplay();
  display.display();
  dhtRead();
  display.setCursor(0, 0);
  display.println("DHT11");
  display.print("Temperature: ");
  display.println(temperature);
  display.print("Humidity: ");
  display.println(humidity);
  display.display();
  delay(1000);
}


void potentiometerRead() {
  potVal = analogRead(pot);
  potVal2 = analogRead(pot2);
  Serial.print("Potentiometer Value 1: ");
  Serial.println(potVal);
  Serial.print("Potentiometer Value 2: ");
  Serial.println(potVal2);
}


void potentiometerPrint() {
  display.clearDisplay();
  display.display();
  potentiometerRead();
  display.setCursor(0, 0);
  display.println("Potentiometer");
  display.print("First Value: ");
  display.println(potVal);
  display.print("Second Value: ");
  display.print(potVal2);
  display.display();
  delay(1000);
}


void ReadUltrasonic() {
  digitalWrite(trig, LOW);
  delayMicroseconds(2);
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);
  duration = pulseIn(echo, HIGH, 7000);
  distance = duration * 0.034 / 2;
  Serial.print("Distance: ");
  Serial.println(distance);
}


void ultrasonicPrint() {
  display.clearDisplay();
  display.display();
  ReadUltrasonic();
  display.setCursor(0, 0);
  display.println("Ultrasonic");
  display.print("Distance: ");
  display.println(distance);
  display.display();
  delay(1000);
}


void joyRead() {
  Xval = analogRead(JoyX);
  Yval = analogRead(JoyY);
  ClickVal = digitalRead(JoySW);
  Serial.print("X Value: ");
  Serial.println(Xval);
  Serial.print("Y Value: ");
  Serial.println(Yval);
  Serial.print("Click Value: ");
  Serial.println(ClickVal);
}


void joyPrint() {
  display.clearDisplay();
  display.display();
  joyRead();
  display.setCursor(0, 0);
  display.println("Joystick: ");
  display.print("X Value: ");
  display.println(Xval);
  display.print("Y Value: ");
  display.println(Yval);
  display.display();
  delay(1000);
}


void MQRead() {
  GasA = analogRead(MQAO);
  GasD = digitalRead(MQDO);
  Serial.print("GAS VALUES: ");
  Serial.print(GasA);
  Serial.println(GasD);
}


void MQPrint() {
  display.clearDisplay();
  display.display();
  MQRead();
  display.setCursor(0, 0);
  display.println("MQ2");
  display.println("GAS VALUES: ");
  display.println(GasA);
  display.println(GasD);
}


void ServoMotor() {
  for (int i = 0; i < 179; i++) {
    Servo.write(i);
    display.clearDisplay();
    display.display();
    display.println("Servo");
    display.println("Angle: ");
    display.print(i);
    Servo.write(i);
    delay(40);
  }
}


void IRread() {
  ir_value = digitalRead(IR);
  Serial.print("IR VALUE: ");
  Serial.println(ir_value);
}


void IRprint(){
  display.clearDisplay();
  display.display();
  IRread();
  display.setCursor(0,0);
  display.println("IR");
  display.println("IR VALUES: ");
  display.println(ir_value);
}


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


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


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


void movement(){
  display.clearDisplay();
  display.display();  
  display.setCursor(0,0);
  display.println("L298N");
  display.println("Front");
  forward();
  delay(1000);
  backward();
  display.clearDisplay();
  display.display(); 
  display.setCursor(0,0);
  display.println("L298N");
  display.println("Back");   
  delay(10000);
  stop();
  display.clearDisplay();
  display.display();  
  display.setCursor(0,0);
  display.println("L298N");
  display.println("Stop");
  delay(10000);
}


/*
1 = dht
2 = ir
3 = joy
4 = MQ
5 = Ultrasonic
6 = potentiometer
*/


void loop() {
}

So, this is like my ninth project I myself am coding. I wanna see if the code is okay till now, I will add like a button mechanism to decide when one sensor is gonna do its things. Basically, im going to use buttons to decide with one button making the program go to the next sensor/module and yeah. I also have bluetooth printing left. So, i will fix the loop and bluetooth later.


r/arduino 5d ago

A garage jack as a third hand

162 Upvotes

I want to build the same model for my garage, but on a larger scale, and add voice control so it can fetch the right tool

Perhaps someone has experience configuring this kind of software or can suggest where to start specifically for voice control.


r/arduino 4d ago

Added live scores to my matrix

Post image
30 Upvotes

I built this matrix display a few years ago because I wanted something kind of art kind of fun. Usually I have it playing a video playlist thats either n64 video game play throughs, 90s cartoons, I have a playlist with movies, 90s music videos. But I decided it would be cool if when one of my teams was playing it would turn into a live scoreboard.

Now whenever my team plays it pauses whatever is playing and turns into this. I dont follow an mlb team but it was the only game live and I wanted to make sure it works. So its, logo, team name (yellow dot means home team), score, quarter and time, and then sport specific stat. When the game is over it auto switches back to a playlist all hands off.

The setup is the lights are connected to an esp32 running wled which acts as the controller, then I have FPP on a pi to play the videos, the score update is a script that runs on the pi.

Also here are some random videos on it.
https://imgur.com/a/gmHV3J7
https://imgur.com/a/MAyVd8G

https://imgur.com/a/3djm4hP

https://imgur.com/a/r6BQByD


r/arduino 4d ago

Hardware Help Need help with 240x320 TFT module on ESP32

Post image
11 Upvotes

I have this 240x320 TFT module with ILI9341 driver, but theres corruptuon at the bottom, and renders only 240x240. How can i get it fixed? Since i went through everything and i cant fix it. ESP32 code: #include <SPI.h>

#include <TFT_eSPI.h>

#include <XPT2046_Touchscreen.h>

// ---------- TFT ----------

TFT_eSPI tft = TFT_eSPI();

// ---------- TOUCH ----------

#define TOUCH_CS 15

#define TOUCH_IRQ 27

XPT2046_Touchscreen touch(TOUCH_CS, TOUCH_IRQ);

unsigned long lastFPS = 0;

int fps = 0;

int frames = 0;

void setup() {

Serial.begin(115200);

// SPI begin

SPI.begin(18, 19, 23);

// TFT init

tft.init();

tft.setRotation(1); // landscape

tft.fillScreen(TFT_BLACK);

// Touch init

touch.begin();

touch.setRotation(1);

// Boot screen

tft.setTextColor(TFT_WHITE, TFT_BLACK);

tft.setTextSize(2);

tft.setCursor(20, 20);

tft.println("ILI9341 TEST");

delay(1000);

}

void loop() {

// ---------- FPS ----------

frames++;

if (millis() - lastFPS >= 1000) {

fps = frames;

frames = 0;

lastFPS = millis();

}

// ---------- Draw colorful demo ----------

tft.fillRect(0, 0, 80, 80, TFT_RED);

tft.fillRect(80, 0, 80, 80, TFT_GREEN);

tft.fillRect(160, 0, 80, 80, TFT_BLUE);

tft.fillRect(0, 80, 80, 80, TFT_YELLOW);

tft.fillRect(80, 80, 80, 80, TFT_CYAN);

tft.fillRect(160, 80, 80, 80, TFT_MAGENTA);

// ---------- FPS display ----------

tft.fillRect(0, 200, 240, 40, TFT_BLACK);

tft.setTextColor(TFT_WHITE, TFT_BLACK);

tft.setTextSize(2);

tft.setCursor(10, 210);

tft.print("FPS: ");

tft.print(fps);

// ---------- Touch test ----------

if (touch.touched()) {

TS_Point p = touch.getPoint();

Serial.print("Touch X: ");

Serial.print(p.x);

Serial.print(" Y: ");

Serial.println(p.y);

// Draw touch dot

int x = map(p.x, 200, 3800, 0, 320);

int y = map(p.y, 200, 3800, 0, 240);

x = constrain(x, 0, 319);

y = constrain(y, 0, 239);

tft.fillCircle(x, y, 5, TFT_WHITE);

tft.setCursor(120, 210);

tft.print("X:");

tft.print(x);

tft.print(" Y:");

tft.print(y);

}

delay(10);

}


r/arduino 4d ago

ATTiny85 Bipolar Differential - odd values

3 Upvotes

I am a decently advanced user of ATTinys, but I've hit a snag. I am attempting to use the differential ADC on an ATTiny85.

If I do a unipolar differential conversion using ADC2 on both the positive and negative side, it gives me a value of 2-3. This seems normal and expected. Both the positive and negative are the same, so it should be close to 0.

If I set the Bipolar Input Mode flag, with the same inputs, it gives me around -310. This value should be around -3v, which seems way off. I noticed when reading ADC2 in single ended mode with the BIN flag still set, the value was off by a couple hundred vs with the BIN flag cleared.

I've tested this code with 2 ATTiny85s with the same result

the test code:

#define F_CPU 1000000

#include <avr/io.h>
#include <util/delay.h>
#include "UART.h"

int main(void) {
  serialBegin();

  // Bipolar Input Mode
  ADCSRB |= (1 << BIN);

  serialPrintString("ADCSRB: ");
  serialPrintBinary(ADCSRB);
  serialPrintChar('\n');

  // ADC2 / ADC2 1x gain
  ADMUX |= (1 << MUX2);

  serialPrintString("ADMUX: ");
  serialPrintBinary(ADMUX);
  serialPrintChar('\n');

  // ADC Enable
  // ADC Prescaler - 8
  ADCSRA |= (1 << ADEN) | (1 << ADPS1) | (1 << ADPS0);

  serialPrintString("ADCSRA: ");
  serialPrintBinary(ADCSRA);
  serialPrintChar('\n');

  while (1) {
    // Set ADC Start Conversion
    ADCSRA |= (1 << ADSC);

    // ADC Start Conversion will clear when the conversion is complete
    while (ADCSRA & (1 << ADSC)) {
      _delay_ms(1);
    }

    serialPrint10b2c(ADCL | (ADCH << 8));
    serialPrintString(" : ");
    serialPrintBinary(ADCH);
    serialPrintString(" : ");
    serialPrintBinary(ADCL);
    serialPrintChar('\n');

    _delay_ms(1000);
  }
}

The output in unipolar mode:

ADCSRB: 0b00000000
ADMUX: 0b00000100
ADCSRA: 0b10000011
1 : 0b00000000 : 0b00000001

The output in bipolar mode:

ADCSRB: 0b10000000
ADMUX: 0b00000100
ADCSRA: 0b10000011
-309 : 0b00000010 : 0b11001011

The datasheet: https://ww1.microchip.com/downloads/en/devicedoc/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf

Any thoughts as to why bipolar mode gives me a negative value?

Thank you for your help!


r/arduino 4d ago

Hardware Help Can I use an MQ137 without the module?

3 Upvotes

Hello, I'm new to all eletronics and I'm having trouble doing things on my own without following a tutorial and copying what they do when it comes to connect things. I wanted to buy an MQ137 (sensor for ammonia), but where I'm at it's quite difficult and expensive to get. I found one available at an e-store but it comes without that module I see in all pictures. Can I still use that or is it too advanced? I found in a page that it has 6 pins, one goes to Vcc and the other to GND, that I get, and the others I see that I need to connect to an analog pin, but there are some resistors involved and I don't understand how to calculate it.

I'd appreciate any help or if you have a link that does it. Thank you!


r/arduino 4d ago

Software Help Writing a BASIC/SAKO Compiler to Assembly for Adruino

7 Upvotes

For questions in simple form go to the last lines of the post

The plan.

Proper BASIC is lacking/nonexistent on Arduinos (Only been attempted as interpreted language or paid and underused like BASCOM which is ehh in my opinion). What I want is to write is a compiler from BASIC to assembly. Why assembly and not cross compiling to C? I want to start learning assembly for the arduinos as I dabbled in U880 and MCY7880 assemblies and my own designed cpu (4bit data, 6 bit instruction) and I decided this will be a perfect way to start learning. If there is a Windows utility that can convert BASIC to C for Arduinos especially (Like BACON does on linux but that one won’t work for ardunios and other MicroControlers) please let me know because it will technicaly solve all my problems.

I saw couple of posts about doing assembly for arduinos but most of the links from them are dead. I need a step by step guide on how to upload and compile assembly code to arduino.

Second question. I got a long time ago a book “Z80 ASSEMBLY LANGUAGE SUBROUTINES” by Lance A. Leventhal and Winthrop Saville. This book features well written, highly documented example subroutines for U880 cpus (z80 for you west people) that are tested. Is there such book for Arduinos? Basically a book that has readymade subroutines in assembly for specific functions (ASCII to BCD conversions, trigonometric functions etc.)

Third thing which is not a question but why I prefer to write a compiler. I want to rise a dead language from its grave. To my knowledge after 60s none did anything in it. The language is SAKO which is an old Fortran like language for polish mainframes form the 60s. I want to attempt to make a version of SAKO for microcontrollers. Why? Simple its fun using non typical languages (That’s why people do BrainFuck) plus its SAKO and I love the way its structured, written and anything.

TL,DR

1.I need a good step by step guide for programming arduinos in Assembly.

2.If a BASIC to C cross compiler for arduinos especially exists

3.If there is a book for arduinos similar to this one “Z80 ASSEMBLY LANGUAGE SUBROUTINES” by Lance A. Leventhal and Winthrop Saville.

Please note that

A. Windows Is the preferred system for any utilities or guides you provide.

B. I don’t plan on doing C for living on arduinos. I want to use BASIC for all of my home projects. I can use C but my main rule is “BASIC at home C if forced”

C. Eventually I want to make the compiler public on github soo people can improve it plus be easily accessible for others.

D. SAKO is a language that has no flaws.

E. Since a young age I self  taught myself BASIC (not VisualBasic ) due to
my love for vintage computers . This language is my favorite and I feel much
more comfortable in it compared to C or Python both in its syntax and way of
displaying code (I instinctively do line numbers and remove all indentation
from any code I’m working on as indented code is harder for me to read).


r/arduino 4d ago

Hardware Help ESP32-S3 and quadrature encoder?

6 Upvotes

https://www.omc-stepperonline.com/nema-23-closed-loop-stepper-motor-1-85nm-256-9oz-in-with-magnetic-encoder-1000ppr-4000cpr-23hs30-2804-me1k

How do I work with this encoder using an ESP32-S3? In my research it looks like it can't just be hooked up directly to the ESP. It needs a differential receiver like an AM26LS32. But that works on 5v and the ESP GPIO is 3v. And I can't find a breakout board for it or any other similar chip.


r/arduino 5d ago

Mod's Choice! Gift box

Thumbnail
gallery
83 Upvotes

First of all, I stole this idea from u/ripred3 a couple years ago and finally got around to making the project myself. There’s some slight differences between his and mine but the idea is the same. Basically, it is a locking gift box that will only open when the box is within a certain proximity (in this case 5 meters) to a programmed set of coordinates. Pretty proud of this one as it is my first ‘non tutorial’ Arduino project. I designed the box in fusion and 3d printed it so each component had mounting holes with those heat set threaded inserts. Most components are from adafruit and it is running off a nano r4.


r/arduino 5d ago

IR controlled turret project finished!

154 Upvotes

Made with an Arduino nano, two high speed DC motors for the flywheels, two MG90s servos for X and Y axis movement and one SG90 for feed control. All with a custom 3D printed body, made by me. It's my second big project that I've finished, and I'm very happy with how it turned out!


r/arduino 5d ago

Getting Started Arduino Traffic Light System

24 Upvotes

I heard about a task requiring a demonstration of traffic lights using Arduino and took on the challenge.

While researching other posts on this subreddit I came across the idea to add a pedestrian button. The time that the light is green will be halved for that cycle that the button is pressed, and subsequent presses during the same cycle will not affect the time. I will be doing this next time.


r/arduino 4d ago

Software Help I want to use a DFPlayer Mini as a standalone project. Is programming necessary?

3 Upvotes

I am making a little MP3 player as a beginner project. I have never worked with DFPlayers before and I’m wondering if they need to be programmed or if they can just be used out of the box. One feature my project will use is ADKEY1 for all the controls (play/pause, volume +/−, etc.).


r/arduino 5d ago

Beginner's Project I need help with Nano Every and DFPlayer compatibility.

Post image
7 Upvotes

To preface, I am completely new to coding/Arduino.

In short, I've been trying to make a simple toy with a button that plays a random mp3 file from a MicroSD card.

Before trying to figure out all that coding, I wanted to just get a sound to play through the speaker. I've been at this for several hours and cannot for the life of me figure it out.

For this test, I believe I only need...
An Arduino Nano Every
DFPlayer with MicroSD and appropriate mp3 files
A small speaker

THE PROBLEM: The DFPlayer continually fails to be detected.

The attached image is my current wiring configuration. To write it out...

- Nano Every grounds and DFPLayer grounds are connected on a breadboard

- Nano Every 5v -> DFPlayer VCC
- Nano Every D10 -> DFPlayer RX
- Nano Every D11 -> DFPlayer TX

-DFPlayer SPK_1 -> Speaker 1
-DFPlayer SPK_2 -> Speaker 1

This is the code I've put into the Arduino IDE/Nano Every:

#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>

// DFPlayer communication pins
SoftwareSerial mySerial(10, 11); // RX, TX
DFRobotDFPlayerMini myDFPlayer;

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

Serial.println("Starting DFPlayer...");
if (!myDFPlayer.begin(mySerial)) {
Serial.println("DFPlayer NOT detected!");
while (true); // stop here if failure

}

Serial.println("DFPlayer ready.");
myDFPlayer.volume(25); // range 0–30
delay(1000); // small startup delay
// Play first file: /mp3/0001.mp3
myDFPlayer.playMp3Folder(1);

}

void loop() {
// nothing needed here

}

The "Error" I keep getting:

DFPlayer NOT detected!

Notably, the "error" only shows up in the Serial Monitor. I am not getting a standard error message- only the one the code is sending.

Things I have tried:

1.) Plugging the Arduino into a known 5v output plug to ensure it's not a lack of power.
2.) I tried using the serial connections with different code to match– did not work. If needed, I can attach that code/wiring configuration in the comments
3.) Switching out the wires
4.) Taking the breadboard out of the equation, connecting ground alone
5.) Formatting the SD card correctly. Using MS-DOS(FAT) on Mac. it is a 16GB microSD.
6.) Ensuring file folder is formatted: mp3[folder] then 0001.mp3 - the file I am testing is very small, 10 seconds long.
7.) Ensuring power is there [green light on nano every, red light flashes on DFPlayer when inserting SD]
8.) Testing simple led flashing code to ensure code is working at all on the Nano Every [it is]
9.) Switching the 5v to the 3V3 pin to see if 5v was incorrect. Neither works.

In Arduino IDE:

1.) I am utilizing Arduino megaAVR boards -> Arduino Nano Every.
2.) The port is correctly set to the Arduino. Led test code has worked.
3.) [SoftwareSerial.h] and [DFRobotDFPlayerMini.h] libraries are installed.
4.) Programmer is set to [Onboard Atmel mEDBG Uno Wifi Rev 2] - The internet tells me this is correct for the Nano Every

Computer I am using:

MacOS Tahoe, V26.5. I am on a machine with an M-chip, no intel. Not sure if that matters.

I would very greatly appreciate my sanity being saved after all of this trouble shooting- fingers crossed that I am just missing something obvious.


r/arduino 5d ago

Look what I made! Space Shooters game I made months ago

29 Upvotes

r/arduino 5d ago

Power Seeed Xiao nRF52840 via LiPo battery

6 Upvotes

I’m trying to make the Seeed Xiao portable by powering it through a 3.7V 500mAh LiPo battery, currently through a breadboard and without soldering. I have read that breadboard powering through LiPo batteries can be dangerous without proper setup (from shorts).

I found this battery which reportedly has in-built discharge and overcharging protection: https://thepihut.com/products/500mah-3-7v-lipo-battery

Is it safe to plug the battery (via the JST connector) directly into the breadboard and power the XIAO board? If yes, can I do this by connecting the JST connector via breadboard wires directly into the breadboard? And does this have to go through the power rails first or can it go directly in-line with the XIAO board?


r/arduino 5d ago

FINALLY: Serial Monitor Copy Button

9 Upvotes

Arduino IDE has been missing this for so long. V2.3.9, finally. YES

top right of serial monitor, 4th button

idk just wanted to see if anyone else noticed. Doesnt seem to be in the changelog

Edit: it is in the changelog, V2.3.7. I guess I skipped 2.3.7 and 2.3.8.


r/arduino 6d ago

Beginner's Project What should my first project be?

Post image
247 Upvotes

Hey guys! Have this Arduino starter kit and don't know where to start. Always wanted to learn electronics, first time watching spiderman one of the things i got out was how cool it was to tinker with old tech and understand it and reporpuse it! But i heard arduinos are a good way to start and i see a bunch of projects but not sure where to start


r/arduino 5d ago

Look what I made! Colour matching game Arduino nano esp32

12 Upvotes

My first Arduino project! I made a standalone colour matching game — the device runs its own Wi-Fi so you just connect your phone, get a random target colour, and use the red, green and blue buttons to try and match it. All the code and STL files are available. More info on how to make it here: https://youtu.be/e15zLeG0VB8?si


r/arduino 6d ago

Automated-Gardening Who would have thought that a cardboard casing couldn't withstand the climatic requirements of a greenhouse in the long run? 😆

Post image
65 Upvotes

r/arduino 5d ago

ChatGPT Ports NOT showing up

2 Upvotes

I downloaded the Arduino IDE & Connected the Mega2560.

I started the Application and downloaded all the added packages that popup when the board is connected.

Before uploading a sketch, when I try to Select Ports :

On my PC it is only showing me with COM1 and no other ports.

On my laptop, even COM1 doesnt show up.

I am new to Arduino, and am making everything for the first time, with the help of ChatGPT ofcourse.

Any help on this is greatly appreciated.

Thanks.


r/arduino 6d ago

Look what I made! Cutest Mad Ottoman in the World

650 Upvotes

the latest from Mario the Maker Magician


r/arduino 5d ago

Look what I made! WIP Quadcopter Drone

6 Upvotes

https://reddit.com/link/1tpa17n/video/4dgdtebvcp3h1/player

https://reddit.com/link/1tpa17n/video/uhitejdwcp3h1/player

I posted a few days ago about the flight controller I made for a DIY drone. Now I'm back with pictures of the actual thing, and a video of it... well "flying" may not be the correct term so much as "hopping". I've been tuning the PID controllers (specifically the P terms) for the pitch and roll axis and now I think I've gotten those dialed in, so it's time to start adding the I terms in and see if I can get rid of that persistent front-left bias. At least, that is my theory on what's going on right now. The reason that it's "hopping" instead of staying in the air is simply that I decrease the throttle once it goes up to prevent it from flying off into the distance while it's still being tuned.

Parts list:

  • Arduino Uno R3 running the flight controller software and coordinating everything
  • Mateksys PDB hex
  • Readytosky 30A opto ESCs
  • Flysky FS-I6 RC transmitter and a FS-IA10B receiver
  • MPU6050 6-axis IMU
  • Readytosky RS2205 BLDC motors
  • Ovonic 100C 1550mAh lipo battery
  • GoPro Hero 10 camera
  • Quite a lot of random hardware, custom wiring, 3D printed frame, etc
  • There was once a buzzer for making a cool startup sound and beeping out error codes but I broke it

The ESCs are soldered directly onto the PDB and mounted to the bottom, including the signal wires. A custom wire harness then takes 12V power and ground from the PDB and uses it to power the Arduino, along with all the signal wires (white) to go to GPIO pins on the board. The radio receiver gets power from the onboard 5V regulator and has a green PPM signal wire going back to the Uno. The IMU gets power from the onboard 3.3V regulator and communicates over the I2C bus to the board.

As mentioned in the last post, the drone is running a custom flight controller I made called ApollonFC. I've been tuning the P terms for the pitch/roll PIDs and think I've gotten that dialed in about as good as it'll get. Now I will likely move on to the I terms and see if that helps with the front-left bias it's showing in the most recent videos. If anyone has any suggestions on how to improve stability, let me know. If you're interested, the pitch PID currently has (100, 0, 0) and the roll PID currently has (28, 0, 0) (P, I, D) terms.

Sorry if the videos aren't particularly exciting! All the bad crashes happened earlier on in testing and I'd rather not have to print a new baseplate and do a full teardown just to get good footage.


r/arduino 5d ago

What us your experience about this gsr sensor ?

Post image
7 Upvotes

I tried to make a biofeedback project using esp and gsr sensor like the above one that if my measurements exceed certain threshold it will give a haptic feedback or leds will light up
After buying it I found there is no saturation in reading that I donnot know if that is the sensor or my body …I searched in gemini and found that there is much work to filter noises
Do anyone have a experience with this sensor?it is really not meant to make a good biofeedback project with it and its reading are low quality and not reliable that I confuse myself more ?
I don’t want to work another couple of months with no output or bad feedback?


r/arduino 5d ago

Hardware Help smart home setup hardware help

3 Upvotes

what mmWave sensor would you guys recommend? I'm trying to make a smart home setup (for now just turning lights on/off when it gets dark but I'm planning on making an app for my phone that'd let me control the lights) as a fun project to work on in my free time and I'm seeing a lot of options but probably the best one I found is "Indoor Fall Detection Sensor - C1001". I'm also looking for a module that'd let me connect some things wirelessly to the main board like the sensor itself. and most importantly, will arduino uno R3 be enough for a system like that?


r/arduino 6d ago

First working project. Simon says.

27 Upvotes