Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
104 views

DLHR differential pressure sensor SPI

I am new to using SPI with an Arduino. But I'm trying to wrap my head around the "coding protocols"/syntax of the Arduino IDE code. I understand the basics of how SPI works conceptually, just not how ...
0
votes
2answers
105 views

Voltmeter using Arduino mega 2560 giving unexpected result after some time

I have been trying to construct a smart energy meter that can observe readings of 220v household. For now i am working on voltmeter. I have been following the circuit I attached. Transformer step down ...
2
votes
1answer
258 views

Arduino Mega RS485

I am following the instructions from this page to set up RS485 communication between two Arduinos. https://arduino-info.wikispaces.com/SoftwareSerialRS485Example My wiring varies slightly from the ...
0
votes
0answers
35 views

Multiple references - Static variables and attachInterrupt

I am adventuring myself on sensor reading and stumbled on the following error. The code may be accessed on https://github.com/brunolnetto/tanque_solar/tree/big-refact. [NOT VALID LINK] Arduino: 1.8.5 ...
0
votes
0answers
117 views

Watchdog problem

I am using Maniacbug Mighyty-1284p 16MHz in my project. Here I used watchdog for safety.I used three command for watchdog. 1. wdt_enable(WDTO_8S); 2. wdt_reset(); 3. wdt_disable(); Is it create any ...
2
votes
1answer
957 views

Reading several rotary encoders

Have an upcoming project where user input will be based on spinning a large cog and I have several UNOs available Since rotary encoders need two pins, only a Mega would be able to handle the 7-8 ...
0
votes
0answers
48 views

HC-SR04 systematically finding a weird value

I have a HC-SR04 connected to my Arduino. its all working very nice. Yet with a constant interval a weird value appears (see the Serial Plot picture). I am wondering what causes this. I will soon ...
0
votes
0answers
93 views

Arduino Mega resets when DFPlayer speaker plugged into amp!

I have a MP3 DFPlayer Mini connected to a Mega2560. I'm using serial to control it. The Mega is powering/grounding the DFPlayer, and USB is powering the Mega. If I plug a small speaker directly to the ...
0
votes
1answer
47 views

Cannot connect Mega to COM 9 but okay with other COM ports

I previously had issue updating code to Arduino Mega (clone). This is a continuation of this issue, but I think it should be made as separate thread. After some time spending with it. Turns out if I ...
0
votes
0answers
37 views

Arduino Mega; Can't Upload [duplicate]

I've an Arduino mega, clone one. I can't seem to upload code to it. It's detecting in Windows device manager at COM 9. I've selected Arduino/Genuino Mega or Mega 2560 as board and COM 9 as COM port. I'...
0
votes
1answer
670 views

ZS-040 (HC-05) blueetooth module Arduino Mega

I followed this tutorial http://www.martyncurrey.com/using-an-arduino-mega-with-a-hc-05-zs-040-at-mode/ and it seems that the AT mode is on. (the LED is blinking like it's supposed) I connected my ...
1
vote
0answers
649 views

Interfacing MPU6050 with Arduino through Simulink S-function

I am interfacing MPU6050 with Arduino using Simulink S-function builder. I'm implementing MPU6050_DMP6 code in Simulink s-function builder by following this video. By following this tutorial I ...
0
votes
1answer
32 views

Return mean of observations for a given sample time

new to this StackExchange site. I have an experimental setup with three inputs - two from a laser distance sensor to measure planar distance and one digital input from a set of callipers. All ...
1
vote
1answer
75 views

DHT22 Hanging Up Entire Program

In the process of learning and working on a larger project, I started by adding an OLED display (128x64, SPI). I wrote a simple script to update every 5 seconds and then display the number of seconds ...
0
votes
1answer
36 views

Change values of timer using I2C

I'd like to alter the "LED_T_ON" values using an I2C enabled device (i.e. RPi) Code for Arduino Mega slave: //slave #include <Wire.h> #define SLAVE_ADDRESS 0x08 const int PWR_LED = 43; int ...
1
vote
1answer
72 views

Fast PWM working with int main(void) but not with void setup()

board: Arduino Mega (ATMEGA2560) I want to generate pulses using timer1 configured as Fast PWM, this is my code which works fine: #include <avr/io.h> int main(void) //void setup() { DDRB ...
0
votes
2answers
58 views

Powering USB cable that powers Arduino with regulated 5V

