Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Voltage Clamp

Status
Not open for further replies.
Papabravo said:
A thorough understanding of electro magnetic coupling mechanisms, along with the requisite diganostic skills and sophisticated instrumentation.

and frankly, that's just a start. but you can do a lot of things that will help.

I'm no expert but I'd start by decoupling all your ICs. make sure the power supply is nice and clean. have a nice ground plane. take care to isolate the analog section from every thing else. use low pass filters on signals coming from outside. in ADC sampling, most micros have a way to shut down the digital section to reduce digital noise internal to the chip. I think there is a microchip tech brief on this topic (maybe ap note?).

google turns up lots of info but you have to dig a bit to find it amongst the, ahem, noise.
 
Papabravo said:
A thorough understanding of electro magnetic coupling mechanisms, along with the requisite diganostic skills and sophisticated instrumentation.

Hmmm, not really, just from help, advise or recomendation(s) (as requested), from someone with.....
"A thorough understanding of electro magnetic coupling mechanisms, along with the requisite diganostic skills and sophisticated instrumentation"

Anyone here able to offer that? I can't I don't have the "sophisticated instrumentation" ;)
 
So low pass filters as in a capacitor and maybe a 1:1 transformer similar to a ground loop isolator on the power line? Or is this something I want to put on the signal line or both?
 
That sounds like a circuit for an AC (or pulsed) signal, I was assuming that the signal from the car was more likely to be DC, if it's AC then you will need to know the frequency etc.

I wouldn't get too stressed out with the finer points of filtering noise at this stage, possibly as Philba sujested, decoupling capacitors (i.e. from +V to 0V on the circuit, and on the incoming signal) Say 470uf and 100nF for the supply, and a current limiting resistor (1K - 10K ish) and 100nF for the input signal may be a good starting point.

Another good device I have found for clamping noise especially in DC applications are "Transorbs", check them out on google ;)

This will give you a chance to write your code and test it. When you have fine-tuned your code, and are happy that the system is doing what you want. If you are going to produce this thing commercially, I would recommend investing some time/money on giving this device to someone who really knows what they are talking about (as far as the "noise" issue goes), preferably someone who deals with cars ;)

These are only my opinions/ideas, you need to go what ever route you are most comfortable with.

I hope this helps
 
Last edited:
Matt(Pic progger) said:
That sounds like a circuit for an AC (or pulsed) signal, I was assuming that the signal from the car was more likely to be DC, if it's AC then you will need to know the frequency etc.

I wouldn't get too stressed out with the finer points of filtering noise at this stage, possibly as Philba sujested, decoupling capacitors (i.e. from +V to 0V on the circuit, and on the incoming signal) Say 470uf and 100nF for the supply, and a current limiting resistor (1K - 10K ish) and 100nF for the input signal may be a good starting point.

Another good device I have found for clamping noise especially in DC applications are "Transorbs", check them out on google ;)

This will give you a chance to write your code and test it. When you have fine-tuned your code, and are happy that the system is doing what you want. If you are going to produce this thing commercially, I would recommend investing some time/money on giving this device to someone who really knows what they are talking about (as far as the "noise" issue goes), preferably someone who deals with cars ;)

These are only my opinions/ideas, you need to go what ever route you are most comfortable with.

I hope this helps

It is a DC circuit. I will have to google that stuff and figure it out. I plan on getting an osiliscope soon as well so I can check for noise.
 
The problem with all the ad hoc solutions is that you have no idea if they will work or they won't. You're going to waste a great deal of time trying them all. If your time is worth less than the alternative then by all means go right ahead. Your default assumption that these problems are simple and straightforward is leading you to the sea of disappointment. Trust me on this.
 
the low pass filter I was thinking of was a series resistor with cap to ground. calculate the cut off frequency pretty low. keep in mind the max impedence the ADC can tolerate. the idea is to filter out all the spikes and such since they will mostly have hgih frequency components. My guess is your signal won't be changing at more than 10s of hz.
 
Hi,

I might as well give my two cents (or pennies) on this, as I have been asked to do a very similar thing for a friends car, so I've done a bit of research.

RedCarzRFaster said:
The problem is my digital pot hasn't arrived yet but I am wondering if this is the correct way to go about it.

I'm sure it is possible for this method to work, but there may be a cheaper, and easier option. Of course, using a pure analogue approach, clamping voltage with diodes etc.. would be cheap, but as previous posters have pointed out, not overly accourate. Also, if for some reason, you wanted to change the clamping voltage, this would mean changing components, desoldering, resoldering etc..

The advantage of using a microcontroller is (re)programability. If you are fairly up on PIC programming, you could add a serial interface (HW or bit banged depending on your PIC) that allows the system to be modified in real time.

Anyway, 'digital pots' from what I hear, aren't all that. Although they are very handy for digital control of 'resistance' (volume control) where you have absolutely no control over what type of signal is passed through the pot, your signal is a control voltage, which I suspect does not have a high frequency.

ADC -> PIC -> DAC.

The ADC can be in the PIC, and the 'DAC' can be a simple R2R ladder, followed by an opamp, and a low pass filter. The LPF is so the output doesn't jump, confusing your ECU, and possibly making it over-react. Of course, a 'digital pot' would be better, as this provides some form of isolation, but any sudden changes in resistance (depending on any capacitance at the ECU end) in the signal line, will make the voltage jump as well. The only downside to using a ADC/PIC/DAC system would be that, the relationship between the input voltage, and the output voltage would rely purely on software. If your program goes wrong, or your hardware, god knows what voltage could be sent to the ECU (still 0-5V though).

The 'sensor' you speak of may in fact be 'current' based, Although in my experience, they generally output a voltage, analogue style. Either way, a 'pot' digital or otherwise would affect it. But with the above setup, you control exactly what the output voltage is.

One little solution i just thought of....what about a PIC-controlled 'sample/hold' circuit? With a fairly simple op-amp circuit, setup with a gain of 1:1, the output will be *exactly* what the input is, which is what you want. But, constantly read the input voltage with the PIC's ADC, and when it reaches your desired 'clamp voltage' send a pin high to the opamp circuit to 'hold' the output there. I'll post some links tomorrow.

All the discussion about 'noise' has confused me a bit. I realise the automotive enviroment is very noisy, as is the power line (12v) and the ground, but, we are *modifying* the sensor signal. The sensor and its signal wire can obviously cope in that enviroment without a problem, or the car would have problems. We just need to make sure we don't add any more noise to it. Put your circuit in a grounded metal box, partition digital from analogue on the PCB, and even use opto-isolators for digital -> analogue connections would probably be just dandy.

I'm full of idea's, and this post is massive already, so I'll stop now.


blueteeth.
 
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.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.
 

Attachments

  • boostmod1.JPG
    boostmod1.JPG
    25.4 KB · Views: 180
Blueteeth said:
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.

You are the man. I like these ideas. I tried the digital potentiometer idea and well it isn't fast enough to keep up with the sensor unfortunately. I am currently looking into using PWM to charge a capacitor and an op-amp to boost the signal and then do it this way. I will definately now research your ideas a little, unfortunately i am at work and cannot look at this more until i get home.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top