Hi again,
Well, I'll think I'll just stick to my two idea's.
1. ADC -> PIC -> DAC
2. PIC/comparator controlled sample/hold.
1. The first idea allows it to be completely programmable, and relatively small and cheap. Also, the code for the PIC could be very simple indeed, it would just need to constanltly sample the input voltage, check if its above your 'clamp voltage' threshold, and send the ADC's value straight to the DAC. If it's equal to/above your threshold, it simply writes a fixed value to the DAC until the input goes below it again. I think 8-bit resolution for the ADC would be fine, which any PIC with an ADC module can do. And the DAC could be an R2R ladder:
**broken link removed**
**broken link removed**
**broken link removed**
All you need is some resistors, and an opamp. These are connected to 8 pins of your PIC, so when you write a value to the PIC's port, the coresponding voltage is produced. Any IC DAC, 8-bit, with parallel input would be just fine. Easy to control with a PIC, freely available, and cheap.
Pros: Faily easy. Simple code. Cheap. FULLY customisable with the possibility of in-system, real-time digital control.
Cons: Because the input is sampled by an ADC, it is quantized. Which means you limit the input voltage to a finite number of 'levels', for 8-bits, thats 256. You can think of analogue as having infinate 'levels'. So sampling this way, you are essentialy reducing the accuracy of the signal *all the time!*, since it is the only way the signal can pass through the circuit, by being converted to digital, then back to analogue.
2. This idea is growing on me. A nice simple sample/hold circuit that allows the signal to pass through *virtually unchanged* (no quatization). It has a high input impedence so it doesn't load the sensor signal, and low output impedence so it can drive the ECU input easily. Think of it as completely transparent when no clamping is needed, it should be no different from the wire in your unmodified setup.
However, if you sample the input signal, you can set the sample/hold circuit to 'hold' the output voltage at its present value. All this would require is a way of measuring the input voltage.
sample/hold chip:
**broken link removed**
nice description:
https://www.electro-tech-online.com/custompdfs/2006/08/SH-1.pdf (NB: ignore the lower half of the schematic, thats an oscillator, which we don't need).
god bless 'discovercircuits.com'
http://www.discovercircuits.com/S/sample.htm
would work with a 0-5V or 0-12v supply:
**broken link removed**
This can either be a PIC with an ADC, or a comparator. Both allow the threshold to be changed. The PIC would constantly sample the sensor voltage, check it against a value, if its equal/more than this value, it makes a pin high (or low depending on the SH circuit) which makes the SH circuit hold its output steady. A comparator would be the analogue approach, compares the input to a reference (which can be set by a potentiometer) and triggers the 'hold' circuit once its above your reference.
Pro's: Completely transparent, allows the signal (under 4.3V) to pass unquantised, and unchanged. Can be very simple, (or complicated if you wish), and the possibility of being VERY accurate. Cheap (mostly simple analogue). Simple PIC code, or small comparator circuit.
Con's: The 'Sample/Hold' circuit cannot hold its output steady forever! Theres some leakage of the holding cap voltage, which means the output will droop after a while. If you need to hold the output at 4.3V for long periods of time (>15minutes?) you might need to add another PIC/comparator circuit to the output so that when it drops, you 'unhold' until the output is at 4.3v again. No biggie really. May require specific values/properties of parts. As with all analogue, its only as good as the quality of its components.
Note: Many op-amp circuits require 'dual rail' supplies. That is, a +V and a -V
above and below the GND. You can use a single supply, but must make a 'false ground' using a voltage divider and another opamp. Using a single 5v supply might be tricky, as that gives you +2.5v and -2.5v.
Its up to you. I've included some basic (MSpaint stylee) block diagrams of both idea's. The circuits for the 'blocks' can be found by googling, or via some of the links provided. Availability of parts depends on your location, and don't be afraid to ask companies for 'samples', both Maxim and Texas instruments have sent me several different chips for free in the past, great customer service.
Again, another mahoosive post. But as I said, I need to do a similar thing for a friend, so this is good research, and if it helps someone else, thats a bonus.
Regards,
Blueteeth.