Questions tagged [analogread]

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

Filter by
Sorted by
Tagged with
6
votes
6answers
2k 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
180 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
944 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
139 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
686 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
544 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
352 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
129 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
15k 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
445 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
773 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 ...
1
vote
1answer
148 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.
2
votes
3answers
1k 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 ...
2
votes
2answers
3k 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
500 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
472 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....
1
vote
2answers
367 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
199 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
596 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
5k 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
786 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
977 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 ...
2
votes
0answers
452 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
3k 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
131 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
9k 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
468 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 ///////////////////////////////////////////////////////////////////...
1
vote
1answer
4k 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
783 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
6k 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
3k 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 ...
0
votes
2answers
2k views

Cheapest and easiest Arduino board for 12 bit ADC, thinking of M0

I need an Arduino board for simple ADC, but 10 bits of resolution is sadly not enough. I am going to buy a board with 12 bits of resolution, but really couldnt decide on the exact model. It needs to ...
1
vote
2answers
1k views

AnalogRead(0) always returns 0 on RFduino

I'm using RFduino to do analogRead at pin 2 and pin 0. Pin 2 works perfectly, and I got the result. However, for pin 0 it returns all zero. #include <RFduinoBLE.h> static const int topPin = 2; ...
1
vote
1answer
425 views

AnalogRead from voltage divider ladder

I'm building a MIDI guitar, using an Arduino, sound synthesising and wood. To properly know which note I'm pressing, I built a voltage divider with 12 equal resistors (10K). One side is connected at +...
0
votes
1answer
18 views

Why so different not connected analog inputs?

I took just Arduino Uno board, connected Ethernet Shield to it and compiled Web Server example. And it works. But it outputs: analog input 0 is 1023 analog input 1 is 1023 analog input 2 is 789 ...
6
votes
2answers
8k 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 ...
0
votes
1answer
172 views

Uno R3's a4 and a5 not working after installing itead SD Shield 3.0

I'm working on a data logging project and would like to use all six analog inputs on my Arduino Uno R3. I've been able to get everything working, including writing to the SD card. However, with the ...
1
vote
1answer
2k views

analogRead() takes >400 us on Arduino Zero but ~100 us on Uno, why?

I've been trying to figure out why the analogRead() function takes about four times as long on an Arduino Zero than on an Uno, when the Zero has a faster clock than the Uno. Arduinos website says ...
0
votes
3answers
6k views

Change max and min read value of potentiometer

I'd like to know if there is a function or some way to define min and max value to potentiometer, for example: I'm using a mechanical part that only tour the potentiometer a little bit, what means the ...
0
votes
0answers
46 views

Arduino Robot motors disabled when AnalogInput is connected

I have attached a solar panel to the Arduino Robot, connecting the - to the TK3 Input GND, and the + to the TK3 Input Analog Pin. I want to turn the robot around and "scan" the voltage. But the motors ...
0
votes
2answers
1k views

Using micros() to measure analogRead() time varies based on Serial.print location?

I'm trying to use micros() to measure the time it takes to execute an analogRead() cycle, but am having some issues. Originally, I just printed out the measured time for the analogRead() right after ...
1
vote
1answer
99 views

How can I get analog-in reading from Digital-PWM-out on the same board?

I have a wire going from PWM4 to A0 but I don't dare turn on my Arduino Mega in case this is incorrect. PWM4 will eventually go to an analog device but I want to make sure the read value is what I ...
0
votes
1answer
326 views

PWM output voltage too high

I'm experimenting with PWM with the code below, but (according to my analog multimeter) the voltage on the output pins reach up to 5V whilst the largest analogRead(IN1) value is only around 700: ...
0
votes
1answer
784 views

Sharp GP2Y0A710K0F IR sensor behaving strangely

I have just purchased a new Sharp GP2Y0A710K0F IR sensor online. As a sanity check, I wrote this simple code to check if the sensor is working correctly. The code is expected to print output voltage ...
0
votes
1answer
51 views

Serial.println not outputting

I ran the following really simple code on my micro and the monitor is just blank, not displaying any zeroes or anything and the Tx light isn't lighting up. I haven't used analog inputs much so I don't ...
1
vote
1answer
338 views

how do you capture the top value in a fallen edge in analogs data (flex sensor)

Guys i'm working with a flex sensor and I'm trying to capture a specific value which is the moment before the user lets go of a flexed flex sensor and its represented as the top point of a falling ...
2
votes
2answers
6k views

What is the sampling-rate of the `analogRead()`?

I am about to Fourier analyse some data I've taken, but i need to know at which sampling rate the data was written to the serial monitor. I've found a lot of threads about how to increase it and such ...

1 2 3
4
5
7