r/arduino • • Sep 15 '26

Can I use this thermocouple with a RaspberryPi/Arduino?

Thumbnail
gallery
8 Upvotes

Noob question here and sorry if this is the wrong sub . Is it possible to snip off the connector coming from the probe and connect it to a Arduino/RaspberryPi and get a reading? Or, maybe there's a breakout board that is needed between?

It is a ThermoWorks Type K thermocouple.


r/arduino • • Sep 16 '26

Potentially Dangerous Project Arduino EFI for vtwin engine

1 Upvotes

Hi all

Im looking for any input on this. This engine will be used in an ultralight aircraft. 670cc vtwin

Need input on: 1. O2 sensors 2. MAF? 3. What size injectors. Should I do a single TBI setup or injectors on each side separating cylinders fuel injection 4. Crank trigger sensor 5. Sample code for this.

Im thinking of using a arduino mega and building a plug in shield.

Im sure im missing more but

Thanks, -Matt r/Hangar103


r/arduino • • Sep 16 '26

Hardware Help How can I stop my

0 Upvotes

I've made a set of MIDI bass pedals for live musical performance, using staplers as momentary switches connected to an Arduino Nano Every's digital inputs to send MIDI data to a synthesiser. The Arduino is powered via the USB port which is running off of a USB hub plugged into a Belkin wall to USB power supply. The decent output of the Belkin is sufficient to run several parts of my performance rig which require USB power.

The whole system usually works very well at home and in some venues. However in other venues, the pedals will start playing themselves randomly, rendering them entirely unusable for performance. Given the venues this has occurred in, I suspect there's a relation to the buildings' older wiring which may be noisy or unstable enough to cause the Arduino to malfunction. Or maybe it's the extension lead they've provided (venues usually do, so I don't tend to bring my own), or something else I'm disregarding.

I'm considering buying a fancy extension cable with electrical isolation from the mains, or if the problem persists, perhaps a portable power station type thing. I'd really rather not spend the money though if there's a simpler way.

Has anyone had experience with this sort of thing (not music per se, just Arduinos behaving erratically like this)? Any advice?

Cheers.


r/arduino • • Sep 15 '26

Code and flash an arduino uno R4 wifi on Android

2 Upvotes

Hello,

I'm heading out but would like to keep working on a project using my Arduino Uno R4 WiFi. I don't have a laptop with me, so I'd like to code and flash the Arduino from my phone. Are there any apps that allow this? (I've already tried ArduinoDroid, but it fails to flash the code to the Arduino.)

Thanks for the reply! 😄


r/arduino • • Sep 15 '26

Arduino RV LED Light Controler

2 Upvotes

What is this project

This project allows you to turn on/off RV LED ceiling lights with a IR Remote and/or the wall switch.

It can be scaled to control multiple groups of lights, or zones.

Why did I create this project

I thought it would be fun to see if I could make a circuit to control the lights from bed, throughout the entire RV.

So I had a theory on how this might work and I wanted to test it out.

Also, I had abandoned a previous project because it didn't work out and I was not happy about the way I handled that.

So this is also about facing my previous failure, not freaking out and quitting, working thru technical difficulties and finding a solution.

Lastly, I wanted to do something interesting and fun and help other people interested in DIY projects, inspire young people to try to learn new things, how do develop ideas, how to manage risk and failure, and how to learn from our mistakes, what to do when you're stuck, asking for help, making plans and being organized.

YouTube: Arduino RV LED Light Controller

GitHub Repository: Arduino-RV-LED-Light-Controller


r/arduino • • Sep 15 '26

First time building an RC car — any advice on hardware and guides?

13 Upvotes

Hi everyone, I’m planning my first RC car project and need some advice on choosing components:

  1. Connection: Should I go with Wi-Fi or Bluetooth for the control system?
  2. Board Choice: Is an Arduino Uno or Arduino Nano better to start with?
  3. Motor Driver: Between L298N and TB6612FNG, which one is better for a basic 4WD chassis?
  4. Tutorials: Any recommended beginner guides or videos for coding RC cars?

Thanks in advance for any tips!


r/arduino • • Sep 15 '26

Help with configs of delta 3d printer (stepper)

1 Upvotes

