Evening all,
Looking for some help with a little electronic project of mine
I need to create a 'circuit' which monitors 7 individual voltages, and depending on which of the 7 voltages was the lowest (compared to the
others), produces a single output signal which alters in voltage depending on which of the 7 inputs was the lowest.
For example, if input 1 was the lowest, the output voltage would be 2v. If input 2 was the lowest, output would be 3v. etc etc. This is for a car
application, so everything needs to run off 12v.
Could anyone give me some guidance or any idea's where to start ?. I have got a electronic background (although many years ago), so i can
hopefully muddle through most things.
Cheers
Tris
sounds like a job for a PIC, 8 channel I/O, should do. google PIC.
hth
I shall have a go just working on it now with my "previous" knowledge haha
its going to fry my brain that's for shure!
going to play with a few multiplexers etc etc
may i ask what is the application?
Michael
A simple PIC application sounds like a quick solution. Download MPLAB (free PIC develoment environment) and you'll find it comes with a version
of a C compiler. There's loads of help on Google for this, but as a quick guess you'd basically want to to read 7 channels of ADC data into
seven variables, compare them, and then set the PWM module to generate an output voltage depending on the result of your comparison. Because
you're operating from 12V, you'll need some simple resistor dividers on the inputs to make sure that the maximum signal into the PIC is +5V,
and a bit of extra circuitry on the the output to convert the PIC's 0-5V output to 0-12V.
U2U me if you need a hand or get stuck.
Ed.
The circuit is to allow my dash (Race Technology) to interface with my engine wiring loom to determine gear position. The bike has a rotary switch
which is connected within the gearbox, which earth's one of 7 pins (Natural, 1-6), which the ECU normally holds high.
The resistance between this switch and earth can vary however, as the connection is via or 'through' the gearbox. So its more a case of
finding the pin with the lowest voltage, rather than which pin is directly connected to gnd.
Never played about with PIC's, but i like the idea of using this opportunity to learn - is there a starter kit that i can get ?
Cheers and thanks for the help so far.
I'd strongly suggest rethinking your approach to this as you are making it much more complex than it needs to be in my opinion. I appreciate that
the resistance between the switch and earth can vary but surely when one of the gearbox connections is "low resistance", the others are open
circuit are they not?
If so then you can solve this more easily with just 8 resistors and it becomes a simple case of doing some arithmetic to determine the best value for
those resistors.
Something like this (I'll try to do this in ASCII art):
1 ----- R1 ------|
2 ----- R2 ------|
3 ----- R3 ------|
4 ----- R4 ------|------A---- R8 -----B
5 ----- R5 ------|
6 ----- R6 ------|
7 ----- R7 ------|
So, if you connect each of points 1 through 7 to the gearbox connections and point B to 12V, then point A will vary in voltage depending on which
connection (1-7) is earthed and upon the resistor divider ratio defined by R1-7 and R8.
The voltage on point A will be defined by the formula: VB x Rn / (Rn + R8) where Rn is any one of R1 through R7. I can help you work the values out if
you can first confirm if the gearbox outputs are open circuit except for one of them which is a low resistance. It would help if you can take a
resistance reading of each connection for both "active" and "inactive" states just to be sure there are no surprises. It would
also be helpful to know the input characteristics of the dashboard instrument although I would tend to assume that it will not require much current
and therefore won't affect the above circuit as long as we choose sensible values (ie. K ohm range not M ohm range)
I just looked at the Race Technology DASH2 user manual online and it seems that it can learn the analogue voltages associated with each gear so you
don't need to calculate resistors to match a particular voltage, you can just use a range of resistors which will give good spacing of voltages
and then let the dash learn what they are. I'll work out some good values and report back - give me 10 mins.
Craig.
[Edited on 6/6/2011 by craig1410]
quote:
Originally posted by Tris
The resistance between this switch and earth can vary however, as the connection is via or 'through' the gearbox. So its more a case of finding the pin with the lowest voltage, rather than which pin is directly connected to gnd.
Hi again,
Okay, I've done a few calculations (sorry I took longer than 10 mins as I had a couple of phone calls between times):
If VB is 12V and R8 is 4700ohms then the following resistances for R1-R7 will give the corresponding voltages:
1. 470ohm = 1.09V
2. 910ohm = 1.95V
3. 1600ohm = 3.05V
4. 2400ohm = 4.06V
5. 3300ohm = 4.95V
6. 4700ohm = 6.00V
7. 6800ohm = 7.10V
Taking one of these as a worked example for illustration:
5. VA = VB * R8 / (R8 + R5) = 12 * 3300 / (4700 + 3300) = 12 * 3300 / 8000 = 4.95V
It doesn't matter if the resistance of the gearbox rotary switch is 0.1ohm or 10ohm or even 100ohm. It will affect the voltage at point A but if
your dashboard can learn the voltages as per the DASH 2 unit then it won't be a problem. As long as the gearbox switch resistance isn't any
higher than 100 ohms or so when closed and as long as it is open circuit when not closed.
Let me know if you need any more help.
Cheers,
Craig.
Hello All,
Sorry, its been a busy day at work, and ive only just had time to read through this thread.
Its correct that the pins are Open Circuit at the bike end when not in use, but they are powered / held high by the ECU by some unknown circuitry
within the ECU itself. I have previously tried the 'resistor' approach and it worked, but i got issues running this circuit in parallel with
the ECU, as i was somehow effecting how the ECU monitors which gear was in use.
Of interest the resistance through the gearbox does change quite a bit, but in the grand scheme of things didn't effect it really.
I then started thinking about a 'passive' approach which just monitored the voltage on each of the 7 wires, hence this post.
Cheers
Tris
quote:
Originally posted by Tris
Hello All,
Sorry, its been a busy day at work, and ive only just had time to read through this thread.
Its correct that the pins are Open Circuit at the bike end when not in use, but they are powered / held high by the ECU by some unknown circuitry within the ECU itself. I have previously tried the 'resistor' approach and it worked, but i got issues running this circuit in parallel with the ECU, as i was somehow effecting how the ECU monitors which gear was in use.
Of interest the resistance through the gearbox does change quite a bit, but in the grand scheme of things didn't effect it really.
I then started thinking about a 'passive' approach which just monitored the voltage on each of the 7 wires, hence this post.
Cheers
Tris
Thanks craig - My iva is tomorrow but after that little hurdle i will give your suggestion a try
Cheers
Tris
quote:
Originally posted by Tris
Thanks craig - My iva is tomorrow but after that little hurdle i will give your suggestion a try
Cheers
Tris