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 25th November 2007, 12:54 PM   (permalink)
Default

The only stupid question is the one you don't ask.

You can often use a voltage divider made from resistors to reduce the voltage like that.
Diver300 is offline  
Old 25th November 2007, 12:54 PM   (permalink)
Default

Quote:
Originally Posted by jay543_uk
can you tell me how you would get a 1/3 gain from a opamp, iv just been using opamps as followers. are you saying that if you have an input of 3v into the opamp it will only have 1v coming out
You simply use an inverting opamp, this can give positive or negative gains - a non-inverting one can't go below a gain of one. Not that it's a problem, you just use an attenuator to drop the gain.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 25th November 2007, 12:54 PM   (permalink)
Default

Quote:
Originally Posted by jay543_uk
can you tell me how you would get a 1/3 gain from a opamp, iv just been using opamps as followers. are you saying that if you have an input of 3v into the opamp it will only have 1v coming out
You simply use an inverting opamp, this can give positive or negative gains - a non-inverting one can't go below a gain of one. Not that it's a problem, you just use an attenuator to drop the gain.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 25th November 2007, 09:05 PM   (permalink)
Question

so is it better to use a opamp instead of a voltage devider to measure sensor signals over 5v, i think they are all 5v but i want to measure battery voltage so i will have to use a opamp or voltage devider to do that as the voltage can go up to 15v when the engine is running.

is there a formula to calculate the resistors to be used in the opamp circuit to get the correct inverted voltage output

many thanks

jason
jay543_uk is offline  
Old 25th November 2007, 09:12 PM   (permalink)
Default

Quote:
Originally Posted by jay543_uk
so is it better to use a opamp instead of a voltage devider to measure sensor signals over 5v, i think they are all 5v but i want to measure battery voltage so i will have to use a opamp or voltage devider to do that as the voltage can go up to 15v when the engine is running.
No point using an opamp, a simple voltage divider is all you require - it's a VERY low impedance source, so you can use fairly low value resistors, and keep the impedance to the PIC low.

Quote:

is there a formula to calculate the resistors to be used in the opamp circuit to get the correct inverted voltage output
Yes, it's VERY, VERY simple - try googling for "741 tutorial" if you know absolutely nothing about opamps.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 25th November 2007, 10:11 PM   (permalink)
Default

the only problem i think i might have with just using a voltage devider is that the 12v battery feed has lots of spikes ect on it, do i just need to add a zender diode into the devider circuit or will that not work in a voltage devider circuit
jay543_uk is offline  
Old 25th November 2007, 10:14 PM   (permalink)
Default

You can add filters, including zeners - but bear in mind the attenuator will reduce the spikes as well. and the PIC input includes protection diodes.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 25th November 2007, 10:24 PM   (permalink)
Default

i'v never used attenuator or filter circuits, can you recommend any good web sites to learn about them, the electronic book i read talked alittle about filters but most of it went in and back out again. but iv never even heard of attenuator.
jay543_uk is offline  
Old 26th November 2007, 10:16 AM   (permalink)
Default

An attenuator (in this case) is simply a potential divider (two resistors).
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 26th November 2007, 10:40 AM   (permalink)
Default

The problem with using a potential divider on car sensors is that it can alter the characteristics of the original sensor.

For example a Vauxhall GTE temperature sender has a resistance of 3410 ohms at -10 degrees and 2030 ohms at 0 degrees. The PIC requires around a 2k input to the A2D converter (well the 18F series do) so your potential divider is going to have to be something like a 1k+2k resistor. This will effectively halve the sensors resistance at -10 degrees leading to a misreading.

For measuring battery voltage this isn't an issue at all but for some of the more sensitive sensors it could be.
picbits is offline  
Old 26th November 2007, 10:46 AM   (permalink)
Default

Quote:
Originally Posted by picbits
For measuring battery voltage this isn't an issue at all but for some of the more sensitive sensors it could be.
Which was why I specifically mentioned that reason - if it's for a high impedance source then simply use a higher value potential divider followed by a buffer (as my tutorial hardware does).
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 26th November 2007, 10:59 AM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
Which was why I specifically mentioned that reason - if it's for a high impedance source then simply use a higher value potential divider followed by a buffer (as my tutorial hardware does).
Want a fight ?

Actually thats how I've designed the input stages for one of my new products.

High resistance voltage divider for the input stage on a 1/10 divider giving me an input to an LM358DT opamp ranging from 0-1.6 volts (typical vehicle voltage range) and an X2 gain on the opamp giving me out a 0-3.2v output from the LM358DT running from a supply of 5V. The LM358 will not give out any more than around 3.5v from a 5v rail so thats the PIC protected. It will also handle up to 30v on its input pins with a 5v supply (confirmed by ST) so any spikes on the system up to 300 volts will not kill the opamp. Output from the opamp to the PIC is Opamp -> R -> C -> R -> PIC to smooth out any nasty little glitches.

Works for me
picbits is offline  
Old 26th November 2007, 11:01 AM   (permalink)
Default

Oh and the fact that I picked up nearly 5000 x LM358DT for a tenner makes it even more attractive to use as a buffer
picbits is offline  
Old 26th November 2007, 11:08 AM   (permalink)
Default

Jason - I've just had a quick browse of Nigels tutorials to see if I could find the circuit he was talking about above - you should be able to use it as it is for what you want to do.

http://www.winpicprog.co.uk/pic_tuto...ogue_board.htm
picbits is offline  
Old 26th November 2007, 11:30 AM   (permalink)
Default

Notice how I neatly avoid the requirement for a rail-to-rail opamp (which don't really go fully to either rail anyway).

As for a fight?, a little extra training always comes in handy!
__________________
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:27 AM.


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

eXTReMe Tracker