Discussion in "Project Addition or Changes" started by    neil03    Feb 2, 2010.
Tue Feb 02 2010, 06:42 pm
#1
hello members please help me regarding my project. Ok first im doing a project that is somewhat a speed controller and on the code part I require to do some counting. Ive done the coding part 'but' when Im simulating to do the counting im only using a switch. resulting that the operation of my mc work is working correctly.

Now A sensor is replaced to the switch that is connected to the counter. The sensor outputs logic 1 and 0, but now the operation of my mc went weird. In the code every value of my counter responds to a specific operation for example an led will light after 3 counts...It is hard to explain how does the operation works randomly weird, sometimes it can do the operation sometimes not, but mostly not...

I suspect that it is the signal of my sensor to the counter that's something wrong because when using a switch the operation is correctly working..and I believe that it must have not work smoothly using switch because it is prone to bouncing signals...

Any advice please..recent revisions that I have made is that I placed a comparator to the output of the sensor to the counter but still not working...
Tue Feb 02 2010, 09:08 pm
#2
Unless you capture the signal with a scope, you will never truly know the severity of the noise in your circuit.

You can just "over" filter the signal using a resistor and a cap (like 10K and .1uf) to see if this affects your code, but you will never be sure without a signal trace...

 neil03 like this.
Tue Feb 02 2010, 10:47 pm
#3
hey dave thanks for the advice i tried it, it works but its about 40% to 60% rate that the operation works. Do you have any links or computations for the filters that I can look into... thanks man
Wed Feb 10 2010, 11:05 pm
#4
Sorry it's been so long since I checked back on this thread...

There are no "computations" or mathematical formulas here, only simple averaging.

I believe I wrote about software filtering in this thread:

http://www.8051projects.net/forum-t29267-0.html#post_29311

and of course, simple hardware filtering uses a resistor and a capacitor, referred to as an RC time constant. Feeding the signal through a resistor, with a cap on the other side to ground, filters out all of the quick spikes, but reduces your bandwidth...

You'll have to play around with both to see which is the best fit for your app...

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm
Robertgurse
Wed Apr 24 2024, 02:43 pm