Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [analogread]

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

0
votes
1answer
23 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
32 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
42 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
29 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
1answer
22 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
40 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
54 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
27 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
74 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
197 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
67 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
286 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
40 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
29 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
44 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
128 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
189 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 ...
0
votes
2answers
122 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
60 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
148 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
96 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
90 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
415 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 ...
6
votes
2answers
84 views

How can I differentiate between multiple circuits?

I'm building a puzzle for an escape room. I want to give the user 6 wires and 6 terminals, then confirm that they've connected the correct wires to the correct terminals (one-to-one). My first (...
3
votes
1answer
645 views

How can I create a battery level circuit

Im trying to create a circuit so that I can monitor the voltage drop on my battery and send an message when the voltage drop reaches the drop out. But I'm having some problems with my voltage ...
1
vote
1answer
50 views

Why does reading an analog pin give a different results when interfacing with Processing?

I am interested in measuring the voltage over an analog pin (A6). When I use the Arduino IDE to print the results through the serial I get values around 300. Here's the code void setup(){ Serial....
1
vote
1answer
335 views

Analog inputs showing value even there is nothing connected to it [duplicate]

After watching something weird on the serial monitor I wrote a simple code to monitor the analog pin input values. There was nothing connected to the analog pins still they where showing decimal ...
0
votes
1answer
54 views

If I use a biasing circuit for a signal going into an analog input pin, will it affect the ADC operation?

If I have a single 100Hz AC signal biased by two 1 M-ohm resistors (as per schematic below), and then output to an Arduino UNO analog input pin, with the UNO sampling at around 1 kHz using delays, ...
0
votes
0answers
337 views

avrdude Programmer is not responding Mac

I'm VERY new to Arduino programs. I'm trying to upload the AnalogInOutSerial example to my Arduino, however, I keep getting an error saying that there is a problem uploading to the board. Thank you ...
1
vote
1answer
668 views

Read both battery voltage and analog sensor value with NodeMCU ESP8266

I have a soil sensor that reports value once every 5 minutes, deepsleep in between. Is there a way to also report battery voltage (with ESP.getVcc())? To get the battery voltage reading to work I ...
0
votes
1answer
27 views

Arduino Micro interference between analog inputs

I'm building a MIDI controller with the Arduino Micro, hooking a bunch of knobs up to the analog inputs. Currently, I'm getting analog in 9 being influenced by analog in 10: analogRead(9) returns a ...
1
vote
1answer
59 views

Strange behavior on bitwise operation

i am trying to write a simple program that writes the outputs of an accelerometer (which comes down to 3 analog inputs) onto an SD-Card. I got the hole thing working fine (sending the values as ...
1
vote
1answer
102 views

Why do you need to shift bits when reading from an analog sensor? [closed]

I was playing around with some analog grove sensors and looking at examples (https://github.com/DexterInd/GrovePi/blob/master/Software/Go/grovepi/grovepi.go - this specific example is in go and for ...
0
votes
1answer
232 views

Interaction between Analog Pins when measuring a DC voltage- a common issue? [duplicate]

Just set up a replacement "Piduino" - a RPi3 connected by USB to an Arduino Uno. The previous one was the victim of a Diet Big Gulp - spilled on the voltage divider breadboard. Whoops. The tiny ...
1
vote
1answer
285 views

analogRead() inside a loop always returns 0

I wrote Arduino code to receive analog input from different voltage dividers connected to four pins (A0 to A4) and analog input from a temperature sensor (LM35) to A5. analogRead inside the for loop ...
0
votes
1answer
269 views

Non-blocking analogRead

In my recent project, I'm working with the motor. I have to drive the motor for the specific time like for 2 minutes, 3 minutes, 4 minutes and 5 minutes. I already created functions for that. And ...
1
vote
4answers
654 views

What is the lowest resistance pot that is useful with an analog input?

Background I've dabbled in electronics since my parents gave me a 150-in-1 kit in the 1970's but never had formal training. My dad repaired Honeywell mainframes so taught me to solder when I was 8. I ...
1
vote
2answers
62 views

analog read only once a time

I was working on a school project in where i need to analog read form A0 and test if my value is bigger than some boundary (500 for example) to return 0 or 1 well with a simple code in an infinity ...
1
vote
2answers
1k views

How to measure the supply voltage of Arduino without using an analog pin

I'm using Arduino Nano to measure temperature with a 10 kohm thermistor and a voltage divider. My problem is I'm getting only 4.2V on the 5V pin. The power is supplied via a USB cable from a desktop ...
1
vote
1answer
324 views

Getting the voltage of an 18650 battery with an Arduino

I'm using a Arduino Pro Mini (5v) to sense the voltage of an 18650 battery. The battery (that is being sensed)is also used to power the Pro Mini but the MCU is behind a boost-converter which outputs 5....
0
votes
1answer
151 views

Two-wire Conductivity Sensor and Arduino Hook-up?

For the conductivity meter shown in the photo below, it is a non-NPN sensor for measuring conductivity / impedance. I am trying to figure out the best method for measuring the output of the sensor ...
3
votes
4answers
102 views

Build a timer that starts and stops timing when 2 wires are broken

I need to build a timer that uses the breaking of copper strips to trigger its starting and stopping. The intention is to measure the speed of a rocket with this - it will break the first wire, ...
0
votes
1answer
54 views

UNO: AnalogRead results not as expected

I'm new to Arduino, and trying to build a project that will measure the voltage and current from two, unconnected, 12v batteries. The present test environment comprises:- a 13.8v power supply (run ...
1
vote
1answer
273 views

bit_is_clear(ACSR, ACO) Instead of digital_read(1)==LOW

I am attempting to create a program for the atmega328P which will enable the aux input of a Toyota Corolla stereo. In order to do this, I'm bitbanging AVC LAN. Nearly all of my research comes from ...
0
votes
2answers
65 views

Arduino Voltage Divider

So am doing a project which involves the reading of voltage and current generated by Solar Panel. Now I learnt that Arduino cant Read Voltage directly above 5V. To read above that you need to add a ...
0
votes
1answer
83 views

Arduino UNO - analogRead() returning mixed results

I have created a small circuit with a 220 Ohm resistor and a LED connected to PIN9 for power. I want to measure the Voltage of the current flowing through the circuit. In order to do that I connected ...
0
votes
1answer
161 views

Connecting two analog multiplexers (CD4051b)

Is it possible to connect two CD4051b analog multiplexers together so that I can receive 14 analog inputs through them? Just by using one analog pin and three digital pins on the Arduino UNO.
2
votes
4answers
3k views

what is arduino adc reference?

I'm using arduino for the first time and don't really understand what am I suppose to plug to the ADC refernce PIN... or if I even have to use it while plugging analog sensor to the arduino, thanks!
0
votes
0answers
32 views

Analog Read gives Erratic behaviour in Struct

I'm getting some very strange behaviour from a Haptic feedback system I'm trying to make. The test code works fine as a Multiple-In One-Out in the main loop, but once I moved the code to the Struct, I ...
2
votes
2answers
285 views

Lowest voltage applicable on AREF pin on Uno and Mega

I need to measure an Analog signal in the range of 5-30 mV. Naturally, using the internal default 5V reference leads to very poor measurement resolution. I would like to use the capability to use an ...