Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 27th November 2007, 08:55 PM   (permalink)
Default

so are you saying my nyquist frequency has to be half the frequancy i am sampling.

how do i work out how often i need to sample a signal from the engine???

what sort of filter layout stops power spikes

im guessing after the opamp there carnt be really any spikes becoz the max it can go to is 3.2v when the rail voltage is 5v but the spike could blow the opamp so i need to protect the opamp from high spikes with the filter
jay543_uk is offline  
Old 27th November 2007, 09:55 PM   (permalink)
Default

Quote:
Originally Posted by jay543_uk
so are you saying my nyquist frequency has to be half the frequancy i am sampling.
It depends what you're trying to do, but the highest possible frequency entering the A2D needs to be less than half the sampling frequency - and preferably much lower than that.

Quote:

how do i work out how often i need to sample a signal from the engine???
It depends what the signals are, I would suggest scoping then to see?.

Quote:

what sort of filter layout stops power spikes
Think clamp more than filter, zener diodes are a common method.

Quote:

im guessing after the opamp there carnt be really any spikes becoz the max it can go to is 3.2v when the rail voltage is 5v but the spike could blow the opamp so i need to protect the opamp from high spikes with the filter
Which is why I said filter before the opamp.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 27th November 2007, 10:08 PM   (permalink)
Default

ok, i think i understand that the zener diode would stop the spikes but what would happen if you didnt filter the high frequancys going to the pic.

if i was measuring the vehicle speed sensor which is a hall effect sensor that has a 5v ref and 0v gnd and the return signal puts out a 5v square wall, would i have to filter that or would i have to work out the highist frequancy it would produce at the highist vehicle speed and then filter out any frequancys above that
jay543_uk is offline  
Old 27th November 2007, 10:10 PM   (permalink)
Default

Quote:
Originally Posted by jay543_uk
if i was measuring the vehicle speed sensor which is a hall effect sensor that has a 5v ref and 0v gnd and the return signal puts out a 5v square wall, would i have to filter that or would i have to work out the highist frequancy it would produce at the highist vehicle speed and then filter out any frequancys above that
You would ideally use a pin with an interrupt associated with it (Possibly RB0) and use the interrupt to trigger any code you need to run when it senses a speed pulse.

You wouldnt need to use one of the A2D channels for this as its effectively a digital signal.
picbits is offline  
Old 27th November 2007, 10:17 PM   (permalink)
Default

cool well i think that bit is easy then, maybe i should just make a digital speedo for my car and forget the rest.

so what would happen if i didnt filter out high frequancys going into the pic from say the battery which has didnt frequancy being sent to it all the time by the alternator
jay543_uk is offline  
Old 28th November 2007, 10:16 AM   (permalink)
Default

Quote:
Originally Posted by jay543_uk
cool well i think that bit is easy then, maybe i should just make a digital speedo for my car and forget the rest.

so what would happen if i didnt filter out high frequancys going into the pic from say the battery which has didnt frequancy being sent to it all the time by the alternator
Nothing much, because there's no real AC component there, you're essentially measuring a slowly changing DC voltage - but a lowpass filter will still help to cut spikes.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 28th November 2007, 06:39 PM   (permalink)
Default

ok iv looked at all the different things you have said and iv attached a circuit that iv made trying to take into consideration everything. am i on the right track

wrong picture, ill do it again
Attached Images
File Type: jpg sensor input.JPG (13.9 KB, 3 views)
jay543_uk is offline  
Old 28th November 2007, 06:44 PM   (permalink)
Default

this is the circuit i think should work
Attached Images
File Type: jpg sensor input.JPG (24.2 KB, 10 views)

Last edited by jay543_uk; 28th November 2007 at 06:48 PM.
jay543_uk is offline  
Old 28th November 2007, 09:14 PM   (permalink)
Default

That's getting something like (I'm presuming you're just not showing the power supply capacitors and filter components?.

But like I've said before, you've still got bizarre feedback components round the opamp? - you're using it simply as a buffer for an attenuator, yet you're giving it a gain of two?. Remove both resistors and connect the output directly to the inverting input - giving a gain of one.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 28th November 2007, 09:23 PM   (permalink)
Default

if i dont have a gain on the opamp the voltage at the a2d when the battery voltage is 16v is 1.6v,is that not to low.

when you say power supply caps and filters do you mean before the regulator because after i posted it i fault i just protect the regulator from spikes etc, could i do the same with another zener
jay543_uk is offline  
Old 28th November 2007, 09:34 PM   (permalink)
Default

Quote:
Originally Posted by jay543_uk
if i dont have a gain on the opamp the voltage at the a2d when the battery voltage is 16v is 1.6v,is that not to low.

Calculate the values of the attenuator to give the correct range you need, and save two resistors!. Or you could cheat (like my tutorial hardware) and make it variable gain!

Quote:

when you say power supply caps and filters do you mean before the regulator because after i posted it i fault i just protect the regulator from spikes etc, could i do the same with another zener
You need lots of filtering, and very specific protection, on car powered items - there's been lots of threads here discussing it, it's a very complex (and argumentative) subject. But you require two capacitors on the regulator, and one across the PIC - as an absolute minimum, again check my tutorial hardware, which uses the absolute bare minimum.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 28th November 2007, 09:54 PM   (permalink)
Default

how do i no what will effect a sensor signal, ie if i used very low resistors i am guessing it would, what would you say is the lowist value resistors i should use on the sensor signal side.
jay543_uk is offline  
Old 28th November 2007, 10:07 PM   (permalink)
Default

ok iv had a look at your tutorial processor board and i see the caps before and after the regulator, why does a cap stop the power spikes, does the cap absorb the spike because it trys to charge to the spike voltage.

im gona spend this weekend going throught the whole of your tutorials.

iv got a scope off ebay so im gona rig it up on the different sensors on the car and see what sort of spikes im getting as well.
jay543_uk is offline  
Old 28th November 2007, 11:12 PM   (permalink)
Default

just found a good web site on cap filters, shows it removing ripples from the power supplie, im guessing your cap values are low because the opamp and regulator do not have much load so a low cap value will still discharge slowly and filter out powers upplie ripply.

so if i look up on cap discharge to load i shold be able to get a rough idea of cap values depending on what circuits and loads im using.

does this make sense or am i talking ball???
jay543_uk is offline  
Old 29th November 2007, 08:38 AM   (permalink)
Default

Quote:
Originally Posted by jay543_uk
ok iv had a look at your tutorial processor board and i see the caps before and after the regulator, why does a cap stop the power spikes, does the cap absorb the spike because it trys to charge to the spike voltage.
The capacitors round the regulator aren't to stop spikes, they are an essential part of the regulator, and should be mounted as close as possible to it. Without them the regulator will have a tendency to oscillate, it might only be under certain conditions, but they are specified in the datasheet for good reason!. Filtering the car supply usually uses capcitors, inductors, zeners, and perhaps MOV's? - like I said it's a complex subject. It really depends if it's a 'one off' for yourself, or if you're making multiple ones.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Need help in my PIC project andales General Electronics Chat 1 24th October 2007 01:50 AM
Uni Project Advice 2-tone Electronic Projects Design/Ideas/Reviews 7 18th October 2007 01:11 AM
Can i make an Intelligent Switch by using PIC 16F84A rukshankb Micro Controllers 3 22nd September 2007 04:58 PM
communication project with micro !!! hossam mahanna Micro Controllers 1 20th July 2007 01:57 AM
Micro controller pinout for stand alone project????? cubdh23 Micro Controllers 3 2nd January 2004 10:56 PM



All times are GMT. The time now is 02:39 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker