-->
Page 1 of 1

general question on anologue i/o pins

PostPosted: Mon Jun 12, 2017 6:37 pm
by JeffT
My background is programming not electronics. I have a handle on how microprocessors operate.

I have to find a solution to a current situation. I have a sensor which puts out an analogue signal varying between 1.5 and 5 volts. I want to send it to a device but somehow drop the voltage so that it appears 1v lower than the signal sent. i.e. if it is actually sending 2.5v I want it to be converted to 1.5v, 3.5v to 2.5v etc.

I thought of using an arduino - sending the original signal to an analogue input pin - reading the value and converting it with a couple of lines of code - then putting it out to a PWM pin as the desired value.

I suspect this is a dumb way of doing it and there is a much simpler method that does not involve using a microprocessor.

Can anyone tell me what that method is :?:

thanks in advance

Re: general question on anologue i/o pins

PostPosted: Mon Jun 12, 2017 8:08 pm
by QuickFix
The ESP8266 has an ADC-pin, you can use that to sample analogue data (no need for an Arduino).

Re: general question on anologue i/o pins

PostPosted: Mon Jun 12, 2017 10:15 pm
by rudy
The ESP8266 has one analog pin (as stated above) and it has pwm output capability just like other Arduinos. Same code will work. The range of the pwm output is 0-1023. The one problem with the A0 analog input is that it has some noise.

https://github.com/esp8266/Arduino/issues/2070

Re: general question on anologue i/o pins

PostPosted: Tue Jun 13, 2017 1:11 am
by schufti
the simple analog solution would consist of one simple OPamp and three resistors.
But for this solution you are on the wrong board, look for an electronics beginners board.