Go Back   EcoModder Forum > EcoModding > Off-Topic Tech
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 12-30-2013, 10:39 AM   #1 (permalink)
Master EcoModder
 
Join Date: May 2008
Location: UK
Posts: 332
Thanks: 16
Thanked 79 Times in 54 Posts
Send a message via MSN to markweatherill
Electronics question

Hi,

I have an O2 sensor gauge with a display that's a circle of LEDs, effectively a 1V voltmeter. I'm using it to read the output of my MAP sensor by having a potentiometer in circuit to act as a voltage divider and reduce the signal that the gauge sees, ie max 1V.
So it's a cheap boost gauge. The MAP sensor has a range of something like 1V - 5V where 1V (or so) is maximum vacuum, 2.65V is atmospheric pressure and 3.5V (or so) is full boost (0.5BAR). 5V would be 1BAR.
Now, maximum reading is something I can adjust on the potentiometer so that the gauge reads maximum at 3.5V.
What I'd like to do is make the gauge, instead of reading 0V - 3.5V, read 1V - 3.5V so I make use of the full range of the gauge.

Is there a simple way to do this? Thanks!

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 12-30-2013, 12:30 PM   #2 (permalink)
Administrator
 
Daox's Avatar
 
Join Date: Dec 2007
Location: Germantown, WI
Posts: 11,203

CM400E - '81 Honda CM400E
90 day: 51.49 mpg (US)

Daox's Grey Prius - '04 Toyota Prius
Team Toyota
90 day: 49.53 mpg (US)

Daox's Insight - '00 Honda Insight
90 day: 64.33 mpg (US)

Swarthy - '14 Mitsubishi Mirage DE
Mitsubishi
90 day: 56.69 mpg (US)

Daox's Volt - '13 Chevrolet Volt
Thanks: 2,501
Thanked 2,588 Times in 1,555 Posts
I'm no guru, but I don't think so. Wit a voltage divider you can not adjust your zero point, you can only adjust the resistors to attain your desired max value (knowing your input voltage max of course).
__________________
Current project: A better alternator delete
  Reply With Quote
Old 12-30-2013, 12:47 PM   #3 (permalink)
Master EcoModder
 
P-hack's Avatar
 
Join Date: Oct 2012
Location: USA
Posts: 1,408

awesomer - '04 Toyota prius
Thanks: 102
Thanked 252 Times in 204 Posts
electrical tape over the LEDs that light @ < 1v?
  Reply With Quote
Old 12-30-2013, 01:19 PM   #4 (permalink)
Eco-ventor
 
jakobnev's Avatar
 
Join Date: Oct 2010
Location: sweden
Posts: 1,645

Princess - '92 Mazda MX-3 GS
House of Tudor
Team Mazda
90 day: 53.54 mpg (US)

