Questions tagged [arduino-uno]

The Arduino Uno is the most common of the Arduino boards. It is based on the ATmega328P microcontroller.

Filter by
Sorted by
Tagged with
5
votes
5answers
7k views

OTA updates for Arduino using nRF24L01+

Is it possible to send OTA updates to Arduino via nRF24L01+ module? Here are my findings: Here is an instructable explaining how to program Arduino wirelessly but this thing uses a BT module which ...
5
votes
1answer
8k views

Can I use analogRead to read a digital pin?

analogRead(nGPIO_max + lockerVal) were nGPIO_max(maximum digital pins in Arduino Uno is 13) and lockerval is 2. Which pin is it reading?
5
votes
4answers
20k views

How to add hysteresis to threshold values?

This code compares the analog input value against two thresholds, having three voltage regions. Then it will turn on an LED according to what region the read voltage is in. The problem is that when ...
5
votes
2answers
4k views

Is it possible to run a binary from EEPROM?

Say I wrote a compiled sketch to EEPROM then read it. Could I run the program from EEPROM? I guess the question is: Can an Arduino run software not in flash memory in the middle of executing the ...
5
votes
3answers
38k views

error: redefinition of ' '

When I am trying to compile the following code, int delayTime = 1; int charBreak = 2.1; #include <MemoryFree.h> int rled1 = 1; int rled2 = 2; int rled3 = 3; int rled4 = 4; int rled5 = 5; int ...
5
votes
3answers
1k views

Array + Serial Monitor Problem

I've written a Arduino sketch that converts an analogue voltage to a temperature using a lookup table - code below. I've recently changed my LUT to include more values but ever since that my Serial ...
5
votes
6answers
28k views

How can I run two loops simultaneously on an Arduino Uno?

I'm new to Arduino and I have two devices that I'm trying to control: A RGB LED light strip that can change colors A light sensor that can detect the ambient light level What I'd like to do is have ...
5
votes
2answers
1k views

Detecting the light source location using multiple photoresistors

I am not an expert yet, so please forgive any possibly wrong terminology that I may have used. I am planning to place 6 light sensors in 1 meter (or maybe more) distance from one another, like this (...
5
votes
6answers
5k views

Arduino Uno not able to handle 2-dimensional array

Now the code I'm writing in Arduino (Using Arduino) uses multiple 2-dimensional arrays. Now when I print some thing using the Serial Monitor it prints it correctly but when I declare and initialize ...
5
votes
2answers
3k views

Is it wise to use analog input pins to read digital buttons?

I am thinking about building a circuit that is literally going to take 11 of the 14 digital pins of an UNO to communicate with an SD card and an external EEPROM chip (EEPROM programmer). Using 4 ...
5
votes
4answers
19k views

How to connect more than 10 sensors to Arduino uno r3

How I can connect more than 10 sensors to Arduino Uno R3? I calculated it and I can connect just 4 fire flame sensors (sensors which can find a fire (a candle, for example)) and maybe 1 ultrasonic ...
5
votes
2answers
1k views

Run code once after programming

I'm using EEPROM to store project settings non-volatile. After reuploading the sketch to my board (over SPI via ArduinoISP), the EEPROM is reset to full 0xFFs and I have to manually do a "software ...
5
votes
3answers
909 views

Fool Proofing My Arduino IC Checker [closed]

I am creating an IC checker for some high school juniors since a faulty IC can be a nuisance of a bug to find when bread-boarding. These ICs are all simple TTL gating from the 74LS series; the set I ...
5
votes
2answers
2k views

interrupting an interrupt

What should be expected if the code in the timer interrupt ISR does not finish before the interrupt is called again? For example Timer0 ISR(TIMER0_COMPA_vect){} on the Uno. This is for debugging ...
5
votes
2answers
2k views

Why need a delay between readings?

When I learn the tutorial in Analog Read Serial Digital Read Serial both of the code examples have a line of code of delay(1) and I cannot understand the comments clearly: delay(1); // ...
5
votes
1answer
380 views

Arduino PWM malfunctioning

I am controlling 4 motors using the PWM ports on an Arduino Uno (3,9,10,11). For some reason, the motor hooked up to port 11 doesn't move with my current code. I know it's a code issue because I can ...
5
votes
2answers
17k views

Why does an Arduino UNO need two GND ports?

I have really bad eyesight, so whenever I plug in the power wire and the GND wire I always double check if I'm actually plugging in to the power port not one of the two GND ports. Why does an ...
5
votes
2answers
5k views

A question about resistance measurement with arduino

Lately I was asking myself about the possibility of measuring a potentiometer resistance with Arduino. My questions are: Is it possible? If it's possible, what kind of restriction does the Arduino ...
5
votes
1answer
793 views

Arduino on breadboard, and then soldered using a board made on Eagle but won't work

So I'm looking to create an arduino clone to mount on one of my robots. I started off making the arduino on a breadboard, using the instructions found on Arduino's own website and I succeeded. It ...
5
votes
2answers
7k views

How to generate true random numbers over Arduino Uno without any external hardware?

Using a 'random' function in sketch gives same pattern of numbers every-time. But, I need to generate different numbers such that any number to repeat itself should have a very less probability.
5
votes
3answers
3k views

Protecting your computer from stupid (arduino) mistakes

I recently ran way to much voltage through my Arduino and back into my computer via the USB connection. I'm looking for a USB hub with a fuse or some sort of protection to protect my laptop from these ...
5
votes
2answers
299 views

Trouble when avoiding delays

I am new to Arduino and I am learning how to avoid using delay. I have written some code to move my servo by 20° using delays, but can only move the servo once with my current code. In setup(), I ...
5
votes
2answers
2k views

Arduino DC motor causes disturbance. What can cause it?

I tried to fix this problem the whole weekend but, after no success I decided to post it here. I would really appreciate any help. The problem The Wi-Fi module activates the DC motor and lets it run ...
5
votes
1answer
9k views

How to properly use volatile variables in Arduino?

I was doing a small project with an Arduino Uno. It involved interrupts as I am using encoders to measure how much the differential wheel system moves forward. My robot moves only forward. So I use ...
5
votes
2answers
6k views

Read RC receiver channels using Interrupt instead of PulseIn

I am designing my own quadcopter control algorithm, whereby I currently read 4 RC receiver channels using PulseIn on each loop in the following manner: ch1_raw = pulseIn(rcPin1, HIGH, 25000); In ...
5
votes
5answers
9k views

Weird problem with LCD 16*02 I2C shield

I have an I2C LCD screen provided with a Sunfounder kit and certainly built by DFRobot or such a constructor (there is nothing written on the LCD), and an Arduino Uno R3 copy. My issue is when I use ...
5
votes
5answers
60k views

How do I resolve “avrdude: stk500_recv(): programmer is not responding”?

Whenever I try to program my Arduino UNO Rev.3, I'm seeing the following error avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00 ...
5
votes
2answers
6k views

UNO analog input voltage reading not accurate

My loop code is this: // read the input on analog pin 0: int sensorValue = analogRead(A0); // print out the value you read: Serial.println(float(sensorValue*5000.0/1023)); delay(1); // delay ...
5
votes
2answers
8k views

How to choose between AM230x and DHT22 temperature and humidity sensors?

I'm looking forward to getting an accurate humidity and temperature sensor. Right when I decided to go with a DHT22 module, I saw AM230x (AM2301, for example). How do I choose between DHT22 and ...
5
votes
1answer
316 views

What is causing my Uno to wake up?

NOTE: this code was working perfectly fine in another program. I have a simple piece of code that puts the Arduino to sleep. When it is finished and intergrated into my project, it will only wake the ...
5
votes
2answers
919 views

Formula / calculation of the function random() / randomSeed()

In which file can I find the calculation that is called with random()? If it is not too much could you also post the content in your answer? I am using an Arduino Uno and its standard IDE. I found ...
5
votes
2answers
708 views

Autoranging ohmmeter

Note: Before i explain my issue i would like to note that I am a beginner in electronics. Please pay attention to that when providing solutions and explanations. Thank you. I have succeeded at making ...
5
votes
1answer
13k views

Expected unqualified ID before numeric constant

After debugging and having some conflicting declarations about analog pins, I finally thought it was done, after compiling I got this error: 32:0, 1: 31:12: error: expected unqualified-id before ...
5
votes
3answers
3k views

Make Sure \n is the last character in serial string

I have an Arduino that I've put between a computer and an RS485 device. The job of the Arduino now is just to transmit data but will eventually do data logging and have a small user interface as time ...
5
votes
3answers
15k views

How to get current time and date in arduino without external source?

I'm working on a project using Arduino Uno and SD card shield. I'd like to store a variable at a specific time everyday in the SD card. How can I get the current time in Arduino ? Any help would be ...
5
votes
2answers
1k views

Arduino to arduino serial communication without a library

So I'm trying to send an array from one arduino to another through serial communication, without using the software serial library. The arduinos are wired rx->tx, tx->rx and ground to ground. I have a ...
5
votes
2answers
2k views

Bit shifting fails with warning: left shift count >= width of type

Given the following minimal working example. I tested this initially with uint16_t and it worked with no warnings. After that, I adjusted everything to work with uint32_t. #include <stdint.h> /*...
5
votes
3answers
19k views

Sending a value from one arduino to another

I wonder if it is possible to send a value from one arduino to another. Basically, I have one arduino measuring let's say weight, but I want to display that value using an lcd in another arduino. ...
5
votes
8answers
9k views

Two sensors on one input

I got this question from my teacher the other day and I can't figure it out: If you have two sensors from two different outputs but want them to go into one input, what do you need, and how can you ...
5
votes
2answers
9k views

Connecting an Arduino to a telephone line?

I would like to connect my Arduino Uno to a telephone line in order to answer a call, record a sequence of DTMF tones, generate a DTMF tone in response, and hang up. The telephone line uses a ...
5
votes
1answer
580 views

Is my ATmega broken, and would replacing it with another break that one, too?

I was communicating between my computer and my Arduino Uno R3 through Bluetooth using this Bluetooth module. The connector I use has a red wire where it connects to GND, and a black wire where it ...
5
votes
3answers
2k views

Can't upload to my Nano after updating to Arduino AVR Boards 1.6.21

I recently had the Arduino IDE notify me of available boards updates, so I updated. Since then when I try to upload to my Nanos it fails: avrdude: stk500_recv(): programmer is not responding avrdude: ...
5
votes
3answers
10k views

Issue sharing MISO with multiple RC522 RFID Readers

so for about the last 8.5 hours (almost non-stop) I have been trying to figure out one issue and I have exhausted every search I could possibly think of. I'm building a puzzle that requires 5 RFID ...
5
votes
2answers
1k views

RTC MCP7940M not counting up

I'm able to set a time and to read it back without any problems but it doesn’t tick up. It stays the same. Even if I restart the serial monitor and thereby resets the buffer(?). So it seems to me that ...
5
votes
1answer
803 views

Cannot compile C++11 code via Makefile

I am building my Arduino project with a makefile: BOARD_TAG = uno ARDUINO_PORT = /dev/ttyACM0 USER_LIB_PATH = /home/prakhar/dev/alfred/arduino/libraries CPPFLAGS=-x c++ -std=c++11 -Wall -...
5
votes
2answers
170 views

Does the tone() generates unwanted signal?

I was trying to use the tone function for another project but I found that it also generates an undesired frequency (not the harmonics above of square wave it generates) but a lower frq square wave. ...
5
votes
2answers
1k views

How to measure resistance of TFT Touchscreen

I'm using a TFT Touchscreen shield with my Arduino UNO, and I'm running "tftpaint" example by Adafruit. I've noticed that when initializing the Touchscreen object, a resistance value must be provided....
5
votes
2answers
2k views

Programmatically Change Arduino Com Port Name

I have some devices that, when I plug in, will display a unique name, usually a serial number, as opposed to "COM #" is there any way I can have my Arduino Uno (or Mega) give itself a different name ...
5
votes
3answers
409 views

Not getting proper readings on Arduino from MAP Sensor

In recent project, I have to take reading from MAP sensor. So basically, we used analog pin for this. But in my case, I don't get proper result which actually I want. When I'm taking readings through ...
5
votes
2answers
37k views

How does the reset button work on the Arduino?

I'm confused about how and when to use the reset button on the Arduino. Do I simply press the button while it is on? Is it simply restarting the board or clearing the uploaded code as well? Currently ...