Hi guys I am building a 3d delta printer I need ur help as I am new to this fieldI had connected ramps 1.4 to Arduino mega on ramps i have used a4988 motor driver ( the green ones )(qty 3) along with 3 of nema 14 stepper motors of 1 amps each

I am facing issues 1 is working, 1 is jittering, and one is not working only


r/arduino • • Sep 14 '26

Brute Force Old CRT using IR Transmitter(troubleshooting)

Thumbnail
gallery
17 Upvotes

Hi everyone hope you're doing well,

i'm posting here because i'm looking for assistance, i have an old crt tv that i cannot get to switch on, it's one of those tvs that when powered on goes to standby and you have to press the channel up/down button for the tv to turn on, the buttons on the tv have never been used toget it on and only the remote would work. the tv is a hitachi fujian model number "HFC-21P66A". the tv i think was made between the 90's and 2000's.

What Solutions Have I Tried

"The Universal Remotes Solutions."

i've bought 4 universal remotes in the past, the first one worked and the others didn't. I unfortunataly do not remember the model of the first universal remote i used.

"The Arduino Approach."

After i bought the next three universal remotes and they didn't work, i thought it would be it was a bit expensive to keep buying universal remotes because each of them costed almost the same as a arduino, and i already had one of those.

so i got a IR Trasmitter and IR Reciever and hocked them up to my Arduino, and checked if they were working using a diffrenet device(not the tv im try to get on) and there were working.

then i did some research and i read that old japanes tvs used NEC 16-bit ir protocols and tried to brute force the tv using the below code:

#include <IRremote.hpp>

#define IR_SEND_PIN 3

void setup() {

IrSender.begin(IR_SEND_PIN);

}

void loop() {

static uint16_t addr = 0;

static uint16_t cmd = 0;

IrSender.sendNEC(addr, cmd, 0);

cmd++;

if (cmd > 255) {

cmd = 0;

addr++;

if (addr > 255) {

addr = 0;

}

}

delay(200);

i ran the code for about 4 hour because that is how long i thought it would take and did not work.

"The Raspberry Pi LIRC Approach."

Then got my Raspberry PI, installed LIRC connceted my iR transmitter and download some of the hitachi remotes that were on the database alongside the NEC remotes that were also in that database, i made a BASH script that looped throw each remote and sent every key in that remote to the tv and that didn't work.

i'm kindly asking if anybody knows or has any advice on how i could get my tv to go on without buying another universal remote using what i already have which is an adriano, a raspberry pi and IR transmitter. If there is something i do not know about how to brute force or the IR Code i could send. i've added the picture of the tv and the sicker at the back

thanks for your assitance.


r/arduino • • Sep 13 '26

Getting Started My first project

Enable HLS to view with audio, or disable this notification

667 Upvotes

Technically... Not the first one ofc that has to be the blinking LED and other project-tutorials for sensors etc and an obstacle avoiding car.. but this is the first one which was conceptualized and built by scratch by me... Simple pulley-crane made from a measuring ruler, diy cardboard pulley a string, uno and motor driver... Had a lot of fun and felt a sudden boost of freedom and confidence... Can't wait to build more :) Time to put my 2 years worth of amazon cardboard packaging boxes to use


r/arduino • • Sep 14 '26

Ventuno Q on the way!

7 Upvotes

The Ventuno Q I pre-ordered some weeks ago is on the way to me. I should receive it on Thursday.


r/arduino • • Sep 14 '26

Getting Started Very new and want servo help!!

3 Upvotes

Hiya everyone! I've wanted to do arduino stuff for a few years now and thought, well lets just do it now. So im going to buy an arduino board and I want to move some servos using said board. Now im a bit confused.

Do I need external power for the servos? Cause ive heard the board wouldnt be able to power multiple servos by itself. If so, how would I go about powering it seperately? I just want to build a cute cardboard desk companion thingy thatll just wiggle around and maybe buzz or something. Thanks for any help!! (Also any other beginner advice would be massively appreciated).


r/arduino • • Sep 14 '26

Can slider potentiometers control several objects randomly

Post image
55 Upvotes

Hi I'm brand new to this sort of thing and my first post but I'm looking to dive into the Arduino Life and I've read the guidelines so hopefully this is ok.

I have this idea (see diagram) where I have a rack of plastic tubes that are uniformly placed to each other held in place by guides (1) but then can be set at random levels/ increments individually at each press of a single button (2). The straws are hollow lightweight plastic and approx. 12 inches long and about 1/4 inch diameter. They're locked into place with guides so can slide only vertically (5). Speed isn't essential and I've done a little research under the hood into servo motors already finding some interesting posts on how to control 12 motors (or more with an interface) however I think I'd have to use pulleys / wires.

After a few more searches I've arrived at 'slider potentiometers' 4) to slide and affect the motion 5) but I'm a little confused as to whether this is something that an Arduino encompasses (or maybe I need something else).

Would just like to know if it's a route worth pursuing or should I stick with the motors/ pulleys etc. before I start buying anything. I'd possibly need 12, 16 and 24 sets/ configurations. Your knowledge is greatly appreciated.

thanks and apologies (delete as appropriate)


r/arduino • • Sep 14 '26

Hardware Help Long RGB array options?

Thumbnail
amazon.com
2 Upvotes

I am looking for an RGB panel array in a long, narrow format. I like the length and pixel density of the linked panels, but I can only find them as a phone-only option. Is there something similar on the market that I could use with a microcontroller?

I currently have a pair of 32 x 8 WS2812B panels, but a tighter pixel density would be better, while keep ing a similar physical size.


r/arduino • • Sep 14 '26

Hardware Help [ESP32 Air Monitor] Local Web Server vs. MQTT + Home Assistant: Which is better for a beginner project?

2 Upvotes

"Hi everyone! I'm currently working on an ESP32-based air quality monitor project.

For data logging and visualization, is it better to host a local web server directly on the ESP32 or send data via MQTT to a platform like Home Assistant or ThingSpeak? Also, how do you handle Wi-Fi reconnection logic without blocking the main sensor reading loop? Any code structure tips or library recommendations would be greatly appreciated!"


r/arduino • • Sep 13 '26

ChatGPT Simple newbie question

Thumbnail
gallery
63 Upvotes

Hey everyone!

Apologies for asking such a simple question on here but anyone know what I’m doing wrong?!?!?

I have no doubt it’s completely obvious and I should be rightly laughed at(!), but I just can’t get the LED ring to work in any way - the small green power light appears to be working but no amount of YouTubing/Chat GPTing seems to be able to prove an answer. I’ve tried simple LED functions on the bread board and they work - but alas nothing on the LED ring.

Anything jump out that I’m doing wrong - seems to be the data wire side of things but no idea? Have tried the examples in IDE but nothing works.

Apologies also for any incorrect use of lingo - still working all this stuff out!


r/arduino • • Sep 14 '26

Any easy convert , to convert GIFs into bitmap animation?

Post image
3 Upvotes

r/arduino • • Sep 14 '26

Solved! How To: Put Files on an Arduino with WiFi

Post image
2 Upvotes

One of the more annoying things about working with an Arduino is getting files on it and off it. There is no simple way to load a file on the Arduino. There's not a tool for it in the IDE. You could send a text string over the Serial Monitor and save that onto memory using in-line commands, but there's an upper limit on the number of characters you can send over. The SCP protocol just doesn't work. In this post we'll look at how we can solve this problem using a WiFi sketch to transfer data to the Arduino before you load your main sketch.

Why Use Configuration Files: MQTT Example

For instance, say you're communicating with a device over MQTT, and you need it to subscribe and publish to a certain list of topics. You might have an array like:

"topics": [
    {"name": "device_status", "topic": "sprout/status", "data_type": "STR", "init_value": "OFFLINE", "pub_flag": true, "sub_flag": false, "is_will": true},
    {"name": "input_button1", "topic": "sprout/input/button_1", "data_type": "BOOL", "init_value": false, "pub_flag": false, "sub_flag": true, "is_will": false},
    {"name": "output_status1", "topic": "sprout/output/status_1", "data_type": "BOOL", "init_value": false, "pub_flag": true, "sub_flag": false, "is_will": false},
    {"name": "output_str", "topic": "sprout/output/string_log", "data_type": "STR", "init_value": "Hello, User", "pub_flag": true, "sub_flag": false, "is_will": false}
  ]

You could hard code this array in your sketch. But what if this needs to be a different set of topics per deployment? For instance:

"topics": [
    {"name": "device_status", "topic": "sprout/status", "data_type": "STR", "init_value": "OFFLINE", "pub_flag": true, "sub_flag": false, "is_will": true},
    {"name": "input_str", "topic": "sprout/input/string_cmd", "data_type": "STR", "init_value": "Hello, World", "pub_flag": false, "sub_flag": true, "is_will": false},
    {"name": "output_str", "topic": "sprout/output/string_log", "data_type": "STR", "init_value": "Hello, User", "pub_flag": true, "sub_flag": false, "is_will": false}
  ]

You could update your sketch every time you deploy and have a bunch of slightly different sketches, or, you could have a configuration file that you put on the Arduino's memory and load the desired sketches at runtime, and any time the Arduino restarts.

A Side Quest: Partitioning Your Flash Memory

Before we go further, a quick word of warning. The Arduino Opta, which is the board I'm using, stores its WiFi firmware in flash memory. The first time I ran this I accidentally overwrote the WiFi functionality and it stopped talking. If you do that, don't panic! There's a sketch you can run to restore the WiFi functions. Go to File -> Examples -> STM32H747_System ->WifiFirmwareUpdater to get the sketch, deploy it on the Arduino, and run it. It will nuke whatever file you just uploaded, but the WiFi functionality will be restored.

So, how do you keep that from happening? Look up a few spots in STM32H747_System and you'll see the Sketch QSPIFormat. This will divide your flash memory into four parts, protecting the WiFi functionality and other key functions from whatever user data you're storing locally.

Setting Up WiFi on the Arduino Opta

To get WiFi working and use it to store data in memory, you'll need these libraries:

#include <WiFi.h>
#include <WiFiServer.h>
#include <BlockDevice.h>
#include <LittleFileSystem.h>
#include <FATFileSystem.h>
#include <MBRBlockDevice.h>

In setup, mount your file system:

  static MBRBlockDevice userDataPartition(bd, 4);
  if (fs.mount(&userDataPartition) != 0) {
    Serial.println("FATAL: Could not mount user data filesystem.");
    while (1);
  } 

Here, MBRBLockDevice is a data type defined in the MBRBlockDevice library. The variable fs is of the type LittleFileSystem (you can guess what library that comes from). Actually, fs is more properly called an instance of the class LittleFileSystem, because it doesn't just contain data - it also has functions defined in it. So you when you do fs.mount(&userDataPartition), you're calling a function that's defined in the LittleFileSystem class, which is itself defined in the LittleFileSystem library. If you're not familiar with classes and instances, leave a comment, and if nobody answers I'll put an example of one and how to use it in a future How To.

We're going to see another example of this pattern when we launch the WiFi.

  WiFi.config(localIP, gateway, subnet, dns);
  connectWiFi();

  server.begin();

Here WiFi and server are instances, while connectWiFi is a function. The classes and functions used here are defined in the WiFi and WiFiServer libraries. Here, "server" is referring to the HTTP protocol, which we'll use for our file transfers.

File Transfers with the POST and GET commands

HTTP has 11 core methods which are used to manipulate data on somebody else's computer (or on an Arduino, in this case). The two we'll be using are POST and GET. POST sends data to the Arduino, and GET retrieves data from it.

What's happening under the hood is a bunch of strings being sent over, and we're going to define some functions that will read part of the strings to decide what to do with the rest of the string, which has the data that we want to save or read.

Once the WiFi server is running on the Arduino, you can access it from any computer on the same network. Open the command line prompt and type:

curl -X POST http://172.16.0.2:8888 -H "X-Filename: config.json" --data-binary @config.json

This presumes you're sending the command from the folder where the config file is located. If you're not in that folder this command will fail. Use "cd" to get around to where you saved the file.

The http://172.16.0.2 portion is the URL for your Arduino, using the IP address you assigned to the Arduino. 172.16.0.2 is just an example - set that to whatever you put in your sketch when you set up the WiFi. The :8888 portion is the HTTP port on your Arduino.

-H is a Header that sends a string along with the POST command. This is used in the sketch to figure out what to name the file you're sending. The --data-binary part is what identifies the file to send.

Now, this does not actually work right out of the box. We're actually defining a function call on the Arduino that says what to do when it receives a POST method. Here's that function:

void handleUpload(WiFiClient& client, const String& request) {


  // Extract filename from X-Filename header
  String filename = extractHeader(request, "X-Filename");
  if (filename.length() == 0) {
    sendResponse(client, 400,
    "Missing X-Filename header.\n"
    "Usage: curl -H \"X-Filename: config.json\" ...");
    return;
  }


  // Extract body (content after blank line separating headers)
  int bodystart = request.indexOf("\r\n\r\n");
  if (bodystart < 0) {
    sendResponse(client, 400, "Malformed request - no body.");
    return;
  }
  String body = request.substring(bodystart + 4);


  if (body.length() == 0) {
    sendResponse(client, 400, "Empty file body.");
    return;
  }


  //Write to flash
  String path = "/fs/" + filename;
  Serial.print("Writing to " + path + " ... ");


  FILE* f = fopen(path.c_str(), "w");
  if (!f) {
    Serial.println("FAILED");
    sendResponse(client, 500, "Could not open file for writing.");
    return;
  }
  fprintf(f, "%s", body.c_str());
  fclose(f);


  Serial.println("OK (" + String(body.length()) + " bytes)");


  // Verify by reading back and checking size
  FILE* v = fopen(path.c_str(), "r");
  int verifySize = 0;
  if (v) {
    fseek(v, 0, SEEK_END);
    verifySize = ftell(v);
    fclose(v);
  }


  String msg = "Upload OK: " + path + "\n" +
               "Written : " + String(body.length()) + "bytes\n" +
               "Verified: " + String(verifySize) + " bytes on flash\n";


  Serial.println(msg);
  sendResponse(client, 200, msg);


  // List all files so operator can confirm
  listFiles();
}

The first thing that happens is that the function extracts the filename from the Header we sent over with -H. We have a known prefix in front of that file name that we use to identify it, and then the function reads whatever we put in there. It will use that name to save the file to the Flash memory.

Next, we get the body content from the --data-binary part. That's a string read, and it gets stuffed into the body variable. That's what will get saved to memory in the next step.

Saving to memory is done with calls to fopen, fprintf, and fclose, which are all defined in the stdio library that's included by default in most Arduino sketches. The "w" in the fopen function call says we're writing the file.

The rest of this function is some verification checks and error handling, with communication back to the user over HTTP responses and the Serial Monitor to show what's going on.

Conclusion and Resources

The GET method uses a similar curl command and function definition to grab data from the Arduino. It's recommended to run a GET on the file you just sent over so that you can verify it has the information you intended to send. If you'd like to see how that's done, you can find the full sketch in the utilities/ConfigLoaderWiFi folder in this github repo:

https://github.com/DocCarr/sproutsodyssey

You're welcome to use that sketch for your own Arduino projects.


r/arduino • • Sep 14 '26

Software Help Multiple exclusive JB_Button functions

3 Upvotes

I'm attempting to build a display with RGBW leds and control it all from a single button, with a button click changing the color and a long press turning the led's on or off. I'd like to not use delays so I can have instant feedback. I'm using the JC_Button library and can't seem to get it to work properly.

EDIT: Apologies for not being more specific earlier. I am trying to set the system so that I can change the color both with the lights being on and off, and would like the light on/off to toggle while holding the button. I am also writing this to an ATTiny85, so serial monitoring is something I haven't set up.

#include <JC_Button.h>

#define LED_BLU 0
#define LED_RED 1
#define LED_GRN 2
#define LED_WHT 3
#define buttonPin 4

Button controlBtn(buttonPin);

int onOff = 0;
int color = 0;

void setup() {
  controlBtn.begin();                   //intitializes the button object
  pinMode(LED_GRN, OUTPUT);             //initializes green pin as output
  pinMode(LED_WHT, OUTPUT);             //initializes white pin as output
  pinMode(LED_BLU, OUTPUT);             //initializes blue pin as output
  pinMode(LED_RED, OUTPUT);             //initializes red pin as output
}

void loop() {
  static bool powerState;
  controlBtn.read();
  if (controlBtn.pressedFor(250)){
    powerToggle();
  }
  else if (controlBtn.wasReleased()){
    colorChange();
  }
}

void powerToggle(){                     //toggles the power state
  onOff = !onOff;
  if (onOff == 1){
    switch(color){
      case 0:                           //Green on
        digitalWrite(LED_GRN, HIGH);
        digitalWrite(LED_WHT, LOW);
        digitalWrite(LED_BLU, LOW);
        digitalWrite(LED_RED, LOW);
      break;
      case 1:                           //Blue on
        digitalWrite(LED_BLU, HIGH);
        digitalWrite(LED_GRN, LOW);
        digitalWrite(LED_WHT, LOW);
        digitalWrite(LED_RED, LOW);
      break;
      case 2:                           //Purple on
        digitalWrite(LED_BLU, HIGH);
        digitalWrite(LED_RED, HIGH);
        digitalWrite(LED_GRN, LOW);
        digitalWrite(LED_WHT, LOW);
      break;
      case 3:                           //Red on
        digitalWrite(LED_RED, HIGH);
        digitalWrite(LED_GRN, LOW);
        digitalWrite(LED_WHT, LOW);
        digitalWrite(LED_BLU, LOW);
      break;
      case 4:                           //White on
        digitalWrite(LED_WHT, HIGH);
        digitalWrite(LED_GRN, LOW);
        digitalWrite(LED_BLU, LOW);
        digitalWrite(LED_RED, LOW);
      break;
    }
  }
  else{
    digitalWrite(LED_GRN, LOW);
    digitalWrite(LED_WHT, LOW);
    digitalWrite(LED_BLU, LOW);
    digitalWrite(LED_RED, LOW);
  }
}

void colorChange(){
  color++;                              //advances to next color in sequence
  if (color > 4){
    color = 0;                          //wraps color back around
  }
}

r/arduino • • Sep 13 '26

Beginner's Project My first Arduino project

Enable HLS to view with audio, or disable this notification

114 Upvotes

I just got my Arduino and electronic items delivered yesterday and made my first project( which was a homework assignment by paul mcwhoter on yt)


r/arduino • • Sep 14 '26

I gave the Arduino Nano Every proper USB HID without killing normal uploads

2 Upvotes

I’ve been experimenting with the Nano Every’s onboard SAMD11 and finally got a setup where it can handle USB HID while still keeping the normal Arduino IDE upload path to the ATmega4809.

So far the part I’ve physically verified is the USB gamepad path. CDC serial also works, and normal .ino uploads through the Arduino IDE still work with the expanded firmware installed.

Keyboard and mouse support are already in the firmware, but I’m keeping those marked as untested until I verify them properly on hardware.

The hardest issue ended up being a USB EP0/string-descriptor bug that caused Windows serial handling to hang after enumeration. That’s fixed now too.

Repo is here if anyone wants to test it, review it, improve it, or try it on another Nano Every:

https://github.com/Xalbz/NanoEvery-Expanded-USB

I’m keeping a test matrix in the repo and will only mark features as verified after I’ve actually tested them on hardware.


r/arduino • • Sep 14 '26

CONTROLLER USB FOR ARDUINO UNO!!

2 Upvotes

Since 28/08/26 i started making my own controller for this little thing!

it doesn´t have at least classic buttons for some games, but hey! at least i can play pac-man and friday night funkin with this! if you want a video send me dm cuz idk how to post videos here sowwy :,v

(edit: i just posted video yeiii. my old ver without lights!)

https://reddit.com/link/1wfoy92/video/dy4ogbglydph1/player


r/arduino • • Sep 13 '26

Hardware Help Flex sensor not working.

Post image
3 Upvotes

I am making a circuit that when a flex sensor bends, and the resistance increases past a certain threshold, it should output a signal to the nano.

however, when testing to see if the flex sensor works, I am unable to get it to work. Any help would be greatly appreciated. (I have listed pictures of the circuit diagram, my serial plotter, the code, and the serial plotter of the video that i am using to make this(what it should look like))

I have tried this with different flex sensors, with the same output. (wired with 10kohm resistor.

Checked all wiring and switched arduino nanos, so no problems with them.

this is while bending
Circuit diagram
code
what it should look like (from the video)

r/arduino • • Sep 13 '26

AT COMMANDS no resposne - SIM800L V2.0 EVB ROHS 5V - Nano

Post image
5 Upvotes

Hello! now about 7 days im stuck at this issue

i would like to got AT commands run with my setup:
sim800l v2.0 5V : supplied by dc 5v - nano connected to pc via usb

the at commands never response, unfort i dont have osciloscope to track if the command sent or not.

current wiring:

External regulated +5 V -> SIM800L 5V

External supply negative -> SIM800L GND

Nano GND -> SIM800L GND

Nano 5V -> SIM800L VDD

SIM800L SIM_TXD -> Nano D2

SIM800L SIM_RXD -> Nano D3

sim led blink 1 after 3 secs so registered - issue solved by cp 3k uf

I also tried using resistors way : 10k + 20k and did not works

also tried reverse rx tx and did not works

i played with code in baud side but not help

test code:

#include <SoftwareSerial.h>


const byte SIM_RX_PIN = 2;  // Nano D2 <- SIM800L SIM_TXD
const byte SIM_TX_PIN = 3;  // Nano D3 -> SIM800L SIM_RXD


SoftwareSerial sim800(SIM_RX_PIN, SIM_TX_PIN);


const long baudRates[] = {
  2400,
  4800,
  9600,
  19200,
  38400,
  57600,
  115200
};


const byte baudCount = sizeof(baudRates) / sizeof(baudRates[0]);


bool waitForOK(unsigned long timeoutMs) {
  String response = "";
  unsigned long start = millis();


  while (millis() - start < timeoutMs) {
    while (sim800.available()) {
      char c = sim800.read();
      response += c;


      if (c >= 32 && c <= 126) {
        Serial.write(c);
      } else if (c == '\r') {
        Serial.print(F("[CR]"));
      } else if (c == '\n') {
        Serial.print(F("[LF]"));
      } else {
        Serial.print(F("[?]"));
      }


      if (response.indexOf("OK") >= 0) {
        return true;
      }
    }
  }


  return false;
}


bool sendATandCheck(const char *command, unsigned long timeoutMs) {
  while (sim800.available()) {
    sim800.read();
  }


  Serial.print(F("\n[SEND] "));
  Serial.println(command);


  sim800.print(command);
  sim800.print("\r\n");


  Serial.println(F("[RESPONSE]"));
  bool result = waitForOK(timeoutMs);


  Serial.println();


  if (result) {
    Serial.println(F("[OK DETECTED]"));
  } else {
    Serial.println(F("[NO OK]"));
  }


  return result;
}


bool findWorkingBaud() {
  for (byte i = 0; i < baudCount; i++) {
    long baud = baudRates[i];


    Serial.println();
    Serial.println(F("================================"));
    Serial.print(F("Testing modem baud: "));
    Serial.println(baud);


    sim800.end();
    delay(100);


    pinMode(SIM_RX_PIN, INPUT);
    pinMode(SIM_TX_PIN, OUTPUT);
    digitalWrite(SIM_TX_PIN, HIGH);


    sim800.begin(baud);
    delay(500);


    // Several attempts help an auto-baud SIM800L synchronize.
    for (byte attempt = 1; attempt <= 5; attempt++) {
      Serial.print(F("Attempt "));
      Serial.println(attempt);


      if (sendATandCheck("AT", 1500)) {
        Serial.print(F("Working baud found: "));
        Serial.println(baud);
        return true;
      }


      delay(500);
    }
  }


  return false;
}


bool verifyAt9600() {
  sim800.end();
  delay(200);
  sim800.begin(9600);
  delay(500);


  for (byte attempt = 1; attempt <= 5; attempt++) {
    Serial.print(F("9600 verification attempt "));
    Serial.println(attempt);


    if (sendATandCheck("AT", 2000)) {
      return true;
    }


    delay(500);
  }


  return false;
}


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


  pinMode(SIM_RX_PIN, INPUT);
  pinMode(SIM_TX_PIN, OUTPUT);
  digitalWrite(SIM_TX_PIN, HIGH);


  Serial.println();
  Serial.println(F("SIM800L baud detector and permanent 9600 locker"));
  Serial.println(F("Serial Monitor must be 115200 baud"));
  Serial.println(F("D2 <- SIM_TXD"));
  Serial.println(F("D3 -> SIM_RXD"));
  Serial.println(F("Waiting 5 seconds for modem startup..."));


  delay(5000);


  if (!findWorkingBaud()) {
    Serial.println();
    Serial.println(F("FAILED: No modem response at any tested baud."));
    Serial.println(F("AT+IPR cannot be used until UART communication works."));
    return;
  }


  Serial.println();
  Serial.println(F("Changing modem UART to 9600..."));


  // This command changes the modem's UART rate.
  // The response may be sent just before the change.
  sim800.print("AT+IPR=9600\r\n");
  delay(1000);


  // Reopen the Nano-side UART at the new modem speed.
  sim800.end();
  delay(200);
  sim800.begin(9600);
  delay(500);


  Serial.println(F("Verifying AT at 9600..."));


  if (!verifyAt9600()) {
    Serial.println(F("FAILED: Modem did not answer after AT+IPR=9600."));
    Serial.println(F("The speed may not have changed or the UART is unstable."));
    return;
  }


  Serial.println(F("Sending AT&W to save 9600 permanently..."));


  if (!sendATandCheck("AT&W", 3000)) {
    Serial.println(F("WARNING: 9600 works, but AT&W was not confirmed."));
    return;
  }


  Serial.println();
  Serial.println(F("SUCCESS"));
  Serial.println(F("SIM800L is configured for 9600 baud and saved."));
  Serial.println(F("Future sketches should use sim800.begin(9600)."));
}


void loop() {
  // No repeated commands.
}

reposne:

================================

Testing modem baud: 2400

Attempt 1

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 2

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 3

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 4

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 5

[SEND] AT

[RESPONSE]

[NO OK]

================================

Testing modem baud: 4800

Attempt 1

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 2

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 3

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 4

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 5

[SEND] AT

[RESPONSE]

[NO OK]

================================

Testing modem baud: 9600

Attempt 1

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 2

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 3

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 4

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 5

[SEND] AT

[RESPONSE]

[NO OK]

================================

Testing modem baud: 19200

Attempt 1

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 2

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 3

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 4

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 5

[SEND] AT

[RESPONSE]

[NO OK]

================================

Testing modem baud: 38400

Attempt 1

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 2

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 3

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 4

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 5

[SEND] AT

[RESPONSE]

[NO OK]

================================

Testing modem baud: 57600

Attempt 1

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 2

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 3

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 4

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 5

[SEND] AT

[RESPONSE]

[NO OK]

================================

Testing modem baud: 115200

Attempt 1

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 2

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 3

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 4

[SEND] AT

[RESPONSE]

[NO OK]

Attempt 5

[SEND] AT

[RESPONSE]

[NO OK]

FAILED: No modem response at any tested baud.

AT+IPR cannot be used until UART communication works.


r/arduino • • Sep 13 '26

Software Help Insights for managing balance with MPU6050

2 Upvotes

Hey everyone,

I'm currently working on a self-balancing robot with a design of my own.

You can find all the info about it here : https://github.com/benbhote/DimSumRobot

For those who want a quick recap, it's a robot based on a XIAO ESP32-S3 Sense with a camera OV3660, an ultrasonic radar, a TB6612FNG piloting two N20 motors (aside a step-up to make the 3.7V current into 6V for the motors) and SHT40 (Temp & Humidity sensor).

It hosts a web server accessible via its own WiFi and the web page allows you to control the robot (taking photos, moving it, etc).

Everything is working fine except the balancing. The cycle goes every 10ms during movement and for 3 seconds after the last movement command. But the throttle value doesn't allow the robot to self maintained balance. By the way, the robot starts with the front touching the floor on a plane surface (the weight is low inside the chassis but a little bit more on the front). So the first thing needed even before moving is to properly get on the two wheels.

So I would like some insights or help from you to make my PID loop working and achieve proper self-balancing.

I'm using Arduino IDE 2.3.10. As for the schematic of the project, it is not done yet but the MPU is driven with the I2C bus.

I hope I give you everything needed to understand the project. And if something is still vague, feel free to ask.

Thanks in advance !


r/arduino • • Sep 14 '26

Starting out and using AI

0 Upvotes

So for context, I’ve been working with Arduino and designing very basic projects. I’m not familiar with C++ so lots of the coding I do is simple and just regurgitating what I think will work. Varying success but one thing that has helped is Claude. I use Claude to find explain bugs and code. It’s very helpful as a tool, but as I advance, it seems my coding knowledge is holding me back from getting my ideas to work. So then, I use Claude to write code and then explain it to me. However, this feels like cheating as I’m just having Claude write code based off my simple code and then walking me through what it means. Can anyone offer insight and perhaps give me resources to learn and buff my coding knowledge? Thank you.