Shirubāarō (*´ω`*) - '05 Toyota Prius Executive
Team Toyota
90 day: 54.88 mpg (US)

Blue Thunder - '20 Hyundai IONIQ Trend PHEV
Team Hyundai
Plug-in Hybrids
90 day: 214.18 mpg (US)
Thanks: 76
Thanked 709 Times in 450 Posts
Send a message via MSN to jakobnev
You need to raise the ground of the meter by one volt.
__________________




2016: 128.75L for 1875.00km => 6.87L/100km (34.3MPG US)
2017: 209.14L for 4244.00km => 4.93L/100km (47.7MPG US)
  Reply With Quote
Old 12-30-2013, 01:34 PM   #5 (permalink)
Master EcoModder
 
P-hack's Avatar
 
Join Date: Oct 2012
Location: USA
Posts: 1,408

awesomer - '04 Toyota prius
Thanks: 102
Thanked 252 Times in 204 Posts
the "right" way is with op-amps, subtract 1 volt from the signal, then multiply it by 2, so 1v maps to 0v and 3.5v maps to 5v, so you have full "deflection".

to "subtract", you can invert, then sum

multiplying:
Operational amplifier applications - Wikipedia, the free encyclopedia

Last edited by P-hack; 12-30-2013 at 01:49 PM..
  Reply With Quote
Old 12-31-2013, 08:12 AM   #6 (permalink)
Master EcoModder
 
P-hack's Avatar
 
Join Date: Oct 2012
Location: USA
Posts: 1,408

awesomer - '04 Toyota prius
Thanks: 102
Thanked 252 Times in 204 Posts
Actually, for this, I'm going to say the "right" way is to use a single $1.50 microcontroller (i.e. attiny something), if your map sensor already has a 5v power supply you can set it up to run on an internal oscillator and have ZERO other components/chips (maybe a small capacitor or two). In the main loop you read the map voltage on one of the analog pins and use a pwm for the output to the meter that you constantly adjust (using a tiny program to map the input reading to the pwm setting).

If you are new to microcontrollers you can get an arduino uno clone for like $10 on ebay which makes it about as easy as it gets to get started, both in physically uploading the program to the microcontroller and in setting up your program. You can do this project with just an arduino and a computer to program it with too, just costs a bit more than a bare microcontroller.

Last edited by P-hack; 12-31-2013 at 08:46 AM..
  Reply With Quote
Old 12-31-2013, 08:38 AM   #7 (permalink)
Master EcoModder
 
Join Date: May 2008
Location: UK
Posts: 332
Thanks: 16
Thanked 79 Times in 54 Posts
Send a message via MSN to markweatherill
Thanks! This has given me food for thought!
  Reply With Quote
Old 12-31-2013, 11:52 AM   #8 (permalink)
Master EcoModder
 
RobertISaar's Avatar
 
Join Date: Jul 2012
Location: camden, MI
Posts: 324

MC SBX - '95 Chevrolet Monte Carlo LS
Last 3: 29.75 mpg (US)
Thanks: 7
Thanked 55 Times in 46 Posts
i like dealing with discrete components myself, due to simplicity/cost, but i wouldn't be opposed to an easy to learn microcontroller either.

that being said, you could run the signal through a diode and drop some voltage. a lot of the more common signal diodes would drop .7 volts, though there may be a suitable diode out there that would drop close to 1 with the current load you would pas through it. that is the only real issue that pops up for me, the voltage drop vs current characteristic.
__________________
  Reply With Quote
Old 12-31-2013, 12:39 PM   #9 (permalink)
Master EcoModder
 
P-hack's Avatar
 
Join Date: Oct 2012
Location: USA
Posts: 1,408

awesomer - '04 Toyota prius
Thanks: 102
Thanked 252 Times in 204 Posts
I hear from the discrete camp a lot, but having invested in micro-controllers I really see them as much simpler in terms of number of components used and cost, as well as flexibility.

A little more advanced, but apparently you can use arduino on an attiny45 (and use the arduino to program it). The wiring might be this simple, and a possible sketch (program), definitely worth looking at microcontrollers since one component can do the job and is like $0.50.
arduino on attiny




Code:
int val = 0; 
void setup()
{
pinMode(0, OUTPUT);
pinMode(3, INPUT);
}
void loop() {
  val=analogRead(3);
  //val=val - some constant (bench test for value) for base zero
  //val = val * another constant 
  //  to get full scale deflection of meter (bench test again)
  analogWrite(0,val);
}
edit, analogRead returns a value from 0-1023, for 0-5v respectively.
analogWrite takes a value from 0-255 (255=100% duty cycle ~ 5v), so you can probably calculate the needed constants.
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	134
Size:	34.0 KB
ID:	14332  

Last edited by P-hack; 12-31-2013 at 01:03 PM..
  Reply With Quote
Old 12-31-2013, 12:56 PM   #10 (permalink)
Master EcoModder
 
RobertISaar's Avatar
 
Join Date: Jul 2012
Location: camden, MI
Posts: 324

MC SBX - '95 Chevrolet Monte Carlo LS
Last 3: 29.75 mpg (US)
Thanks: 7
Thanked 55 Times in 46 Posts
some people just can't deal with code that well. i still have some issues with the way arduino code works and i've had some pretty extensive work doing assembly for the motorola 6800s. i can use a 6800 derivative to do nearly anything i would ever want to do with assembly, but getting more complex than simple A/D and outputs on arduino makes me feel pretty green.

if someone more knowledgable than anybody completely new to programming can write code to make the arduino work, that would be quite simple(and easily adaptable for more situations) and it is a pretty nice route to go. that little sketch does look like it would be all that is required, but i could be wrong.

i actually have a somewhat similar situation myself, i have a boost guage that doesn't seem to operate in a linear fashion.... depending on where in its range it is supposed to be, sometimes the needle swings too high, sometimes too low..... i need to learn how to deal with arrays and make a calibration table for it.

__________________
  Reply With Quote
Reply  Post New Thread






Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com