Questions tagged [arduino-mega]
A microcontroller board based on the ATmega2560 or 1280 chip. Use this tag for questions specifically regarding the Mega, and not just general Arduino usage.
1,822 questions
0
votes
0
answers
43
views
After an USB disconnect the program I've uploaded to the Arduino Mega 2560 doesn't work properly anymore, why?
For a race simulator I'm using several Arduino Mega 2560 boards on which the code that will post below will be running. (not my code! But freely available on the internet)
Everything works fine, just ...
1
vote
1
answer
92
views
How can I improve ELM327 response stability on Arduino after setup verified with OBD-II scanner guide?
I'm using an Arduino Mega with a Bluetooth ELM327 adapter to read live data from my car’s OBD-II port — specifically RPM (PID 010C). The goal is to log data to an SD card or display it in real time.
...
1
vote
1
answer
116
views
Arduino Mega 2560 + DRV8871: Motor Not Moving with PWM Control
I'm using an Arduino Mega 2560 to control a DRV8871 motor driver connected to a DC brushed motor. The setup includes:
Three buttons: UP, DOWN, and FAST
One limit switch input, where the upper and ...
4
votes
2
answers
1k
views
Arduino Mega: is there a way to have additional interrupt pins?
I have an Arduino Mega, and I run out of interrupt pins. I have only pin 18 available, but I need 2 of them. What can I do?
pin
INTx
digitalPinToInterrupt(pin)
3
INT5
1
2
INT4
0
18
TX1 INT3
5
19
RX1 ...
1
vote
2
answers
130
views
Arduino keeps restarting with L9110 and DC motor
I am trying to control a DC motor using the L9110 motor driver and Arduino MEGA 2560.
Here's the code.
#include <Arduino.h>
const int rightA = A3;
const int rightB = A2;
void setup() {
...
-1
votes
1
answer
58
views
Communication protocol and hardware for 50-100 feet of communication between 2-3 arduino megas
Newish person here. Have done a few smaller projects, looking at something a bit bigger and need direction on where to start.
I'm building a guitar effects pedal board that I want to be able to ...
0
votes
1
answer
81
views
How to use C++ user defined modules in Arduino
Does Arduino support C++ module import functionality i.e. what would it require to implement something like this in Arduino: import std;?
-1
votes
1
answer
72
views
Arduino connect programatically two wires of external 3.3V device
What is a missing puzzle in here, relay, transistor?
I would like to pull pin of external device to the ground programatically using arduino's digital pin.
3
votes
1
answer
304
views
Interrupt routine has unexpected execution
An interrupt routine is executing unexpectedly, and I can't figure out why. Can you please have a look?
Hardware is a generic (knock off) Arduino Mega, with an unused Ethernet shield, and a touch ...
2
votes
1
answer
189
views
Software serial communication problem between ESP8266 and Arduino Mega for plant monitoring system (using Blynk IoT)
We're using the ESP8266 to receive data from the Arduino Mega board, where our sensors are connected. Supposedly, our ESP is connected to the Blynk App. However, the values showing up in our dashboard ...
1
vote
1
answer
356
views
Different pin names in 0V7670 Camera Module
I am trying to follow this tutorial, SIMPLIFIED! How to Use OV7670 Camera with Arduino (other tutorials are also the same) and I noticed that my Camera module has different pin names, what do I do?
...
0
votes
1
answer
122
views
Problem with char* variable malloc/free. Empty contents on recipient variable after using free
I am working on a custom SD card data logger using the following function and struct:
char *filenameCreator(const char *prefix, const char *num, bool addExtension)
{
char *filename = (char *)...
-1
votes
1
answer
46
views
Fail to discard the character T from my transmitter Arduino
I wrote code for my transmitter Arduino. I want to send the data to the receiver Arduino through Tx and Rx serial.
The issue is that I could not discard the char "T" and it appears as output ...
1
vote
0
answers
69
views
Disable verification of certification SSL A7670SA
I have the code below and it doesn't work with my URL. I receive a
715(Handshake Failed)
This code below works normally, but with my API it doesn't work.
I'm using a A7670SA with Arduino Mega 2560.
...
2
votes
2
answers
223
views
interrupt from a button and wait until serial port 1 has a message
I'm a little bit loss because I'm learning how to use the interruptions on Arduino.
I'm creating a program to read an RFID code that arrives if an RFID transmitter is close to the antenna (a little ...
-1
votes
1
answer
175
views
Unable to find PCA9685 module when using the I2CScanner library: no servo movement
I am trying to use an Adafruit PCA9685 servo driver module with an ELEGOO Mega 2560 board.
I am supplying the servo driver board with 5 V and tested all the wires to make sure. I tested the servo ...
0
votes
1
answer
376
views
LED control with a string variable
I would like to control three LEDs with a string variable using an Arduino Mega.
I have connected the three LEDs to pins 10, 11 and 12 of the Arduino.
If my string equals Red, the red LED should turn ...
1
vote
0
answers
136
views
Problem with sending a GET request using the WiFiEsp library
Hello I am trying to make a request using WiFiEsp library but even the examples not working, I have searched a lot but never solved it. most of the solutions are outdated and do not solve anything, I ...
1
vote
1
answer
2k
views
How to handle class initialization when using brace-enclosed initializer lists
I'm working with a custom C++ library, CPSTL, for Arduino, which includes a cpstd::vector class that is designed to work with cpstd::initializer_list, cpstd::initializer_list is supposed to mimic std::...
0
votes
1
answer
98
views
Give zero volt to specific servo motors in a certain time
I have a robot that uses 4 mechanical arms. Each mechanical arm has 4 "READYTOSKY 30kg" servo motors on them.
At some point, I need to use the absolute maximum force of only two mechanical ...
0
votes
2
answers
148
views
Pressure transducer returns 2.4v at 0 psi when working with a 0.5v to 4.5v pressure transducer
I have this pressure transducer:
https://www.amazon.co.uk/dp/B07YZL6TYD?psc=1&ref=ppx_yo2ov_dt_b_product_details
The transducer has a range of 0.5v to 4.5v which translates to 0 psi to 100 psi.
...
0
votes
1
answer
421
views
Python script cannot connect to serial port
I want to control the LEDs with my hand, for this I used the repository https://github.com/paveldat/finger_counter/tree/main. I want to control the LEDs with my hand, for this I used the repository. ...
0
votes
1
answer
1k
views
Turn on by long press of a button?
In my project on Arduino, I want to implement turning on the whole circuit by long press of a button.
But at the same time, I want the Arduino to be turned off in standby or sleep mode, but I don't ...
1
vote
0
answers
467
views
Arduino (Mega 2560) Ethernet Shield 2 (W5500) - Can't connect
I'm having issues connecting to my arduino mega via ethernet. Its a very basic start to the code just to get the network side up and running, them im going to add in what I actually want it to do. For ...
0
votes
1
answer
317
views
DS18B20 Error in Proteus 8.13
I am using the below code to check temperatures from 36 DS18B20 sensors using Arduino Mega 2560. If any one of them go above 50 deg. celsius, then it sets the output pin to HIGH.
I am trying to run ...
1
vote
1
answer
382
views
ArduinoJson library: how much space to allocate for serialized buffer?
I am using the fantastic ArduinoJson library for working with JSON data on my ESP8266. I have been facing issues with random software wdt resets and have been investigating memory leaks wherever I can....
1
vote
3
answers
76
views
Separate from Serial for digitalWrite()
This is my current code (Arduino Mega 2560):
#define p1 2
#define p2 3
void setup() {
pinMode(p1, OUTPUT);
pinMode(p2, OUTPUT);
Serial.println("ARDUINO : CONNECTED");
}
void loop() {
...
3
votes
2
answers
112
views
Stack Mega Shield
I need to support 18 push buttons and 66 IR sensors on my Arduino Mega (model railway). I have a Mega Sensor Shield, but won't have enough pins for all the sensors. Can I get a second sensor shield ...
1
vote
1
answer
610
views
Can't install to arduino mega 2560 using arduino-cli, but can using IDE
I have a MKS GEN L v1.0 3dprinter board that works fine uploading using the IDE. But I need to install to it using the arduino-cli.
For some reason, the command arduino-cli board list says that the ...
2
votes
1
answer
113
views
ATMEGA2560 died inside a arcade game circuit
I am building arcade game with 10 player buttons (5 for each player) and one start button. All buttons have build in LED inside. Player buttons has LED for 12V and start button has led for 5V. I am ...
1
vote
3
answers
909
views
Best way to send a boolean (1/0) to a windows application in real time?
I have an arduino mega connected to a light sensor that reads the status of a machine's indicator light. I have a C++ application that controls the machine, and I would like the arduino to send the ...
4
votes
1
answer
1k
views
Are intel hex files converted into a binary format before they are written to Atmega's flash?
I have been going through some resources on bootloaders, programmers, etc (I'm very new to this specific subject) and how they work with the Atmega chips and Arduino board programming. My research may ...
0
votes
2
answers
85
views
Why does analogRead(A0) deliver different Values when called in a library file vs calling it in the sketch directly
I wanted to write a library representing a sensor to later on have an array of sensors.
I generated a file MoistureSensor.h:
#ifndef MoistureSensor_h
#define MoistureSensor_h
#include <Arduino.h&...
4
votes
2
answers
197
views
Turn ESP8266 into an Arduino IDE-like "sketch uploader" (over hardware serial)
I have an ESP8266 module which has downloaded a hex file for an Arduino Mega2560. This hex file (call it mega2560.hex) is sitting in the ESP's SPIFFS file system. What I want to do is basically ...
3
votes
1
answer
520
views
Serial plotting a pwm
I'm trying to plot the value of the pwm that increases (every 2 sec) then decreases to compare it to the value of an encoder. I was expecting a continued value (like a step ) during 2 seconds but ...
2
votes
1
answer
243
views
Connecting Arduino Mega 2560 to Python with PyFirmata
I am currently controlling two servos using the Arduino IDE, but now need to integrate my Arduino code into a Python script. I read about how to use PyFirmata and went through the process of uploading ...
1
vote
0
answers
60
views
slave arduino receiving commands from two serials
I have a slave arduino connected to a master arduino mega (through UART) and to a RPi (through USB). The slave arduino is set to monitor various SHT85 (through I2C) and NTC sensors. What I would like ...
0
votes
2
answers
1k
views
RMS Voltage Value
it has been a week that I'm struggling with the arduino to measure the RMS Voltage value. By OSC I can see that the RMS voltage value changes around 3V. But I can't see it by serial port. I think my ...
0
votes
2
answers
138
views
Pin outping 1V instead of expected 5V, not hardware related
Heyo everyone !
I'm in a project where I need to send a signal if I detect vaccuum.
I'm sending the signal on PIN 9 but I soon realized that I was only getting 1V.
Tought I was alternating between ...
1
vote
0
answers
97
views
How to create 2 individual daisy chains using the MAX7219 Module and Mega2560
I am using MAX7219 8 digit 7 segment displays with Arduino Mega2560. Now, I have to physically space out the displays far from each other. Hence, after a certain distance the displays on the far end ...
1
vote
0
answers
77
views
Arduino MEGA crashes with Ethernet shield to connect to two TCP servers
I have Arduino MEGA with Ethernet Shield and a SD card connected to a RUT950 GSM router. Then, I also have two sensors connected to the router and they run a TCP server that sends measurements ...
2
votes
2
answers
76
views
change sketch from controlling 8 stepper motors to 8 solenoids
I am looking to see if I can change the attached sketch which controls 8 stepper motors to just switching 8 relays for a weaving loom which we have, unfortunately making this change is well above my ...
1
vote
1
answer
539
views
Arduino Mega Loopback Test with Several TX/RX Ports
I am trying to do a loopback test using an Arduino Mega. What I am looking to do is send a byte over TX and receive said byte back at RX and verify that the byte is unchanged. More or less I just have ...
2
votes
1
answer
132
views
Why is sensitivity (threshold) parameter ignored
Analog pontentiometer connected to an Arduino. simplest possible setup.
The goal is to send a message over Serial whenever the value changes.
I do not want to spam the Serial connection to much, so ...
1
vote
0
answers
206
views
Error with Mega2560 via SPI
I tried the following code to communicate via SPI with MPU9250 and Mega2560 But I got the following error:
Error initializing communication with IMU
Why I got this error?
/*
* Brian R Taylor
* brian....
1
vote
1
answer
461
views
How to prevent an Arduino connected to the Internet from being hacked?
I have an Arduino (with environmental sensors doing measurements) connected to the Internet via ethernet. Can it be hacked? Can someone access it via Internet and upload his own C/C++ code? If, yes ...
1
vote
0
answers
253
views
Stepper motor not working with A4988 driver
I have been trying to run stepper motor via Arduino Uno and A4988 motor driver via this tutorial: https://howtomechatronics.com/tutorials/arduino/how-to-control-stepper-motor-with-a4988-driver-and-...
1
vote
1
answer
1k
views
DS1302 RTC module running too fast
I am using a DS1302 RTC module with an Arduino Mega 2560 Rev 3. I follow steps on this website since I have no experience with RTC module before. Here are the outputs I am getting.
17:15:21.835 -> ...
1
vote
0
answers
76
views
Cannot connect Arduino Mega 2560
I was able to work with the same Arduino on the same laptop yesterday. However, the Arduino IDE is unable to connect the Arduino Mega 2560 today. I tried with a different Arduino Mega 2560 but the ...
2
votes
1
answer
245
views
Using MFRC522 along with other inputs (Bluetooth, keypad)
I'm making a little parking lot, which includes mostly opening a servo motor using either keypad, Bluetooth (hc-05) and freshly added, RFID (RC522).
I can't get inputs from other sources if I want to ...