I am having an issue with external loads causing the computer I have my Arduino connected to to momentarily drop out, which causes the Arduino to lose USB power momentarily and the port drops out and ...
0
votes
1answer
48 views

nodemcu pins + sensors reading values

what are the SDA & SCL pins in NodeMCU? (Pins 20 & 21 in Arduino MEGA2560) I already implemented a simple project to read 2 accelerometers values from Arduino and send them through wifi to ...
-2
votes
1answer
43 views

how to establish a connection between an arduino and a web server? [closed]

I want to establish a connection between my arduino mega ( which is connected to an ethernet shield so internet access is available) to a web server. Any idea how the code should be? I searched for ...
0
votes
2answers
117 views

if two arduinos are connected by I2C and one of them is using an ethernet shield, does that grant both of them access to the internet?

i have two arduino mega and they send data to each other by an I2C connection. But one of those arduinos is connected to an ethernet shield which allows it to send data to a web server. Being both ...
1
vote
0answers
33 views

Unicast image transmission using Xbee

I've been working on image transmission using XBee S2B Pro modules and Arduino Mega. Main task is to transmit a jpg image taken by a jpeg serial camera at the transmitter and send it to a microSD ...
0
votes
1answer
126 views

Need lot GPIO pins on arduino mega - what are restrictions?

I would like to use as much as possible GPIO pins on Arduino Mega especially with (mis)using pinMode(x,INPUT); and pinMode(x,INPUT_PULLUP); to achieve two things at the same time - drive something ...
1
vote
3answers
358 views

how to set the pin 13 only HIGH for 1 minute if sensor at pin 8 give HIGH?

