Turn on and off +10v -10v square wave

Thread Starter

NewStudent

Joined Feb 16, 2008
25
Does anybody have a schematic for turning on and off a square wave?

I have a continuously operating square wave +10v to -10v at 40kHz. Current draw is ~2mA.
I need to turn this on and off with +5v from a PIC 16F877.

Thanks in advance
 

hgmjr

Joined Jan 28, 2005
9,027
Digikey has an analog switch SSM2402/SSM2412 that could do the job. Price is under $7.

You will need a transistor to level translate from 5V logic control from PIC to the control level required by the device.

hgmjr
 

Thread Starter

NewStudent

Joined Feb 16, 2008
25
Thanks hgmjr

Do I understand correctly ?
I should put the analog switch SSM2402/SSM2412 in series with both the +10v and -10v lines?
+10v in on pin 6 out on pin 4
-10v in on pin 11 out on pin 13
control both switches at the same time with +5v on pins 2 and 15
 

hgmjr

Joined Jan 28, 2005
9,027
The analog switch will need to be powered by say +12V on pin 14 and -12V on pin 7 and ground on pin 1. You would then feed your +/- 10V signal into the input on pin 4 and the switched output would appear on pin 6. Your PIC control signal would feed to pin 2.

You will notice that this is a dual channel switch of which you will only require one of the available switches.

Does that make sense?

hgmjr
 

hgmjr

Joined Jan 28, 2005
9,027
As I look at it more closely, 40KHz may be a bit beyond the frqeuency range of this device. I will need to look a bit more to find a device that can handle the 40KHz squarewave which will have some harmonics that are greater than this device can pass.

An analog switch would seem to be the way to go but it may be tough to find one that can pass the 40KHz without degrading the signal.

hgmjr
 

Thread Starter

NewStudent

Joined Feb 16, 2008
25
Thanks hgmr
Yes, the connections that you suggested make sense to me. Help in locating the correct switch would be appreciated.

The 40KHz signal is originating from an external source.
 

jpanhalt

Joined Jan 18, 2008
11,087
I am assuming you want to do something like on off keying (OOK) modulation in a fairly low frequency range.

That is easy with a couple of 555 or a 556 (one sets the carrier, one modulates) and I used it in a IR system a few years ago. It is far easier to do with a microcontroller. The big difference between what I did and what your question seems to ask is that I generated both waves. Thus my LF modulator turned on and off the 40KHz generation chip. If that is what you want, let us know and I will post the schematic.


I searched on OOK and got a lot of hits, but nothing right on your question. I would approach it with a flip flop with the modulation being the enabler and the wave you need to modulate being on the data port. As an alternative, an AM modulator with settings of 0% and 100% is also supposed to work.

Here are some hits on OOK that seemed interesting, but are not really answers to what I interpret your question to be.

John

http://www.epanorama.net/wwwboard/messages/8676.html
http://www.freescale.com/files/microcontrollers/doc/app_note/AN3053.pdf
 

Thread Starter

NewStudent

Joined Feb 16, 2008
25
hgmr

Following your suggestion, I have been trying to read data sheets for CMOS Switches. What do you think of the ADG451 ?

Thanks
 

hgmjr

Joined Jan 28, 2005
9,027
hgmr

Following your suggestion, I have been trying to read data sheets for CMOS Switches. What do you think of the ADG451 ?

Thanks
The ADG451 appears to be superior to the device I suggested.

Due to the frequency response of the analog switch you will encounter some loss of squareness of the input squarewave since the input squarewave is composed of higher frequency harmonics that will be attenuated more than the 40KHz fundamental on which the input signal is based.

You will have to decide if the loss of signal fidelity is too great.

hgmjr
 

RiJoRI

Joined Aug 15, 2007
536
How about using a transistor? Let's assume an NPN with all the right characteristics. The signal goes through a resistor to the collector; the emitter is tied to -10 V, which is also relative ground for the PIC chip, which has a pin tied to the base of the transistor -- possibly through another resistor. The output is from the collector of the transistor.* The PIC will change the level of the base, turning the transistor ON or OFF, and allowing the signal to pass or "grounding" it -- actually pulling it to -10V.

--Rich

*This is a basic commom-emitter configuration.
 
Top