Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : analog pin not stable for reference
Author | Message | ||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
i am having trouble with the anolog pin`s,..seems i cant hold it a zero ..i am trying to use it as a voltneter atm but have written a short program to disp on the screen ..have a 4.7 k to ground but it still dances around and i need to have a precise measurement...even with the expander board it wont stableize ...also i have to write more in the progrm to reset the voltage reading ever few seconds say between ten and 20 seconds i think the loop statement may do this but i..i am pretty new to basic i did some at school but there was only one computer back then and did not have my own ..until i got a 8bit pc ten meg turbo board which ran dos... thanks to all who reply.... technicians do it with least resistance |
||||
Gizmo Admin Group Joined: 05/06/2004 Location: AustraliaPosts: 5078 |
Hi Sparky You might need to add a capacitor across the pin to settle it down a bit. Try a 1uF or 10uF cap. Erratic analogue inputs are a common problem, but there is usually a solution, you need to find the right combination of caps, resistors and software to give the results you expect. How much is it jumping around, what are the voltage extremes, millivolts or volts. Glenn The best time to plant a tree was twenty years ago, the second best time is right now. JAQ |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
thanks` glenn i had that thought a few days back but forgot...in all the confusin trying to update firm whare but i managed to up grad it is a good upgrade the beta ...many thanks technicians do it with least resistance |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
Hi all, I've done a quick test and found that all the analog pins do indeed float quite a bit. I'm getting readings between 0 and 1.375 volts. The pins float around and are not the same at each iteration, nor are adjacent pins the same either. Regards, Bob Devries Dalby, QLD, Australia |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
evev if i could get the pin to stablize a one volt constanly that would sill give me 2 volts to play with and my divider program should be able to calculate easier in division of two instead of div`s of three as long as it can be held constant....thanks.... technicians do it with least resistance |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
added a 22 mfds electro but no difference ..thanks ... technicians do it with least resistance |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
i was thinking if i addes two <1n914 diodes in series and fed it with 3vols it may be able to stabaleize at approx 1.2 volts...thanks ... technicians do it with least resistance |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Have you tried taking a large amount of readings then divide and get an average Take a 1000 readings divide by 1000 average will be pretty stable John |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
I have found that averaging a lot of readings makes a huge difference in the stability of the voltage reading. Geoff Geoff Graham - http://geoffg.net |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
the program i run is simple :10 setpin 1,1 20 print pin(1) ok i anm no wizz at what i would have to do to run your answer ..if it comes todos ..it would be simple proolly but i have not even got a book on basic yet ..dont mean to take up your time but could you tell me how to do this ...thankyu...or any body elese for that matter.....thanks... technicians do it with least resistance |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi Maybe something like this 10 setpin 1, 1 15 temp = 0 20 for I = 1 to 1000 25 temp1 = pin(1) 30 temp = temp + temp1 40 next I 60 print temp /1000 70 goto 15 Try that and see the difference I am sure the gurus here can do a better job :) John |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
thank you at least thats a start i can elaberate from this many thanks..... technicians do it with least resistance |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
ok cool i got that going and yes its returnin zero point 05436 but does change although i now have another question "how can i get the displayed voltage to refresh ....and i took out the goto ....regards...thanks to whom replies... technicians do it with least resistance |
||||
sparkey Senior Member Joined: 15/06/2011 Location: AustraliaPosts: 819 |
its all good done it very cool used locate and cls and goto....thanks all ... technicians do it with least resistance |
||||
BobDevries Senior Member Joined: 08/06/2011 Location: AustraliaPosts: 266 |
You should be able to write code for an ANALOG voltmeter which measures the input pin(s). Look at the code for the analog clock on Geoff's site: Library 1.3 download here Regards, Bob Devries Dalby, QLD, Australia |
||||
RossW Guru Joined: 25/02/2006 Location: AustraliaPosts: 495 |
While I don't have a MM, I've had to deal with multiplexed ADC inputs over many years. A common problem (you may not have encountered this (yet) but you could probably test and confirm the behaviour) - if you try to read more than one analog input (quickly), the first input will influence the second. To test/prove - take two or three trimpots and set the wiper of each to a seperate analog input. Set the inputs to "similar" voltages and run the program to display each AD input. NOW adjust the inputs of the first AD your software reads. The further you get from the voltage of the second input, the more you influence the second input! I found you can minimise this effect by selecting the channel, delaying a few milliseconds and then reading the value. (Not all software gives you this level of control). The problem (as I understand it) is the input capacitance of the A/D converter itself, and the effective resistance of the input source. Low impeadance drives can charge or discharge the A/D input more quickly. Tracks the input better and reduces jitter a LOT. Its not always practical to do, but you should try using a low-impeadance source (opamp would probably do) to buffer your input and see if it helps. |
||||
jman Guru Joined: 12/06/2011 Location: New ZealandPosts: 711 |
Hi I am experiencing this issue at the moment. I will try a delay between reads and post the results. When reading 3 diffrerent analog inputs the quick reads are creating a false reading. John |
||||
Print this page |