int PUMP = 13; int sensor = 8; int val; void setup() { pinMode(13,OUTPUT); pinMode(8,INPUT); } void loop() { val = digitalRead(8); if(val == HIGH) { digitalWrite(13,HIGH); } ...
-1
votes
1answer
35 views

Making a distance sensor for human interaction [closed]

I want to make a sensor that senses a person between 1.5 m and 0.2 m, connected to an LED that is on 100% at 0.2 m and 1% at 1.5 m and gradually scales. Is an ultrasonic sensor the best sensor to use ...
4
votes
2answers
360 views

How to deal with unusual neopixel grid

I have built a custom installation in my home with 896 WS2812 LED driven by an ArduinoMega 2560 and powered by several rails just fine. However, the installation is arranged in a checkerboard-like ...
2
votes
1answer
453 views

SIM900 and Mega 2560 not sending SMS

I just bought a SIM900 Arduino shield from AZDelivery. I only have a Mega 2560 board, thus I am trying to use this although most examples (like the tutorial from AZDelivery) are with the Uno board. I ...
0
votes
0answers
53 views

Neogps Average weird output

I'm trying to program an Arduino to display the current, average, and barrier GPS locations. I keep getting weird output. I started out with the neogps average example and modified it until I got the ...
0
votes
1answer
48 views

Communication between 2 Bluetooth modules

I successfully connected two Bluetooth modules, HC-05 and HC-06 like on this website: http://www.martyncurrey.com/connecting-2-arduinos-by-bluetooth-using-a-hc-05-and-a-hc-06-pair-bind-and-link/ I ...
0
votes
1answer
222 views

How can I send and receive data from an arduino uno to arduino mega using I2C?

hello guys I am trying to send data as a string from an arduino uno to another arduino mega and I am a beginner. But I have read about the I2C connection where we connect the RX to TX oppositely. I ...
0
votes
0answers
270 views

Arduino Mega connection with GSM Shield

I am running the code below to sent an SMS to a GSM Shield and control a Relay or get some values from some sensors. The code is running with no problems with the UNO but I cannot run it with a MEGA. ...
0
votes
1answer
1k views

Looking for Power Bank with “Always-On-Feature” [closed]

I want to build a mobile weather station with an Arduino and some sensors. I want to use a power bank as power source. The Powerbank should support "Always-On", because weather data should not be ...
1
vote
1answer
101 views

GPS showing incorrect speed

I am using Arduino ATmega 2560. When i am using "AT+CGNSINF" command to get GPS value, sometimes it showing incorrect speed. The correct speed should be (50-60)km/h but sometimes it showing (200-300)...
0
votes
1answer
201 views

Arduino Mega not recognized by device manager

My lab partner and I are working on a project for school and we are using an Arduino Mega 2560 for prototyping. The board was working just fine until, out of nowhere, the board was not being ...
1
vote
1answer
126 views

PROGMEM Corrupted Array

I am trying to store a large number of values into a couple of arrays using PROGMEM, but I am finding that a few of the values are read back corrupted. I am storing just 1s and 0s, but when I read ...
3
votes
2answers
348 views

What are these components in Arduino Mega Schematic?

I was looking at Arduino Mega's reference schematic here and trying to understand how the circuit functions. However, I am unable to understand what these schematic symbols (marked in black rectangles)...
0
votes
1answer
66 views

Linking Mulitiple Arduino's

I have a project in which several Arduinos will be running independent programs. I would like to use an Arduino Mega as the main controller. It will receive input from a variety of switches, as well ...
0
votes
1answer
67 views

NodeMCU not responding AT after blink app

I've just bought NodeMCU LoLin ESP8266, I tried to send AT commands (after spending days on ESP8266-01) and everything was okay. Than I've uploaded the Blink example to the board, after that moment it'...
0
votes
1answer
3k views

MEGA I2C and interrupts on 0,1

Looking at the pinout for the Arduino MEGA: I see that Pins 20 and 21 can be both SDA and SCL or Interrupts 0 and 1. If I'm using an Adafruit I2C 16x2 RGB LCD Shield connected to the SDA and SCL ...
1
vote
1answer
51 views

My Arduino keeps telling me the button is being pushed

My code is simple simple for the button. There is no reason why this shouldn't work... I think. I honestly have no clue what's wrong. Output: Code: #include <SPI.h> #include <MFRC522.h>...
0
votes
0answers
35 views

MFRC522 read anomalies

I'm wondering if there's anyone that may be able to shed some light on a issue I'm having with an Arduino Mega and MFRC522 NFC reader. Before I describe the particular issue I'll point out that the ...
0
votes
1answer
35 views

Arduino with stepper motor

I'm trying to control a stepper motor for my FYP with an Arduino Mega. I tried code form examples, stepper one revolution. It worked when I uploaded it but if i turn the power off during the half ...
0
votes
0answers
134 views

How to burn the bootloader of an Arduino Mega using the AVR MKII ISCP?

I somehow fubared my Arduino Mega 2560, and it stopped responding to normal uploads. I tried using the IDE to burn the bootloader, but it gave me the same connection errors as the normal upload ...
0
votes
1answer
95 views

SH1106 - Transferring long buffer via SPI

I am using an SH1106 and am creating my own driver for it. Nearly everything is doing great with about 2/3ms send time using transfer16. I did notice however that I can use transfer with a buffer and ...
0
votes
1answer
222 views

servo.read() starts at negative value, no matter where servo actually is

I don't like how my servo quickly jumps to the default middle position, so I commented out the line where DEFAULT_PULSE_WIDTH is set in Servo.cpp: //servos[this->servoIndex].ticks = usToTicks(...
0
votes
0answers
146 views

SH1106 OLED display on Mega2560 not working?

I am trying to use an SH1106 display with the Mega2560 but simply can't get it too work. I have tried using various different libraries and pins but nothing. (Note I got it working on an Uno just fine)...
0
votes
1answer
538 views

Unable to connect and configure ESP8266 wifi module with Ardunio Mega

I try to connect Ardunio Mega with ESP8266 wifi module. Wiring diagram mentioned below: I am using Ardunio IDE - For AT command test I was open COM monitor and selected 115200 baud rate and set to ...
-1
votes
1answer
535 views

Arduino GSM Shield NET and STATUS led turn off after a few seconds

#include <GSM.h> // PIN Number #define PINNUMBER "" // initialize the library instance GSM gsmAccess; // include a 'true' parameter to enable debugging GSMScanner scannerNetworks; GSMModem ...
0
votes
2answers
94 views

What is wrong with this code?

So I am writing code to control a servo with an RC radio. I am using an Arduino Mega. I get this error whenever I compile. I am not that experienced with Arduino so I am probably not doing something ...
-2
votes
1answer
231 views

Arduino IDE : 'tansig' was not declared in this scope

I am working on a simple NN sketch, everything looks fine and also i have added #include math.h .but when i try to compile it gives an error i-e 'tansig' is not defined in this scope I am trying to ...
0
votes
1answer
30 views

On a motor after a continuous input of a certain amount of time

I would like to produce an output after a constant input is detected for a certain amount of time. Below is a simple code of what I am trying to do minus the time factor. Can someone help me on how to ...