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.

RS232 level shifting power consumption

Status
Not open for further replies.

upand_at_them

Active Member
I'm thinking about using transistors (2N3904) in my application for level shifting the RS232 signals instead of using a MAX232. Much the same way a BASIC Stamp does it.

Is either one inherently more power hungry than the other? Can the transistor method be made to consume less power than a MAX232?

The reason for considering this is cost and my PIC application will most likely be run at 3V. And I also want to have a choice of two serial connections to it: 1) TTL level signals from another PIC or a GPS, and 2) my PC or laptop.

Mike
 
Hi Mike

don't know the BASIC STAMP but with the MAX232 chip, it generates the higher positive and negative voltages required to produce RS232 levels, approximately +/- 8v and it does this using a charge pump system which is inherently noisy. If you already have available the higher + and - supplies to drive the nominal 5K resistance at the receive end, then this is the way to go and use transistors or FETs for the translation.

It's worth noting that the max232 works on a 5v supply, I think the MAX3232
may work at a lower voltage

Best of Luck

Ed
 
Mike,

You might consider using a pair of 2N7000 or BS170 MOSFETs... They use practically no power and work extremely well with those otherwise troublesome low-voltage PC/Laptop ports... They're also open-drain and will "pull-up" to whatever voltage you want (within reason, grin)...

Here's the circuit I use -- two 2N7000's and two resistors... I've used it without problem on many different PCs and laptops with baud rates up to 115,200 baud... While the circuit as drawn shows a resistor on the PIC board and two transistors and a resistor built into a DB9F shell with 3.5mm stereo plug and jack connections, all four components can easily be installed on the PIC board along with a DB9F connector...

Regards, Mike
 

Attachments

  • ttl-232_convertor.jpg
    ttl-232_convertor.jpg
    30.6 KB · Views: 2,423
Hi Mike,

Yes, you need the "pull up" connection to pin 7 (or pin 4) on the DB9 connector... This pulls up the open drain output to the positive RS-232 signal level (anywhere from 5 or 6 volts to 12 volts, depending on the PC UART)...

Good luck... Regards, Mike

<added> here's another example of that TTL-232 circuit but with all four components on the PIC board...
 

Attachments

  • ppp-88__3.jpg
    ppp-88__3.jpg
    80.3 KB · Views: 1,719
BTW, if you disconnect that 2K7 resistor from pin 7 on the DB9F connector and connect it to VDD (3v or 5v), you have your 3v or 5v TTL level connection to another PIC or the GPS...

Best regards, Mike
 
upand_at_them said:
I'm thinking about using transistors (2N3904) in my application for level shifting the RS232 signals instead of using a MAX232. Much the same way a BASIC Stamp does it.

Is either one inherently more power hungry than the other? Can the transistor method be made to consume less power than a MAX232?
Mike

Some 232 chips are more power hungry than others! Check the spec sheets.

Now some have a shutdown pin to put them in sleep mode, but there's also the MAX3232 which has an auto-shutdown mode so it doesn't consume power when there's no signal. It's pin-compatible with the MAX232.
 
Mike said:
BTW, if you disconnect that 2K7 resistor from pin 7 on the DB9F connector and connect it to VDD (3v or 5v), you have your 3v or 5v TTL level connection to another PIC or the GPS...

Best regards, Mike

I tried this way with my PC and it worked. Would using this with a PIC require another inverter stage?

Mike
 
upand_at_them said:
Mike said:
BTW, if you disconnect that 2K7 resistor from pin 7 on the DB9F connector and connect it to VDD (3v or 5v), you have your 3v or 5v TTL level connection to another PIC or the GPS...

Best regards, Mike

I tried this way with my PC and it worked. Would using this with a PIC require another inverter stage?

Mike

Only if you use the hardware USART, if you use a software UART you can do the inversion in the software.
 
Oznog said:
Now some have a shutdown pin to put them in sleep mode, but there's also the MAX3232 which has an auto-shutdown mode so it doesn't consume power when there's no signal. It's pin-compatible with the MAX232.

Thanks Oz. I have one of those auto shutdown devices, a MAX3221. My problem is that I wanted to have all the interface circuitry on the PIC board and have two separate serial connections using the same UART port, one connector for the PC and one for another PIC.

But having a MAX device on the board would keep it active even when data was being sent out the other serial connection, because the lines would be active. The great thing about the MOSFET solution is that no power will be used if that MOSFET isn't connected to the PC.

Mike
 
Can you tell us, what other peripherals do you use in your project? Maybe you are trying to save power at wrong place.
 
I tried this way with my PC and it worked. Would using this with a PIC require another inverter stage?

You could wire up the PICs to each other directly but if you want that dual port capability you'll want to use that 2 transistor convertor on each PIC... The 2N7000 drains can be connected together "wired-OR" as shown below on the PIC board with the dual ports...

So is this kinda what you're lookin' for? Top circuit for RS-232 levels and the bottom circuit for TTL levels... Duplicate the bottom circuit on the other PIC... Choice of one or the other interface on the dual port board but not both...

Regards, Mike
 

Attachments

  • 2n7000_dual.jpg
    2n7000_dual.jpg
    39.8 KB · Views: 1,291
Yes Sir... That will work too...

<added>

As long as you're connecting 'direct' to the other PIC (no inverting/level shifting circuitry on the other PIC)... And you'll "cross-over" the signals between PICs (TX to RX and RX to TX between PIC boards)...

Have fun... Regards, Mike
 
Mike,

I just realized you could get away with installing a single 3.5mm stereo jack on your PIC board and simply plug in the TTL-232 convertor cable (with the circuitry inside the DB9 shell) to connect to the PC or plug in a straight through 3.5mm male to 3.5mm male molded cable to connect to the other PIC board... The other PIC board would have it's 3.5mm jack wired with the TX and RX signals reversed... Gosh, you could get away with a very nice clean design...

Here's a picture of one of my boards with a 3.5mm stereo jack installed for the RS-232 connection and one of those TTL-232 convertors...

Regards, Mike
 

Attachments

  • 2n7000_rs232_interface_1.jpg
    2n7000_rs232_interface_1.jpg
    27.4 KB · Views: 486
Mike,

Those little TTL-232 convertors in a DB9 shell are so handy I use them on many projects... Here's a Unipolor Stepper Motor test board I put together in March... Adding RS-232 capability to the board was simply a matter of installing a 3.5mm stereo jack and a resistor on the board --- and connecting the board to the PC using a TTL-232 cable...

Regards, Mike
 

Attachments

  • stepper_board.jpg
    stepper_board.jpg
    53.6 KB · Views: 465
Yes, it does look very handy. I'll definitely make a few of these for my own use.

The device I'm creating, however, is going to be used by others and I'm trying to make it sort of dummy proof. That's why I was trying to put everything on the PIC board. Two choices: "Put your PIC connection here" or "Put your PC connection here." Dongles tend to get lost. Not by me of course. :D

Mike
 
Mike,

How did you arrive at the pullup value? I'm using 2K and it works, but I was curious since 2K7 seems an odd value (for me at least).

Mike
 
Status
Not open for further replies.

Latest threads

Back
Top