Questions tagged [analogread]

A standard Arduino function for detecting the voltage on an analog pin via ADC.

Filter by
Sorted by
Tagged with
1
vote
3answers
3k views

Differential voltage measurement with Arduino UNO

EDITED: I bought a very sensitive (and expensive) pressure sensor which requires differential analog measurement. I am an amateur hobbyst and a total beginner in Arduino so I would like to ask some ...
0
votes
1answer
310 views

Reading pulse train with DC offset

One of the analog inputs to Arduino is a pulse train with DC something like 1.5V to 3.9V pulse. This of course changes by time and Im only interested in the difference voltage (peak-to-valley). Like I ...
0
votes
1answer
52 views

In the AnalogRead example, would the thing work if I remove or short the A0 and the ground pin?

What I want to know is that how exactly does analogRead work because I have want to use it with a flex sensor and it has only two pins.I tried to find other examples on the internet, but this is the ...
0
votes
2answers
65 views

Pass changing analog value from void loop to library .h file

How would I go about passing a void loop analog read value to a library .h file? I've tried it but it only reads the pot position as soon as I plug the arduino in and does not change once booted up. ...
0
votes
2answers
310 views

analogRead over a certain time

I would like to read an analog value using analogRead, save this value and compare it to an analogRead value 5 ms later. How would this code look? Because giving a variable the value of analogRead(A0);...
0
votes
1answer
267 views

analogRead seems to freeze some seconds the program

I have the following code that reads a RFID reader, it was working perfect without any dealy and then I try to an analog read from a potentiometer using analogRead. The analog read works fine but ...
5
votes
1answer
148 views

Why is my Analog Input channel adding voltage to my signal?

EDIT: Here are the links to the sensor spec sheet (http://www.omega.com/temperature/pdf/HX71.pdf) and manual (http://www.omega.com/Manuals/manualpdf/M4543.pdf) for your reference. I'm using a ...
0
votes
2answers
168 views

How to Read Voltage Level? [closed]

I want to read voltage level by my Arduino board please help in this regard. I am using this syntax. volts = analogRead(A3); // read the input pin Serial.println(volts)
1
vote
2answers
945 views

Uno - measure the voltage, NOT connecting GND

I'm trying to use an Arduino Uno, to measure the Voltage over a Resistor in a circuit. I guess the usual way would be to connect GND to one side of the Resistor and the AD0 Pin to the other end, and ...
2
votes
1answer
4k views

error: 'analogRead' was not declared in this scope

I am using Codeblocks with arduino IDE to simulate the control of a stepper motor, and the errors "'analogRead' was not declared in this scope" and "'A0' was not declared in this scope" keep popping. ...
1
vote
1answer
479 views

Using voltage divider to read voltage from sensor

Good morning, I would like to use an Arduino Duemilanove to read the voltage signal generated from a current sensor (CSLA2CD). The datasheet for this sensor can be found here. The problem is that ...
3
votes
1answer
427 views

Measuring voltage from -12 to +12 VDC

I'm making a -12 to +12V DC regulated power supply, on which I want to measure voltage and current with Arduino (through a voltage divider, of course). I'm not sure, how to either detect nor measure ...
8
votes
2answers
2k views

Why analogue pins affect each other?

I have a sensor and it generates an analogue signal. I am reading all analogue data and sending it to my computer. uint8_t sensors[] = { A0,A1,A2,A3,A4,A5,A6 }; const int len = sizeof(sensors) / ...
0
votes
2answers
1k views

Interfacing TRRS headphone to Arduino Uno

I have been working in a Arduino project lately which requires human voice input to Arduino with some processing Arduino need to perform specific task. Simple sampling of incoming signal and ...
13
votes
4answers
5k views

Does ADC conversion to a voltage rely on the actual value of the +5 V pin?

Questions: Does the conversion of the ADC count to voltage depend on the actual voltage of the +5 V pin? If yes, what is the accepted method of getting that voltage from the board? Background/...
-1
votes
2answers
3k views

Analog pins for 4x4 matrix keypad

I am working on a project on nano and want to use analog pins for 4x4 matrix keypad input. My connections are for keypad are as follows: Digital pins are D10-D13 and Analog pins are A0-A3. A0->14, ...
5
votes
6answers
1k views

Logging small capacitance

I'm measuring capacitance of a system using a multimeter, and found that the value is very small (fluctuate from 50pF to 100 pF). The system is dynamic so the capacitance changes over time. Now I ...
0
votes
1answer
1k views

Analog reading via bluetooth

I am making a project in which I am trying to communicate the LDR values collected by one arduino(slave) to another arduino(master) via bluetooth. The readings of the LDR is displayed on the serial ...
-2
votes
1answer
170 views

What is the definition of these arduino commands, and how do they affect the circuit? [closed]

I don't know if I am allowed to ask this question because really I could just look this up on google. The reason I'm asking here is because in google when you look up the definitions for the following ...
2
votes
2answers
617 views

What would be the best way to sense the tank level of a 1000L water tank?

I want to read in the values to an arduino analog input. The approaches I have been looking at are: 1.) A ultrasonic distance sensor; my concerns are that tehse are not usually waterproof. 2.) A ...
1
vote
2answers
110 views

Virtual analog inputs? Possible? [closed]

Just wondering whether it is possible to create 'virtual analog' signals, I am designign a system that uses a tank level sensor (pressure transducer); the component has not yet arrived and I am ...
2
votes
4answers
572 views

unexpected change of ADC value with multiple voltage dividers (thermistors and pot)

So this is my basic circuit. Three voltage dividers: one 10k pot, 2 thermistors. Fan driver circuit using TIP120 (currently just driving an LED from the 3.3v source). Board is a Leonardo clone, ...
0
votes
2answers
296 views

analogRead returning 0 constantly when connected to joystick

What reasons could there be for a joystick to return 0 when using analogRead? X-pin is connected to AO and y-pin is connected to A1. VCC is connected to 5V and GRND is connected to GRND. By ...
1
vote
1answer
286 views

Why does my code or Serial Monitor hang with analogRead?

I have the following code in loop() to collect values from an electret microphone for(int i=0; i<sampleSize; i++){ analogVal[i]= analogRead(ADC_Pin); sumOfSquares= sumOfSquares+sq(analogVal[i])...
1
vote
2answers
117 views

Serialprint and analogRead time

How much time takes to print each sample using Serial.print and analogRead in each iteration? #include <SoftwareSerial.h> #define Sensor A0 void setup() { Serial.begin(250000); pinMode(...
2
votes
4answers
10k views

Using analog in to read a push button

I'm working on a project in which I use a lot of the pins on the Arduino; I have run out of most of the pins and and I need to read the value of a push button. Is it possible to read the value of ...
0
votes
3answers
297 views

How can I see if volume buttons of Apple earphones are pressed?

I need to be able to see if the volume controls and the middle button of Apple earphones are pressed. I am using an Arduino Uno. I was thinking about using the analogRead function. I tried ...
2
votes
2answers
656 views

Arduino audio frequency reader

I have a simple project for my arduino : light some leds when i send a certain frequency from my smartphone through the jack output . For example , I play a simple audio file generated with a ...
0
votes
1answer
125 views

Can I hook up an Analog multiplexer to Arduino Nano?

I want to increase the analogue inputs for the Nano. So is it possible to hook up a CD74HC4067 analog multiplexer to it? Thanks.
1
vote
3answers
775 views

Arduino analog input protection

I've been trying to find a way to protect my analog input pins (for my Leonardo and Pro micro). I'm basically using them to read an amplified piezo sensor output. The output is amplified because I'm ...
1
vote
2answers
2k views

Arduino read PWM duty cycle value with input (analog / digital)

I am working on comparing autopilots like Ardupilot, CC3D, KK2.1.5. The comparision is about system reactions/behaviors that it gives during flight. For this purpose, I need to read the PWM duty cycle ...
5
votes
3answers
416 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 ...
0
votes
0answers
399 views

Arduino reading its own voltage wrong

I have made a PCB where I am using atmega328p (Arduino IC) to read some voltages. I have written its code in arduino software. I am giving voltage first to a voltage divider circuit and then to the A0....
0
votes
2answers
325 views

Regarding PGA bypass in ADS1262

I want to bypass the PGA to change the input signal range from +/-2.5 to 0/5 V range. I have taken the reference of example given in this library. I have interfaced protocentral-ads1262-32-bit-...
0
votes
1answer
170 views

Why do we need to amplify the signal of an electret? [closed]

I do understand from my reading that I should amplify the signal from an electret to be able to read it with an Arduino. I'd love to know the science behind that, why should we amplify the signal to ...
1
vote
1answer
510 views

Arduino (weird) ADC problem

I'm trying to read to voltage output of module ACS712. Here is my problem: The module outputs a voltage around 2.5V, however, arduino sends the value "1023" to the PC. (Gives a reading of 5V). ...
1
vote
2answers
4k views

How to I press a button once to display text and again to remove it?

My code is displaying voltage and I want to have a button that when pressed it displays a text and when I pressed it again it would turn off the text. I put the word "YES" just for a test float vPow =...
0
votes
1answer
652 views

Arduino Due: ADC gain adjustment problem

I want to increase gain of the ADC channel. To achieve this I'm using adc_set_channel_input_gain function from adc.h. Here is the entire sketch: const byte aPin = A6; void setup() { ...
1
vote
3answers
784 views

Custom ISR triggering function/value

Is there a way to write a custom function which would be the mode/reason to trigger an interrupt. I have an analog joystick connected to my arduino analog pin. It reads a value of 689 on one end and 0 ...
1
vote
0answers
321 views

How to use Honeywell NBP Series Sensor with Arduino

I am trying to use a HONEYWELL NBPDANN100PAUNV Pressure Sensor. I found an example here http://www.circuitstoday.com/interfacing-pressure-sensor-arduino As this example says as instrumentation ...
0
votes
1answer
3k views

10 bit PWM on Arduino UNO

I am using this code to make 10 bit PWM on port number 9, it seems like everything printed is 0,1022 rather than printing 0, 512, 1023. Is there a problem in my code ? I wired pin9 to A3 to get the ...
0
votes
1answer
2k views

Use digital pins as analog - Arduino Micro

I have an Arduino Micro and I want to use pin 6 and 8 as an analog pin, according to the manual this is possible: The Micro has a total of 12 analog inputs, pins from A0 to A5 are labelled ...
1
vote
1answer
1k views

ADC port manipulation

I was modifying this ADC Touch implementation, namely switching analogRead and pinMode to what I thought would be port manipulation equivalents. I get very different readings (better and more stable ...
1
vote
2answers
118 views

How to analogRead() 2 separate pins simultanously?

I am trying to create a simple piano playback using a flex sensor, a proximity sensor and a piezo buzzer. I want to have it so that when the flex sensor is triggered, a sound is played on the piezo ...
2
votes
2answers
7k views

Problem with simple sound detection circuit using a microphone

I am very new to this community. My first project with Arduino was using a LDR (light dependent resistor) in a circuit like this: The input I got was as expected between 0 - 1023. I then tried a ...
1
vote
3answers
347 views

AC meter By ADC timer interrupt from Nick Gammon

I want to read ADC from the pin A0 and A1. I have written in this code, however. I took this code came from Nick Gammon Thank You ///////////////////////////////////////////////////////////////////...
0
votes
1answer
3k views

arduino pro mini analog pins read different values

i need to read a voltage with an arduino pro mini using the analog pins. I created this simple test code: int sensorValue; float voltage; void setup() { Serial.begin(9600); } void loop() { ...
1
vote
1answer
546 views

Get an additional analog pin?

I have the following board: As far as I can tell, there's only a single analog pin (A0). But I need at least 2 additional (for 3 total). Is there some way to fake analog input on GPIO pins?
1
vote
1answer
5k views

Getting the highest value from analog reading?

I am doing a project using an FSR (Force Sensitive Resistor), I'm currently reading values with no problem every 100milis. I want to output via Serial.print the highest value, I've read. I am having ...
0
votes
3answers
2k views

Advanced ADC setup on Due (SAM3X8E) to increase precision

I want to make some precise measurements with Arduino Due. Although I'm using very good external voltage reference (LTC6655) measured data is still jumping around, especially significant when I'm ...