Skip to main content

Questions tagged [analogread]

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

Filter by
Sorted by
Tagged with
7 votes
4 answers
35k views

How to add hysteresis to threshold values?

This code compares the analog input value against two thresholds, having three voltage regions. Then it will turn on an LED according to what region the read voltage is in. The problem is that when ...
Andy's user avatar
  • 103
2 votes
2 answers
24k views

Arduino: Read frequency of input from audio jack

I want to trigger an arduino from a sound from an audio jack from a mobile phone. The audio is a 1 Khz sound that the mobile will play. I want to avoid accidental triggering of the audio by testing ...
R0b0tn1k's user avatar
  • 187
0 votes
1 answer
303 views

How to interpret analog values sent to Arduino from line scanner?

So I have a line scan camera attached to my Arduino Mega and I'm trying to send it a digital clock impulse and get an analog output back. The line scan camera is supposed to return 128 pixels. So far ...
Fortuna Iwasaki's user avatar
5 votes
4 answers
21k views

Can I connect a PWM pin on one Arduino to an analog input on another?

I was considering several different ways to send simple data from one Arduino to another when I though, why not connect a PWN pin of one Arduino to the analog pin on another? I could send simple ...
Hoytman's user avatar
  • 747
4 votes
2 answers
6k views

How to increment and decrement an output voltage by using two buttons?

I'm trying to create a code using an Arduino Uno board to increment and decrement the output voltage of the Arduino Uno which is 5 volts and I need to step it up to 10 volts which I have done below. ...
A-UNO help 's user avatar
2 votes
1 answer
539 views

Read an analog signal without changing it? Or should I start over?

Hi! I'm still working on my kettle project. I want to obtain the kettle temp from the existing thermometer. I'm able to do this, but much like trying to look at an electron my circuits all reduce the ...
futurebird's user avatar
1 vote
1 answer
3k views

4 channel relay module reversed? Or is it my code?

So I am designing a simple project where my Arduino reads analog values from a potentiometer, or rotation sensor, as it is called on EBay, and uses that value to determine how many relays to close. I ...
user3211857's user avatar
-3 votes
1 answer
211 views

Reading constant battery voltage and using the obtained value in sensor formula

there i am working on a project in which my system is connected to 3.7v~4.2V lithium battery, I have to read constant battery voltage irrespective of the current battery voltage and to do that I am ...
electro_nooobbbb's user avatar
6 votes
2 answers
11k 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 ...
Julio Orozco's user avatar
5 votes
3 answers
26k views

Sending a value from one arduino to another

I wonder if it is possible to send a value from one arduino to another. Basically, I have one arduino measuring let's say weight, but I want to display that value using an lcd in another arduino. ...
Camilo's user avatar
  • 359
5 votes
2 answers
10k 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 ...
dixhom's user avatar
  • 151
4 votes
1 answer
5k views

Precision voltmeter using Arduino

I am newbie, I need to measure precise voltage in range 0.00-0.80V, two digits precision. The voltage will not be greater than 1V-1.2V. I wonder if I need divider or not, I am sure that voltage ...
solderingiron's user avatar
3 votes
4 answers
16k 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!
user avatar
3 votes
2 answers
9k views

Reading many analog signals in arduino

I need to measure around 50 - 100 analog sensors (resistors). This poses two challenges: Arduino has fewer analog pins. I'm targeting something small like arduino Mini or Nano, which can have up to 8 ...
Francisco Presencia's user avatar
2 votes
2 answers
4k 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 ...
acs's user avatar
  • 235
2 votes
2 answers
891 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 ...
Sir's user avatar
  • 23
2 votes
2 answers
388 views

ADC register always returning high

Regardless of whatever voltage at A0, the software is always returning high (1023) volatile unsigned char* ADmux = (unsigned char*) 0x7C; volatile unsigned char* ADCSRa = (unsigned char*) 0x7A; ...
ClockwerkSC's user avatar
2 votes
1 answer
3k views

Arduino Cross Correlation?

How can I write lightweight cross correlation code for arduino? I couldnt find any solution. The measurement system contains an ultrasonic sensor and a servo that turns from 45 to 135 degree and ...
acs's user avatar
  • 235
1 vote
3 answers
2k views

Analog input draws current when Arduino is turned off

I am using a Arduino Pro Micro from SparkFun (similar to Arduino Leonardo, cpu: Atmega 32u4). It has a analog input: A0, which I use to keep track of the battery voltage in my battery powered project (...
salami738's user avatar
1 vote
2 answers
2k 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; ...
Dzung Nguyen's user avatar
1 vote
3 answers
2k 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 ...
zalt's user avatar
  • 93
1 vote
1 answer
2k views

Issue with CD74HC4067 MUX on high values

I'm having a small issue with the CD74HC4067 multiplexer/demultiplexer: I am using it to receive data from an array of sensors (at the moment I have only 2, but in a near future they will grow). ...
Luca's user avatar
  • 183
1 vote
2 answers
1k 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, ...
AvidScifiReader's user avatar
0 votes
1 answer
6k views

Analog read not working while using WiFi

I have an ESP32, the current program running on it uses WiFi but, if I use WiFi and Analog read at the same time, Analog read does not work. Why does this happen and what's the way around it? Hardware ...
Coder9390's user avatar
  • 472
0 votes
2 answers
2k views

Reading a photoresistor

I have a wire with a 0-5v current. I want to detect if the current is there or not (HIGH/LOW.) I'm using an optocoupler to avoid putting too much current into my micro, as it is only a 3.3V micro. I'...
futurebird's user avatar
0 votes
1 answer
947 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() { ...
kelin's user avatar
  • 145