Is my netduino faulty? Simple analog test = 1023 constant :(
#1
Posted 08 March 2012 - 10:33 AM
#2
Posted 08 March 2012 - 12:41 PM
#3
Posted 08 March 2012 - 05:02 PM
#4
Posted 08 March 2012 - 05:49 PM
#5
Posted 08 March 2012 - 06:34 PM
#6
Posted 08 March 2012 - 07:54 PM
You might want to try adding a simple digital low-pass filter to the output of the ADC to remove the noise..
This is an example of one that I am using in some inclinometer readings to remove the high frequency stuff and just give me the filtered version of the signal.
i have attached the code here to Lowpass.vb 844bytes 1 downloads
Imports System Public Class LowPassFilter Private m_Top As Double Private m_Cutoff As Double Private m_Value As Double Public ReadOnly Property Value() As Double Get Return m_Value End Get End Property Public Sub New(ByVal cutoff As Double) Me.New(cutoff, 0) End Sub Public Sub New(ByVal cutoff As Double, ByVal initialState As Double) If cutoff > 0.75 Then Throw New ArgumentOutOfRangeException("cutoff should be less than 0.75") End If m_Cutoff = cutoff m_Top = 1 - m_Cutoff m_Value = initialState End Sub Public Function Update(ByVal value As Double) As Double m_Value = (m_Value * m_Top) + (value * m_Cutoff) Return m_Value End Function End Class
You call "update" each time you take a reading passing the raw reading to the filter and then use the "value" property of the filter to get the filtered value.
You instantiate the class object with either just a cut-off value or both a cut-off value and an initial value.
Have fun and I hope this helps
<edit for additional ideas >
One way to make this smoothe is to put your code that reads and updates the filter into a thread of its own. You can put a small thread sleep of say 100ms. The faster you read the adc the better the noise rejection of the filter. I have some examples of how I do this in my inclinometer code if you would like to use them drop me a MP and I will send you the code.
<edit end>
Cheers Pete.
The world will have to wait.
#7
Posted 08 March 2012 - 11:47 PM
#8
Posted 09 March 2012 - 04:21 AM
#9
Posted 09 March 2012 - 06:00 PM
#10
Posted 09 March 2012 - 07:34 PM
It is an excellent tool for designing circuits and sharing them with others.
It has a breadboard build platform that allows you to design your system using a visual interface.
If you get this and design your idea using it you can share the .fz file here on the forum and other can modify it and send it back to you.
This may help us to understand the way you have things wired up and make suggestions on how to fix it.
Cheers Pete.
The world will have to wait.
#11
Posted 09 March 2012 - 07:54 PM
Attached Files
#12
Posted 09 March 2012 - 08:12 PM
The world will have to wait.
#13
Posted 09 March 2012 - 08:34 PM
Attached Files
#14
Posted 09 March 2012 - 09:16 PM
The world will have to wait.
#15
Posted 09 March 2012 - 09:29 PM
I'll try and ground all the other pins also.
Xocai
Hello,
The file was not attached
Can you try tying all the analogue ports you are NOT using to ground and re-try the mesuments on the port again. You should be seeing 0 on all the ports tied to ground and you should only see a value on the port you have the sensor attached to.
Cheers Pete.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users