Questions tagged [analogread]

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

Filter by
Sorted by
Tagged with
-2
votes
1answer
173 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 ...
1
vote
3answers
4k 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 ...
1
vote
5answers
8k views

Arduino unstable analog reading when using power supply

As soon as I unplug my Arduino from USB and only use the VIN pin with my 9 V power supply, the analog readings from my Arduino start to get unstable, which means the value fluctuates much more ...
0
votes
1answer
54 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
66 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
348 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
2answers
193 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
1k 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 ...
1
vote
1answer
529 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
4answers
5k views

Increasing ADC resolution

At this moment I am using oversampling to increase my analogread resolution. This in combination with increasing the frequency of the ADC. Is someone able to take a look at it? #define FASTADC 1 // ...
3
votes
1answer
472 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
2k 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 ...
5
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 ...
0
votes
2answers
365 views

Driving numerous chips from 2 separate SPI connectors w/ Arduino Micro

I want to drive numerous chips (L9823, TLC5925, ADG1414, MCP23S08) from an Arduino Micro as well as read input from analog pins connected to momentary buttons, toggles, potentiometers and such. The ...
2
votes
2answers
690 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
116 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 ...
1
vote
1answer
310 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
121 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
2answers
718 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
858 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
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 ...
0
votes
0answers
422 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
1answer
184 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 ...
0
votes
1answer
710 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
2answers
121 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 ...
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 ...
1
vote
1answer
533 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 =...
1
vote
2answers
849 views

XL335B accelerometer reports false readings

I'm using an XL335B accelerometer in a GY-61 breakout board. I'm powering the device using the UNO's built-in 3.3V power supply. The following code should convert the readings to m/s² (SI); however, ...
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 ...
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
3answers
374 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
2answers
901 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
657 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
3answers
1k views

How to Store 2 analogRead values and read using EEPROM for Arduino Uno?

Trying to write 2 values coming from analogread(A0) and analogread(A1) by EEPROM.write and retrieve the values by EEPROM.read. I tried the following sketch for each write and read. However, could not ...
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
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
376 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
17 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 ...
0
votes
1answer
161 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 ...
0
votes
1answer
295 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
3answers
5k 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
44 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 ...
1
vote
1answer
86 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
48 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 ...
0
votes
1answer
720 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 ...