Close
0%
0%

Junkbox/PostApocalyptic RS-232/TTL/3V3 converter.

In which the tinkerer bodges together a serial level convertor to allow comms between boards using RS-232 5V TTL or 3.3V signal levels.....

RWRW
Similar projects worth following
If you are looking for a pretty PCB with a MAX232 on it, you're in the wrong place. This project intends to explore multiple ways of implementing the functions of a level convertor using whatever parts can be found in the parts box or pulled off junked equipment.

The post apocalyptic angle is just for fun, imagining or practicing for when you've only got a rusty nail heated on the glowing embers of civilisation to solder with and need to communicate with an old UPS by serial to change it's behaviour to work as a charging system for your scavenged solar panels. Or maybe you need to root a router to mesh network it, or mess with a GPS and/or fishfinder to go get some fresh protein.

The why is because. Okay, because I get fed up of things needing the one perfect magic part. Screw the magic part, what happens when you can't get it, what happens when it's out of stock every darn time you're ordering something else. (Seriously I'm jinxed at ordering

The basic plan is to use junkbox small signal silicon NPN transistors to implement level shifting from RS-232 to 5V TTL compatible. These may be of the type you buy by the bagful, if you pay more than 10 cents a pop for them, they're the wrong ones.  

The convertors will consist of two +/- 12-30V down to 5V level converters and two 5V logic level to +/- 12V or better RS-232 levels convertors. This will allow TX, RX, CTS, RTS lines to be implemented, which with signal ground is a 5 wire interface. Should additional signals be required, these might be able to be faked, i.e. tied high or low, or additional circuits can be added as required. The down convertor will require a logic inversion, or NOT operation on it's output as the sense of RS-232 is reversed compared to TTL. This will require a further transistor per output, or parts of a 74 series or other standard logic part. 

Now you will anticipate the problem that we need multiple voltages. I want to build this to run off a USB battery pack or adapter, for post-apocalyptic authenticity we will assume this is my solar powered 1800mAh battery, that manages 500mA output. If however you are anticipating running it off 12 or 24V solar in your personal apocalypse, you may find you will not need the first half of the voltage conversion circuit. 

I will be seriously abusing the design of the buck boost converter shown on that adafruit link. For a start, FETs, pffft, where we're going we don't need FETs... well actually they'd be convenient but the junk and spares boxes didn't yield any so I'm gonna disgrace the crap out of it by making do with a darlington pair. Yeah, they suck at high frequencies, so lets not do high frequencies, and if we don't go over about 20khz, we don't need a schottky diode either, regular boring old slow rectifier should do the trick. If however, you wanna go 12V supply, you can miss this and nail a 7805 into board to get yer 5V or do what you want for that.

Oscillator, to provide the bucks to make the boost... now here we can get really creative. We just need them wiggles. Several options, nand gate oscillator, nor gate oscillator, hex inverter oscillator, astable multivibrator in transistor or IC, or a 555 timer. I happen to have a 555 timer, and unless I decide I'd rather use an inverting buffer or a nand package to NOT the RS-232 sense I might use one of those. 

Then also a flipper of the voltage, negative volts from pos to make ze schplitten railen.

So as we see this is a just a whole soup of different circuit elements, where we can switch beef out for chicken, or onions out for leeks and still get some kind of soup at the end. 

  • Danger here be rabbitholes...

    RW12/23/2020 at 04:59 0 comments

     The research has been getting a little off track, exploring the wonders of buck boost converters on RFID tags, there's a number of fascinating papers. I also went a little deep on transistor specs, trying to figure the whys of speccing certain transistors over others. I more or less concluded what I should have suspected, popular transistors are popular because they have middling specs in their range of competence, allowing a variety of applications for minimal number of separate SKUs in the parts box. i.e. boringly average parts that were "good enough", enough hFE, enough Veb enough Vce enough Ice and a Fmax way higher than you're screwing with. However, I'm wondering if I want to take that gamble on top of someone already taking that gamble, to whit, the possible blatant lies on a probably decade old at least RadioShack pack of assorted NPNs, which claims hFE 200 Vce 30V, Ice 800mA, dissipation 1.8W ! (Seriously has anyone seen anything in a dinky little T0-92 rated at more than fractional watts?) Playing part number bingo as I rattle them round in their little plastic bubble, I recognized a real 2N2222 and a BC546 but the others may have custom or more obscure numbers. Sure the 2N2222 in a T0-92 might handle 800mA and 30V but it's only supposed to dissipate half a watt, and has a rated min hFE of 100 which is a little short of 200. The BC546 we might hope is moving the right way with a bit more at 110, but then we're similarly disappointed with the 0.5W dissipation and YIKE, 100mA collector current. Though voltage is rated at 50, so is that 100 at 50, dissipation limited, and we get like 200 at 25 or 400 at 12.5?? Well it's still short of 800 at 30. Are we to believe these are "golden sample" hand picked dies that exceed spec? I doubt it. 

    But I wonder if I wander from the point, take the junky stuff, make it work. I do have a feeling I might be swapping transistors around on the breadboard though, "You don't need to handle 800 here, you're only seeing 150, you go over here, where this little guy is sweating his ass off trying to hold  350..." Gen-you-ine junk has turned up too, a microwave front panel board with 11 identical 2SC1815s on, at least I know what they are. I guess the generic "component tester" gizmo is going to see a lot of tryouts though. 

    I went nuts for an hour turning adafruit's site inside out trying to refind this article to illustrate the simple method of turning the RS-232 the right side up again with a transistor, but as you see, it's on sparkfun, derp, 

    https://www.sparkfun.com/news/2461 

    But after continued ponderation, and the discovery of two 4011s when I turned out my baggie of junky ICs looking for 555s, it seemed like it would be nicer/neater/more-parsimoniouslyistical (unlike that word) to use half a 4011, two nands as the oscillator for the buck boost, and wire the other two as inverters... This is provided one oscillator has enough oomph to drive two converters as we need negative volts as well... in which case either we use 2 oscillators and go back to a transistor logic inverter, or an additional drive transistor. 4011s are pretty common as a bit of glue logic on various computer boards, you even see them on HDDs up to about 2005ish. So I don't THINK I'm committing the magic chip sin here. However, tomato tomato, I'm trying to detail how this is a collection of blocks, swap in another block of the same function, oscillator, and you'll get the desired result. 555 or astable multivibrator, other logic oscillators, even 741s and other op amps can be made to squeal (If you poke them just right with a hot soldering iron! muhuhahahaaa) actually, audio engineers and RF bods are often trying to get rid of unwanted oscillation so if it intimidates you, just think of it as a fault you're causing to happen. I did in fact regard a nand oscillator as an anomaly until recently, like...

    Read more »

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates