The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
2answers
200 views

ignoring potentiometer value variations

I've got a 50k potentiometer connected to an Arduino Uno. The user should adjust the hue of an Adafruit NeoPixelStrip. I've got the following code inside the loop function: int hue = analogRead(...
-1
votes
1answer
19 views

Sound sensor's output stucks to high values when I include a delay in the loop function

I use Waveshare's Sound Sensor module. I use this simple code to test the module: As you can see, the problem is that when I have a delay in the program, once the analogRead is bigger than 10 (by ...
0
votes
1answer
32 views

Mapping values from analog input giving unexpected values?

Mega 2560 I am reading in values from 3 pots then mapping them to values between 0 - 255 #define REDPIN 7 #define GREENPIN 8 #define BLUEPIN 9 int red_pot = A0; // analog pin used to connect ...
0
votes
0answers
33 views

Temperature varations using ADS1115 and voltage divider to read 12v

I have an issue with reading battery voltages of three 12 volt batteries using an ESP-01 and an ADS1115. I have been graphing the measurements and the all of the graphs have a temperature component ...
0
votes
1answer
45 views

Noisy analogRead

I'm trying to read voltage using Arduino, here's the code: float r1 = 99700; float r2 = 10004; float adc, voltage; unsigned long analog; void setup() { Serial.begin(9600); analogReference(...
0
votes
0answers
32 views

Strange cyclic errors in analogRead on Nano

I am trying to build an emergency shutdown of a gas valve based on the output of a smoke detector. It basically measures the voltage on the buzzer of the smoke detector, and if high enough, changes ...
0
votes
1answer
27 views

Playing Audio from SD - Get VU, or audio waveform

I am using the library SimpleSDAudio to play a song from my SD card to an op-amp later in the circuit. I would like to take a sample from the audio pin (possibly with a Analog read) to power some ...
0
votes
1answer
19 views

Not getting any output from ECG sensor AD8232

I am trying for the beginning to run a simple Arduino code in order to test the functionality of the ECG sensor. What I am getting on the output are some random values around 600 or around 200. I ...
0
votes
2answers
47 views

Buzzer interfere with thermistor reading

This is how i wired the thermistor and buzzer: simulate this circuit – Schematic created using CircuitLab And the code: #define RT0 10000 #define B 3977 #define R 10000 float RT, VR, ln, TX, ...
0
votes
0answers
18 views

ESP32 PH probe analogRead Value Alternating

i got an ESP32 WROOM32-OLED with a PH-Probe hooked up to it (PIN39). When i short the probe interfcace to get a PH07 reading (connecting the middle of the probe interface to ground) i get really ...
0
votes
1answer
20 views

Increasing range of a DC-offset signal (software)

I am trying to read a signal with a DC offset of 511 (as seen by the ADC). The signal's tiny with regards to the offset, and I'm feeding it to a library that does a Fourier transform on it. It comes ...
0
votes
0answers
41 views

Can HC-05 Continuously Stream data and read data at the same time?

I am trying to have my Arduino Stream an Analog Signal using Bluetooth Module (HC-05) while being able to read commands from another Micro-controller using the same Bluetooth Module. Currently, I am ...
1
vote
2answers
50 views

Why do all analog pins measure the same value?

I measure 2 analog pins: A4 and A5. The A5 pin is connected to another Arduino's digital out (through a 10k resistor) which has a simple program: 5ms on and 100ms off. The A4 pin is not connected ...
0
votes
1answer
27 views

Using case statement with IR emitter reciever

I am trying to use two "infrared obstacle avoidance modules" to work with the following sketch. From all my research, I believe, a case statement is my best option because, (I understand) the sketch ...
0
votes
2answers
29 views

Calculate statistic in EEPROM

I've search on how to do statistic calculation in EEPROM, but non related. The data that I stored in EEPROM is body temperature. Currently I stored the data using float. Below is my code for data ...
0
votes
1answer
29 views

analogRead Function AC Voltage Reading Capabilities

Usually when you sense AC voltage, you get a sinusoidal waveform. However, for AC voltage sources, Arduino analogRead ( ) only presents positive voltage values. So what's basically happening? Is it ...
-1
votes
1answer
52 views

AC Voltage Sensing using Arduino Uno

Is it possible to sense AC Voltage using analog input for Arduino Uno or can it only read DC? I mean I've tried connecting an AC voltage source to analog and I'm reading some numbers. However, I don'...
1
vote
1answer
81 views

analogRead() output oscillates even though the pin is grounded

I'm using Arduino Micro to read from 5 flex sensors and display the corresponding angles to the Serial monitor. I am currently having quite some problems with the oscillating values I am getting from ...
0
votes
1answer
59 views

Help combining digital and analog code in arduino programming

So I'm making a device that does 3 things, Measures frequency of an audio signal through a microphone Checks whether there is a weight placed on a pressure pad (my pressure sensor works through the ...
1
vote
1answer
25 views

Electret microphone board strange offset using Arduino

I'm experimenting with an electret microphone, specifically this one. I put it on my scope and I see what I expect - a really small voltage, typically under 20mV, that varies appropriately with sound....
0
votes
2answers
133 views

Value read is not changing while rotating pot in arduino?

I am trying to read voltage using analogRead in Arduino Uno from a voltage divider circuit consisting of 1k resistor and 10k pot. The Pot used is bourns 3296. The values obtained only range from 1011 ...
0
votes
2answers
46 views

How to drive Arduino UNO as a counter triggered by 555 timer's output (astable mode)

I have an Arduino Uno and a 555 timer configured to astable mode. What I'm trying to do is to program my Arduino to increase a "counter" variable (counter++) everytime it gets triggered by 555 timer'...
0
votes
1answer
56 views

How to convert digital signal to analog value

I have spwm output from arduino, and when i read on analogread it shows only 1023 and 0, because it is digital signal. Is there any way to convert these spwm value into analog value reading
0
votes
0answers
21 views

Why UDP does not work after analogRead() on esp8266-12N module? [duplicate]

Consider my loop() in Arduino be: void loop(){ for(int i = 0; i<100; i++){ Value[i] = analogRead(A0); delayMicroseconds(62); } //delay(2) //when I use this line esp8266 works properly ...
0
votes
1answer
44 views

Analog reading with noise - Arduino Uno VS ESP12e

I was testing analog output from a microphone (Max9814) with an Arduino Uno, which came with nice results. The output provided by the microphone is converted into sound and is loud and clear. Setup: (...
2
votes
1answer
100 views

Ardunio Mega/ATmega2560: Using Port F or K for both analog inputs and digital outputs

On an ATmega2560, can ports have some pins used for analog inputs but others as digtial i/o? Specifically, I only need to use 3-5 analog inputs but have many digital inputs. I would like to use the ...
2
votes
0answers
174 views

Measuring Amplitude/Frequency of sound

I need to read an analog signal at about 500-1000Hz for at least 5 seconds. I've a battery powered microphone wired into an analog and ground pin on my arduino and am trying to measure the frequency ...
0
votes
1answer
79 views

making power harmonics analyser which will measure the amplitudes of the fundamental and its multiples (like 50hz, 100hz, 150hz,200 hz,…) there are)

i have been intendng to make a power frequency harmonics analyser which will measure the amplitudes of the fundamental and its multiples (like 50hz, 100hz, 150hz,200 hz,...) there are examples for ...
0
votes
1answer
82 views

Measure small capacitances with ATtiny85 (Digispark board)

I have successfully run the code provided here on an Arduino Nano. If nothing is connected, it will output a very small capacitance (~ 1 pF). Then I tried to migrate the code to the ATtiny85 (using ...
0
votes
2answers
110 views

What data type are the analog pin labels (A0, A1, etc)?

Arduino Mega I would like to have an array containing analog pin labels something like... int analog_pins[] = {A0, A1, A2, A3}; int num_analog_pins = sizeof(analog_pins) / sizeof(analog_pins[0]); ...
1
vote
1answer
44 views

How to read analog pins from a second Arduino

I've run out of analog pins on Arduino Uno and don't have time to order new parts. I've heard you can connect two Arduinos and I have access to another UNO. If I did that, could I read the analog pins ...
0
votes
2answers
73 views

Arduino analogRead fluctuates from sensor unless USB connected

I have an Arduino connected to a 4-20 mA sensor through a current to voltage converter. When connected to the power supply the sensor reading fluctuates, as soon as I also connect it to a USB port it ...
0
votes
1answer
45 views

Can I read using an analog pin on an arduino Mega whether or not there is a high (5v) voltage on a wire from another board's digital pin?

I am making a peer-to-peer network of initiating devices and a common hub, which controls most of the hardware. It sends a number over Serial to Mega's Serial1 (Mega's Serial is used for communicating ...
0
votes
2answers
99 views

Would a 100KΩ resistor connected to ground pull an open analog line down to 0

I have a project that has a photoresistor wired into a voltage divider and connected through a 3.5mm “stereo mini plug”. When nothing is in the mini plug, the analog line is an open circuit, and ...
0
votes
1answer
32 views

How to map integer values and round to a count of tens/thousands?

I'm mapping a potentiometer from 0-1023 to 1000-120000 (1 sec to 2 minutes) for a timer, like: maxDelay = map (pot2, 0, 1023, 1000, 120000); Both variables are integers. Now I would like to convert/...
0
votes
1answer
203 views

How to re-construct audio from series of analog integer input?

I'm trying to learn how to stream audio from the A0 pin of an ESP8266 NodeMCU board via UDP socket connection over to another windows computer that uses pyaudio to play it. At the moment, all I get ...
1
vote
2answers
257 views

AnalogRead value constant for a varying voltage (for LED brightness variation)

Having the 11~ pin on OUTPUT mode that delivers a varying voltage (from 0 to 5 : 0 to 255). and the A0 pin on INPUT mode to read the voltage, I find that the value read by A0 being either 0 or 1016 ...
0
votes
1answer
159 views

Analog output gives a close range of values

I try to get a good range of values from VMA309 sound sensor. However, when I connect it properly it gives me a range of values +/-5 like below. The documentation says it should give numbers ...
0
votes
2answers
2k views

Reading Multiple Analog Input Pins

I am having a bit of trouble trying to read multiple Analog Input Pins (A0 and A3, in this instance). I am using a Pololu A-Star 32U4 LV Robot Controller (https://www.pololu.com/product/3116), and am ...
0
votes
1answer
73 views

Cannot get esp8266 - 12 wifi module to always read analogRead incoming voltage accurately

So I have and arduino uno that is firing an output on pin 8. This code is not in this file just to be clear. From there Im taking that output and using it to fire pin 0 on the wifi module. Im using ...
0
votes
0answers
34 views

Differing behaviour from Arduino Nano when plugged into laptop vs power source

Well here's a weird one. I'm monitoring a mic on an analog pin of an Arduino Nano and using the variation in voltage to control and LED. When plugged in to my Laptop (USB 3, 500ma available, the ...
0
votes
1answer
88 views

Reading analog value while generating PWM signal

I'm trying to generate dim two LED strips simultaneously by generating two PWM signals based on potentionmeter value. The pot sets how bright each of the LED strips will be. To drive this I'm using ...
0
votes
1answer
278 views

Unstable analog sensor readout

I have the Arduino Uno (non-original replica) board, general SPI lcd, and GUVA-S12SD analog UV sensor module. The board (powered via USB) reads the data from the analog pin 0, converts it to voltage (...
1
vote
4answers
361 views

How to boil down analog input to just three cases?

I am investigating the use of a 3-position-switch for one of my projects to switch between different settings using just one analog input pin. For the three positions I am using ground/0V, ~2.5V (via ...
-1
votes
2answers
360 views

Can a 150 PSI Pressure Transducer accurately measure up to 30 - 40 PSI? [closed]

I have an Arduino project which requires reading pressure data from a pipe. The best pressure transducer I have been able to find is this one. Seeing as though its max pressure is 150/200 PSI, will ...
1
vote
2answers
89 views

How would I go about measuring an analog signal on my arduino mega that has both positive and negative voltages

I have a signal that fluctuates between -70mV and 50mV. How would I get the arduino to read this.. Ultimately I am trying to graph the data in real time so it looks like this. https://imgur.com/a/...
1
vote
1answer
209 views

Differing Serial Values Between Arduino Uno and TTGO ESP32 SX1276

I'm wanting to analogRead the value off a MQ-135 gas sensor. I have tired this with both an Arduino Uno and an TTGO ESP32 SX1276. When reading the value of the sensor off the Uno, I get values ...
0
votes
1answer
248 views

Arduino Due ADC negative voltage

I’m trying to sample an AC signal on the Arduino Due. The AC signal will never exceed +-80mv across a frequency range of 6-833Hz. Current is negligible. I believe there are clamping diodes to protect ...
1
vote
2answers
91 views

arduino firmware

Hi I was wondering if there is any way to/ how I might go about solving the following. I am designing my own arduino board based on a mega32u4 chip and I want my arduino board to light up an ...
0
votes
1answer
1k views

Read frequency of input in digital pins

This is a somewhat theoretical question: Let's say I have some sensor that sends digital signals to one of Arduino's digital ports. Now, I don't know the frequency it sends those signals in. For ...