Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I have an audio sine signal -300mv to +300mv (600mv p-p), and I would like to read it using a microcontroller. I want to get rid of the negative half of the sine signal. How can I clip it?

I do not want to use a voltage divider to add DC bias to the signal because it may not be stable due to the power supply noise.

Also, the microcontroller accepts -0.5 to 6v on each pin. But is it OK to apply that signal for a reliable project forever.

share|improve this question
    
Instead of clamping the signal you could you delta sigma ADC to read the signal. The readings would be much accurate. –  Chetan Bhargava Dec 24 '12 at 21:08
    
If you're worried about power-supply noise getting into the DC bias from a voltage-divider, why not use a precision voltage reference? –  Connor Wolf Dec 26 '12 at 22:24
add comment

3 Answers

There are OpAmp circuits called precision clamp (or precision rectifier, or precision diode).

enter image description here (source)

Regarding the long term reliability. (The 2nd question in the O.P.)
If you current-limit the input to the microcontroller with a resistor, you could apply -0.3V to the pin for a prolonged time without permanent damage. Inportantly, the absolute maximum ratings are only about permanent damage, and not about performance. You may or may not get good A/D performance. Test it.

share|improve this answer
    
This circuit requires positive and negative supply voltages. I have only +5 voltage. I know I can use LM258 single-voltage but would the signal be distorted? –  yasserbn Dec 24 '12 at 21:36
add comment

If you only have a single supply you can shift the signal before you rectify it, using something like the following circuit:

Rectify Shift

Simulation

Rectify Shift Simulation

You can change the Vref (a precision reference IC would be good here) and gain to suit your ADC input, and alter resistor values according to your source impedance, desired power draw, etc.

share|improve this answer
    
What software did you use to run the simulation? I don't recognize it. –  Gustavo Litovsky Dec 26 '12 at 22:24
    
It's LTSpice, an excellent free SPICE simulator from Linear Technology. –  Oli Glaser Dec 26 '12 at 22:51
add comment

You can AC couple the signal in and provide a working DC bias at mid-rail after the cap using resistors. the main problem with this approach will be that at the different frequencies your capacitor impedance will vary quite a lot. so this may not be the best solution.

share|improve this answer
    
I do not want to add DC bias using resistors. My power supply has a noise (100mv p-p) after filtering. I am looking for other approach. –  yasserbn Dec 24 '12 at 21:09
1  
what makes you think that you're not seeing that noise on the ADC itself.? –  placeholder Dec 24 '12 at 21:11
    
Maybe the ADC has a band gap reference which reduces the problem? –  jippie Dec 24 '12 at 21:17
    
@rawbrawb: I am not using the ADC, I use the comparator to measure the frequency. –  yasserbn Dec 24 '12 at 21:22
1  
bandgaps are REFERENCES not REGULATORS, there is a difference. THere are many different ways in which this may or may not help. I'm just saying there the OP is making assumptions that may not be valid unless he designed the chip itself. I'd say he should test it first. It may NOT work, but it may also improve his results. –  placeholder Dec 24 '12 at 21:22
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.