DC voltage converted to square wave?

Thread Starter

Eurokid

Joined May 7, 2011
2
I have a pressure switch that puts out 0 to 5 VDC. I need to convert this signal to a square wave but I'm not sure how to go about doing it. Do I have to convert it to AC then to a square wave? or can i go from DC to square wave? I recently developed a interest in electronics so my knowledge of the subject is limited. Any help would be great.
 

Jaguarjoe

Joined Apr 7, 2010
767
What is the frequency range that you need? You may be able to program a cheap microcontroller to do what you need. Search for Arduino, they might have an existing design/program that does what you need. There are also IC's that convert voltage to frequency, I think National Semiconductor makes one.

http://www.national.com/ds/LM/LM231.pdf
 
Last edited:

wmodavis

Joined Oct 23, 2010
739
Does the 0-5V vary in an analog fashion from zero to five volts or is it either 0 volts or 5 volts as suggested by your use of the term 'switch'? If it is in fact a pressure switch it should easily provide a square wavepretty much directly. A little more information on the functionality you want/need would be helpful in order to give you some helpful direction.
 

Jaguarjoe

Joined Apr 7, 2010
767
You are not making square waves. You are generating a PWM (pulse width modulation) signal. The duty cycle of a square wave is fixed at 50%.
This chip will generate a fixed frequency 0-100% variable duty cycle signal from a 0-5 volt input:

http://www.maxim-ic.com/app-notes/index.mvp/id/4502

You will need to massage the 0-5v input to limit the PWM output to your desired range of 50-90%. As shown, it runs at 500Hz. That can be changed by choosing different R's and C's.

You can get free samples of this chip from Maxim.
 

DerStrom8

Joined Feb 20, 2011
2,390
You could probably just use a 555 timer in astable mode, couldn't you? It would be a lot simpler. I can post a simple PWM circuit, if you're interested.
Der Strom
 

DerStrom8

Joined Feb 20, 2011
2,390
Hi Jessica,

As pointed out, this thread is quite old. However, seeing as this is still on-topic I will go ahead and post it.

Here is the PWM circuit I generally use. It is based around a 555 timer and a 393 comparator:



The specifics are on this page:

http://www.rmcybernetics.com/projects/DIY_Devices/homemade_pulse_controller.htm

It is possible to create a PWM circuit with just one 555 timer, but it is much less accurate, and the frequency and duty cycle are not adjustable independently. I have found this circuit to be far superior.

Hope this helps!
Regards,
Matt
 
It does help, it does... except I figured out the problem in my original design---<snip> misconnected wire. TT

Thank-you so much for restoring my faith in the 555 timer. All roads lead to... well, this design.

Edit: deleted expletive.
 
Last edited by a moderator:

DerStrom8

Joined Feb 20, 2011
2,390
It does help, it does... except I figured out the problem in my original design---******* misconnected wire. TT

Thank-you so much for restoring my faith in the 555 timer. All roads lead to... well, this design.
Please watch your language, we're a family-friendly site here.
 
Top