# Gets strange voltage levels when converting 12V square wave to 5V

Hi!

I am passing a 12V square wave into a 2n7000 to convert it to a 5V signal (se attached picture).

The problem is that the output voltage level is not 0-5V but instead -0,2V to 5,4V. The error increase with frequency.
With a low frequency it looks ok but with 77Khz I get the above error.

The negative voltage is the worst thing for me because I want to feed the signal to a op-amp to be able to adjust the voltage to 0-10V (with no negative voltage).

The setup is on a breadboard where I have other components using 12V, 5V and -5V (op-amp). All GND is connected on the breadboard.
I have measured the 5V rail and it is exactly 5V. I use a bench power supply for 12V and 5V and a ICL7660 IC to produce -5V.

/Olof

Hi, connect the gnd of the CRO directly to the Source of the FET, connect the input of the CRO directy to the Drain of the FET and see what comes to light. Check the DC supply voltages with your CRO and compare them with the DMM. [u]MAKE SURE THE CRO IS IN DC MODE NOT AC.[/u]

Tom...... :)

Hi Tom.

Don't forget to translate CRO to Cathode Ray Oscilloscope for the non-Aussies (though the other instructions imply you're talking about an oscilloscope). And they could dump the CR part in that nowadays. :P

olof_n: The problem is that the output voltage level is not 0-5V but instead -0,2V to 5,4V. The error increase with frequency. With a low frequency it looks ok but with 77Khz I get the above error.

Using x10 probe? It needs the trimmer cap adjusting, that's all...

I had to google CRO :) The result was the same, the voltage level did not change.

Yes I am using a 10x probe. So I can use ignore the negative voltage? I measured the signal with my multimeter and got 2,503, If that is half the voltage maybe all is fine?

I have a Rigol ds1052e, will check the manual about adjusting the trimmer cap.

I connected the probe to the reference signal on my oscilloscope and changed to 10X in the channel menu. The square wave was perfect so maybe the problem is not in the probe anyway.

Well make sure you are getting the same amplitude of edge at all timescales...

Hi, can you post a screen shot of the scope trace thanks. I'd agree that it is not a big problem and your following amp will probably sort things out. Tom.. :)

I took a screen shot of the trace.

scope.bmp (219 KB)

I soldered all components on a protoboard and the problem disappeared?!

The problem came back on the protoboard? Hmmm

/Olof

The image I posted was wrong.
The pulldown resistor is actually a pull up resistor. I misread the datasheet, the 600ohm impedance is just for the sine/tri output and not for the square wave output which is open collector.

I noticed something, If I place a 1K pulldown resistor after the pullup resistor I get a output voltage of +80mV to 5V.

Why is that? Should I use a trimpot and adjust the pulldown resistor until I get a nice 0-5V?

MAS3: Hi Tom.

Don't forget to translate CRO to Cathode Ray Oscilloscope for the non-Aussies (though the other instructions imply you're talking about an oscilloscope). And they could dump the CR part in that nowadays. :P

Us Yankees know what a CRO is. We even know what a DSO is! :)

[soapbox] Hi, damn digital virtual world CRO's, I would say if I looked at that trace on a good CRO (analog) I would possibly see 0V to 5.0V. Why because that is what is being produced, look at the digital trace, it is 0V to 5.0V. Its that damn statistical box that is telling you max and min. The max may have occurred for a poffteeenth of a milisecond, not for all the top of the waveform. The min may have occurred for a poffteeenth of a milisecond, not for all the base of the waveform. [/soapbox] The stat box says that the trace is 360mV over 5V, thats 1/3 Volt, show me. the top and base lines are thick as .25V for a start. The max and min that have been "measured" are glitches / overshoots usual when observing non-sinusoidal wave forms.

(Does the act of observing a phenomenon affect the phenmenon, hence distort the observation, big question)

Tom.. hmmm soapbox felt good...... :)

Thanks Tom again!

So I can just ignore the whole thing? I was afraid to damage the microcontroller if I fead the signal to its input.