hi I am getting sensor output as mentioned below in the figure but Arduino is not reading the sensor output waveform can anyone suggest the code
It would help if you posted the whole screenshot with the scale details. The screenshot appears to show that the waveform has a -ve component so you will have to introduce additional electronics to handle that. The part of the waveform you have posted also appears to show a pk-pk voltage of around 6.8v which will also need additional electronics to bring it within the range of the ADC.
the Arduino ADCs take positive voltages - so you have to offset your signal in some way
have a web search for arduino adc ac signals which should give your some idea
what is the source of the signal? is the signal relative to ground or is it floating?
thank you for the replay, I have tried with pk to pk voltage of 2v by using an additional circuit but still, the waveform is not read. here is the full waveform with scale
the signal is coming from the amplifier present on the sensor it has analogin, VCC, GND, and floating values only.
if the sensor GND is not connected to the arduino GND you should be able to use a simple DC offset as with the STC-013 sensor
also, as indicated by @markd833, you will also need to attenuate the signal to bring its peak to peak range within the range of the ADC
what Arduino are you using?
Arduino UNO
The scope trace shows AC coupled input. Show it with DC coupling, you Arduino will see it that way.
okay thank you i will check
I am shifted and changed the values between 3v as shown in the figure but still, it is not detecting the signal.
could you post your code?
...and a schematic
(I'm amazed we're at reply #12 and have had to ask)
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.