Archive for February, 2024

Poly88 keyboard lid / GRI keyboard spacebar stabilizer

February 26, 2024

I modeled the lid for the poly88 keyboard (the one without the numpad). There were two variants and I have this one so I have the aluminum modeled for anyone missing theirs.

The original 0.090″ aluminum panel had studs pressed in to the inside where I have holes. Mine had three of those 4 snap off so I thought I’d put some holes and chamfer them for countersunk bolts. The originals are 6-32 and that material is just barely not quite enough to accommodate that chamfer, but I think it’ll be alright as an assembly technique.

That being said, sesndcutsend will press in studs to that material for a very reasonable price, and the whole thing assembled comes to just over $50 before shipping. I have the design up on github here even though I have not ordered that part and don’t need to since my keyboard is complete-ish. At least the enclosure is.

Between the time I posted this about building up a GRI 753K keyboard and now one came up for sale on ebay. Sadly it went for more than I wanted to pay, but I managed to snag some pictures of it so I had a little better idea of how to build the elusive spacebar stabilizer.

This is pretty good, it validates some assumptions from the original design but also shows me a problem with my parts on hand.

That’s not the same spacebar. Sure, it fits the cross shaped keyswitch, but it is not the original spacebar. Even if I had the original hardware it probably wouldn’t fit so I have to make my own anyway.

The design is pretty simple, but there are no dimensions and I can’t take this for a scale drawing anyway no matter how nice it looks. But I can get some inspiration. In order to use the hardware I had however I drilled out the holes in the board from 1.3mm to 2mm to fit some M2 bolts. From there I designed this:

Now this is a second revision that doesn’t fit so tight around the rod because the original one snapped from repeated insertion and removal. With this in place I could take a stab at the spacebar brackets.

This is what I came up with. Notice that I didn’t do the entirely captured version that seemed to be on the original design. These are somewhat based on the more modern cherry stabilizer brackets seen in this video on them

Now for the bar. This was the hardest part because the closest thing I found was some 3/32″ copper tubing and I bent/squished it with some round profile jewelry pliers. Having to keep the different parts of that colinear and parallel to each other is very fiddly and I could probably take another whack at it but this seems to actually work so I’m not going to jinx it.

That’s it. The design and iterations took about 4-6 hours total and now I have a working spacebar that kinda has an even amount of forcer across it and does push the switch and spring back no matter where you press it. I have the files up on github here if you want to see what I did, but I highly doubt these exact files will be useful for anyone else.

Ribbon to wire wrap pin adapter PCB

February 23, 2024

As part of an upcoming project I needed to connect to some wirewrap pins. These are on the back of a nice cardcage with a load of edge connectors.

The original connector that I am replacing was somewhat special, here have a look:

This is what remains of an IDC (insulation displacement connector) that spanned this 0.2″ gap between the pins. IDC connectors are basically connectors that push the insulation out of the way to get to the wire inside, you crimp them on through wire and they make contact. What I mean in this case is something like an IDE connector, it adapts a ribbon to some 0.1″ header pins. The difference here is the spacing between the long rows is not 0.1″, it’s 0.2″ which is very strange to me. Maybe this was common back in the day, but I’ve never seen a connector like this before.

If you look closely you can see these pins are sticking straight out of a card edge connector. An interesting thing about that is they are so long. I called them wirewrap pins above and I think that’s the case. I think the manufacturer designed these square profile pins to be used with wirewrap to connect them. They have very sharp corners so when you wrap the wire around them they ‘weld’ on the corners to make a solid connection (I’m not super familiar with the process). If you look closely you may also notice these connectors are press-fit into the PCB and the sharp corners bite right into the plated holes to make the connection. That means tracing out the connection is pretty hard since the connector is mounted flush on the top with no stand off to look under.

This is a schematic / wiring diagram showing where the connector interfaces with the backplane (bottom left rectangle). This backplane is somewhat interesting in that the connections do not go straight across. There is an ongoing effort to document as many variations of this backplane as we can find (so far at least one real one and one that we only have the schematic for). This connector takes about 18 signals and power from the backplane and sends it to another module. Since I can’t get that connector (and honestly even if I could this is cheaper) I designed a little interposer board to adapt it.

You can assemble it four ways, based on which orientation you place each header and how you plug in the ribbon. 0.1″ pin header fits right on these pins, just like the original IDC connector did. The spacing is such to warrant our own connector though, 0.2″ instead of the more standard narrow DIP IC spanning 0.3″. The board is almost the simplest design you can imagine, 50 pins that adapt to 50 other pins 1:1. This board is sponsored by PCBWay, but you wouldn’t know it by looking at it. It is so small I couldn’t cram anything else on the silkscreen other than what it is and where to find more information on it. When you order boards from PCBWay they usually add a small unobtrusive number somewhere on it for tracability reasons which is good, but this board is so packed they couldn’t fit that anywhere on it. That’s fine because being so simple there’s no way it’s anything other than perfect and you can tell just by looking at it.

I don’t know which orientation is correct yet, but there are parts incoming that will hopefully be keyed on one end and the layout diagram will help on the other. Originally it didn’t matter what the pinout was because the intention was to build something DIY such that the other end can be built to suit. Recently a real button / power box came up so this is in the mail:

Using the diagrams we’ve uncovered we could assemble our own, but this one from ebay is on the way. You may be thinking “breadboard spanning ribbon adapters exist for the raspberry pi, why not use those?” The answer is twofold, first we need 50 pins to pick up all the signals needed on these pins (the pi is either 26 pins or 40 pins depending on the revision), and second:

Breadboard span spacing is 0.3″ because that’s what narrow package DIP chips are, this is something special.

The documentation for the card cage and reverse engineering of this system is on github here, and this adapter board specifically is here. You can buy these at PCBWay if you want (do it unassembled please, until I know the orientation) here, more details are coming on this reassembly project for the cyberamic control system.

Exidy Sorcerer EPROM Programmer

February 19, 2024

This will be a quick one, I didn’t build this one and I don’t have any software that uses it. I did reproduce it in CAD and work out in theory how it would operate though.

I was inspired to take this on by another post from Michael Borthwick. There was an EPROM programmer available as third party content for the Exidy Sorcerer. I didn’t have anything to go on except these pictures at first.

This is my educated guess at the placement and layout of the original board. I made some changes like adding silkscreen, making it double sided , and as a result that resistor now has a second pad on the board. The switch is also different because it’s not my intention to make this super hard to reproduce.

This is also a best guess, but I think it will work. I traced the lines I could see and in shadow I looked at what the resulting schematic would end up being and made some educated guesses. I also labeled the parallel port pins and where they go so if anyone has the software they can check it, or if not they can write some.

This is what I’ve got, let’s go through it one bit at a time. The optoisolator was obvious from the package, the part number I guessed at, but it ought to work. What it’s doing is switching the high voltage programming voltage to the Vpp pin on the EPROM. The signal comes from bit 4 on the output port and cannot be activated unless the hardware switch is enabled. It is active low so bit 4 sinks current through the optoisolator while the hardware write protect toggle sources it. On the output of the optoisolator the programming voltage (labeled 9v) is switched, but through a series red LED dropping the voltage by a couple volts. On the output is Vpp, but we also have the same power controlled by the hardware switch piped to Vpp through a diode. This seems to let the Vpp pin rest at 5v until the Out4 bit commands it up to programming voltage. The switched power also powers the EPROM and the LS164.

The LS164 works, but in a limited fashion. We do not have access to DSB or /MR, but from the timing diagram we can see we don’t really need them. DSB high enables the shift register at all times and we are unable to clear it but we can keep shifting things out to make sure we have 8 good bits in there. With most of the other output bits used to directly control the remainder of the EPROM pins, how do we actually clock things in to the 164? the serial data bit is hooked to an input port bit? This is the particularly clever part.

This is the function table of the LS299. Let me simplify things a bit. The first column, labeled /CLR is the same as ~MR on our chip, and is pulled high when the toggle is flipped. That means that before it is low and the switch flip is a high going transition on that pin. We can therefore ignore the first three rows as we are not operating in that mode. The column for output control is always pulled low, both of those pins, so the outputs are always enabled. S1 is pulled high all the time so we are always shifting left, or loading (depending on the state of S0, the Out6 bit). Ds0 is the same as SR which is pulled low, but that seems to just be to keep the input from floating, when S1 is high, SR does not matter.

Those are all the states we can switch between and I crossed out the unused output. We control CLK, S0, and SL. Qa` goes to input bit 7 and the input of the address shift register (the 164 we talked about above), and the bidirectional data bus goes to the EPROM’s data bus. Here’s how I read the order of operations for shifting data in.

  • SL (output bit 0) sets the bit you want to shift in
  • S0 (output bit 6) is set low to tell us we are shifting
  • CLK is pulsed (high going pulse) to shift the bit from SL in
  • This is repeated until all 8 bits are filled
  • From here the bits will begin shifting out into the address shift register
  • Continue shifting bits through the 299 and into the 164
  • CP (output bit 7) clocks data into the 164 when it is present on the output of the 299
  • Once the 164 is filled up and the 299 is also filled up you now have data present on all the address and data lines of the EPROM
  • You can now write the data into the EPROM with Vpp and the EPROM control lines
  • repeat, shifting through the 299 and into the 164 to get to the next address and following up with data to be written
  • note: Out0 does double duty as a control line of the EPROM, but as long as you don’t clock the 299 it can do whatever and not affect things

This works using the available pins and has a very clever method of keeping the chip count down. I would have expected to add a second 164 to free up Out2 and Out3 and then using one of those to have a second serial shift path in to the 164 without having to go through the 299. Now we can write the chip, but how do we verify that it was written correctly?

  • clock address bits as shown above
  • set EPROM to output data using control lines
  • flip SL high and clock the 299 to load all the data from the bus into the shift register
  • un-set control lines on EPROM
  • flip SL low and clock out the data one bit at a time
  • instead of sending it into the 164, read it into the sorcerer on input bit 7
  • repeat, shifting through the 299 and into the 164 to get to the next address

This is a rather convoluted way of doing things, but it manages to be done in essentially two logic chips with 8 bits of output available and it only uses one bit of input. Based on the pinout of the EPROM I determined it must be a 2716 and then I found this in a Sorcerer magazine:

In this case M means machine code and H means hardware, so the program for reading or writing EPROMs did not require the Basic PAC. I can also see I was right that it was designed to program 2716 chips. But what about that programming voltage? That screenshot came from a 1982 edition of Sorcerer’s Apprentice, so what are the specs of the 1982 vintage 2716 chips?

This comes form the 1982 Intel databook and shows a programming voltage of 25v. Might it work with a little less? sure. Would it work with 9v? I really doubt it. We also have that LED ins series dropping some voltage so we need closer to 27v to feed into those 9v battery terminals, but how do we get 27 volts into there?

There, I give you 27 volts made of three 9v batteries, which also may be made of a total of 18 AAAA batteries. This is kinda nuts and you might think it won’t work, but look at the picture from the tweet again. The 9v battery snap only has the positive wire connected. I don’t think that is unintentional. I think that the ground lead used to be hooked to a separate 9v battery snap that hooked to the other side of this sort of tower of batteries. I’m making stuff up at this point, but that’s the way I would have done it, especially in 1982.

My github repo with the board designs is located here, but I never had this board made. If someone has the software to use with it I would love to test it just to prove out the design, but I don’t think this is a very practical thing to build in 2024.

TTL to composite video interface

February 17, 2024

I thought I posted about this before, but I guess not. In an effort to make up for having two *and a half* northstar advantages I wanted to have some solution for the video that the third one is missing. To that end I initially looked at the Mac SE video converter that uses a pi pico to read the video signals from a mac and turn it into VGA. Theoretically this project is similar, it just has different timings. I started down that path but when I realized the project was mostly one of software hacking I quickly looked for another solution.

Enter the zrt80 and its simple composite generation circuit. I did some reverse engineering and repair of this back in 2020 and during that ordeal I remembered that it has a nice simple example of a composite generation circuit. Being a 5v logic based device I decided to investigate the circuit to see how the stages leading up to the combination differed from the advantage.

This is the ZRT80’s video circuit. starting from the end we can see composite video is made by the 2n2222 transistor and the 75 ohm output impedance is achieved by the 75 ohm resistor so that’s good. That all makes sense for standard video. The transistor is driven by two resistors of different values, meaning that the effect that each of those signals will have on the resulting signal will be at different levels. Going into those resistors are some inverter gates so we know that’s getting a 5v logic signal. Technically TTL logic gates are a lot better at pulling down than up, so if we use the same 74-series gates that this design uses we’ll be closer to the intended voltages than if we use 4000-series CMOS gates.

At this point anything we do that has a TTL output into each of these resistors will give the right voltages, but what signals do we need? The bottom chain has two inverters fed by something, but they also feed a XOR gate with a switch on the other input that has an output labeled video out. I thought composite was our video out? Well it is, but this board can output a different video standard for different monitors. Looking above we have a single inverter that feeds our composite out but it also feeds that XOR gate and the output is labeled composite sync. From this it looks like we can drive a composite monitor or one with a separate composite sync and video signal. The video signal is what you would expect, it contains the pixel data for the screen, but the composite sync tells the monitor when it is done with a horizontal line or a vertical frame (one whole image). Feeding that composite sync we can see that horizontal sync and vertical sync are XORed together to generate that composite sync.

In this case the horizontal and vertical sync come straight off the CRTC video generation chip, but will this exact circuit always work? Those XOR gates with the switches are interesting, what do they do? They are effectively used as selectable inverters. If the input with the switch is high, the output is the inverted state of the other input. If the switch forces its input low then the output is exactly the same as the other input. This is because the output is high when only one input is high, exclusively, so not when both are high (and like any other OR gate, not when both are low). Those switches are because different monitors want different polarity video and composite sync signals. We can use this technique later.

This is the video output section of the Northstar Advantage. These schematics came from a guy who has actual paper manuals for the northstar advantage 8/16 (the motherboard I think is needed to support the northnet server card) and I have uploaded these nice, legible scans to the internet archive. Looking at the right side for now we see the video connector. 12v power, ground, video, negative logic horizontal sync and negative logic vertical sync. Feeding into that however we see three more of those XOR gates set up as selectable inverters. It looks like the northstar advantage motherboard was made flexible enough to allow for different monitors to be installed without changes to the board except for a couple jumpers.

How is the video on the advantage being generated though? Well this schematic I grabbed from an apple 2e to show how standard some of these techniques are. Here you can see the same LS166 shift register hooked directly to a ROM where a whole byte can be shifted in and then clocked out one pixel at a time. The Advantage still uses a 166, but it is a lot more sophisticated. Instead of pulling from a fixed character ROM it pulls from a bank of RAM. This display ram can be filled with arbitrary data that means you can address every single pixel on the screen. The older apple design is set up to just show specific sequences out of the ROM it came with.

I showed how the video was generated, but how about the horizontal and vertical clocks? Well, on the Advantage that is done with the timing PROMs. Basically there are high speed ROMs that operate as fast as logic circuits so rather than having a big arrangement of OR and AND and other gates, these PROMS output a specific set of bits as an output for a specific set of bits as input. It’s a pre-computed logic table. This particular computer syncs the screen refresh rate to the frequency of the voltage coming in to minimize flicker on the CRT and that means there are 50hz and 60hz timing PROMs for it.

Each PROM, or set of PROMs will generate a waveform like the one shown above. This has a lot of implications for memory cycles, RAM access, but also the horizontal or vertical sync timing. Helpfully the PROMS are all detailed in the technical manual so you can recreate them if you have a bad one (that’s where these pictures came from). Unhelpfully all the PROMs I had in my machines differed from the ones in the manuals. I figure they made some changes between when the manuals were printed and when the machines went out for final production. I have the real PROMs archived as well, but I haven’t done a deep analysis except to check that they are all at least a little different.

With complete control of the CRT’s horizontal sync and vertical sync you can drive the tube at a range of frequencies and it will obey the commands to move the beam to the next line or move it back to the top of the screen. The sync information is literally driving analog circuitry in the monitor to steer the beam around and if the components in the monitor can work at different speeds, then you can have timings that are not quite the same as NTSC composite video. This is the sort of monitor the ZRT-80 could connect to all the way back up at the top, one with separate sync and video inputs. The essential information here is that I could edit these PROMs to be more exactly NTSC video timings, but if this is close enough I won’t have to muck with the other aspects of the RAM timing and such.

This is my generic polarity selectable TTL logic to composite video generator. I based the circuit off the one in the ZRT-80 but I made each input individually polarity selectable like the advantage has on its outputs. That makes this design fairly generic and able to be used on a variety of computers to replace monitors that may have failed or video outputs that did not fir the composite video voltage levels. You could even hook this up to a raspberry pi pico or an FPGA and use it to generate a good solid composite signal as long as your video timings were correct.

I made one on some protoboard to test, especially because I wasn’t completely sure the polarities I needed for my advantage (the rest of the manual is detailed, but questionably accurate at this point). By using this I determined experimentally the right settings and produced a board design.

And here is the board. This project was sponsored by PCBWay and as usual everything turned out great. The silkscreen is nice and crisp, the corners are rounded and smooth, everything worked alright. I think for my next rounds of boards I will start rotating through their soldermask colors because while I’m impatient and green is usually faster, I don’t always end up getting to these projects right away anyway and having some other colors around sounds cool.

There’s available inverters if you want to use the spares for something, but I tie the inputs to ground. Because TTL chips pull down with a transistor, but the outputs just float high with a resistor having the outputs go high burns less power when they’re unused. My little board also has a 7805 regulator because the video connector for the advantage monitor only exposes 12v to power it so I can use that and make 5v myself on the board. It’s a TO220 instead of the 78L05 or something else because these are more readily available as salvage and I have a bunch to use up. You may also notice, if you’re not colorblind, that I don’t always use the exact resistors called out. In this case I called out 4.7k resistors as pull ups, but I used 3.9k resistors. I did that because the additional current draw is negligible, but also I had them in large quantities and for pull ups they work fine. In my case, building one configuration that I will never change the polarity on I didn’t need pull ups, I could have just tied each input high or low and saved a little current in resistor dissipation.

I have a pass-through pin header so I can plug this into an advantage and have the original monitor also plugged in if it has one.

There you go, it’s not perfect, but it works pretty darn well for something that’s not even supposed to support composite video out.

There’s a little silkscreen explanation on it for my use, and some lines to indicate how to use the inverters (which input go to which output). I have the board up on PCBWay if you want one for yourself. Or you can go check it out on my github if you want to make some changes to optimize it for your use case. I know I didn’t make it super compact or low chip count, this just uses what I had to be as generic as possible.

Exidy Sorcerer Sound ‘Card’

February 15, 2024

I’m going to start with my documentation of work done on the exidy sorcerer with something easy, a parallel sound ‘card’. This device is something that’s period correct (it was available at the time by magazine order) and there is extant software to use with it. If you’re familiar with the Covox Speech Thing for PC parallel ports, it’s kinda like that.

This is the original Howard Arrington sound card found and reproduced by Michael Borthwick. This guy has been doing some excellent work in the area of Sorcerer preservation and recreation.

I met a guy at VCFMW in 2022 That had one of these recreations and I took note of the board design differences between the original and this one with a switch for ‘music or game’ mode. So I decided to do my own version of this project.

This is my variation of this project, I rounded the corners, added a small switch that is not in the 3d render for kicad properly, and changed the connectors to things I find easier to use (right angle connectors, and a headphone jack so you don’t need an adapter to some powered speakers). This was cool and all, but there was something bugging me.

Here’s the schematic for the sound card. It’s very very simple in that it uses a TTL inverter to drive a resistor ladder made of mostly R-2R math to make it function. There’s a little bit of dc blocking and level conversion for the output, but there’s not much else to it. It turns out that ‘game’ switch changed the most significant bit of the DAC from bit 7 to bit 0 of the parallel port (seen in the technical manual here. It appears that the music program uses a whole byte of parallel data, but the games only use one bit for sound. That makes sense since these things are all aftermarket and support for the third party peripherals would vary in software. The bodge wire that was done to the original design allowed for it to be used with games that would never originally work with it. Now why would a program that uses the whole 8 bit port only use the upper 6 bits and not even connect the lower two? It looks to be a limitation of how many gates are on the chip.

Well, it appears the software folks made use of all of it and the hardware folks cost reduced it for mass consumption. But with 5% resistors would it even benefit from the least significant two bits?

Python to the rescue! With Frank’s help we plotted the voltage at the output for a 6-bit setup (ideal 6-bit values) and then we plotted the range of values we could get if we had all 8 bits of data but they were all at the max or min of that 5% range. What we found was that for certain values near the high end we could certainly tell that there was not a full 8 bits of resolution and you would be able to hear it. I can see why they wouldn’t bother for a device made of parts with ’70s or ’80s pricetags, but with modern stuff we can double the chip count and not really care. That being said, if you use 1% resistors (like most 0603 resistors are these days) then the range where you can be sure to hear a difference from the 8-bit sound is the entire range. The schematic can just be extended with two more gates driving the mixed audio rail through two more resistors.

[EDIT] The original does seem to use 1% resistors, just not in the non-sound parts. So the 8-bits would even have helped back in the day.

Here’s my condensed surface mount version of the sound card. The resistor values are fairly obvious, you just continue out the parts in the chain of doubling. Above ~80k we get ~160k and then ~330k as in the python script. With those bits populated you could actually leave the switch in the music position the entire time, you would just get very very little sound on games that only use bit 0 for sound.

I ended up getting the wrong package for the logic chip, I’m sure I could find a smaller one, I just didn’t think to check the chip width. My boards for both the updated surface mount version and the original-ish one are up on github here along with the python for calculating the voltage at the output of each resistor ladder configuration. I still have a couple of the surface mount boards (I never made the older design) so if you want one ask. After I’m out I’ll probably upload them to PCBWay so you can get them to assemble one for you.

Atari Lynx low battery circuit

February 15, 2024

In trying to diagnose the atari lynx issues I’ve been having I was very confused by this circuit:

U10 here is labeled on the schematic as S-8054. The two that I have are marked T7 64 and T7 21 indicating an abbreviated part number of T7. The Datasheet I found has the part numbers and their features, but not the abbreviated part number table so I don’t technically know which one I have. The circuit has this voltage detect IC connected to the input voltage rails (just past a diode), and since the buck converter is on the negative rail that means the +5v rail is common with the rest of the system, but VSS is not when the device is off. This means the voltage detect IC is always being driven when there are batteries in the lynx, but since the circuit beyond that is grounded after the buck converter those are floating instead of grounded. The input labels are also misleading, the +5v rail is only +5v relative to ground, not Vss. Vss is the battery negative terminal, meaning this device has up to 9v or so on it at all times. When the switching converter is on Vss is effectively an unregulated rail below ground. 

This voltage detect IC seems important to be always powered, and with the soft-power circuit of the lynx and the strange low side buck converter topology I have some question as to what its doing. Maybe it has something to do with the feedback circuit on the switching converter? Anyway, since I don’t know which of these parts lets test it. Very carefully ramp the input voltage up and down with a voltmenter on the input and one on the output (pulled up with a 100k, since it might be open collector). Doing that, on the upswing it turns the output high at 5.03v and on the downswing it turns the output low at 4.734v. It does this with pull ups or pull downs of 100k, so CMOS output is confirmed. Looking at the table that makes this part a S-8054ALO-LO-X. 

What does this tell us? Not much. After puzzling out the feedback circuit on the lynx power supply I found myself still wondering about this circuit. Cross connected transistors, a big electrolytic in the middle not as a smoothing or bus cap. The output seems to just drive the power LED. 

Oh. 

If I turn the voltage down below about 5v (when the switching regulator stops switching) the LED starts blinking. It was a low battery indicator this whole time. But that is a CMOS chip holding its output transistor on the entire time there are batteries in this thing. That has to have some power consumption impact. All to have a precise voltage detect IC for a low battery oscillator. And the main power supply still uses just a zener diode to set the output voltage. I don’t think I will ever understand atari, they built this thing out of literal 2n3904 and 2n3906 parts like you would get at radio shack, then they overengineered the low battery blink and under-engineered the power supply regulation. This shit is nuts. 

rat-ratgdo esphome sensor board build

February 15, 2024

Well, I built it. It took some modifications and the software was not as straightforward as I would have liked, but it all works now. This post is helpfully sponsored by PCBWay, and was in my recent order of four boards at once so this makes two. Two more to come. The Bracket is nothing special, same design as I have used before. I have started using slightly different design techniques though. 

I modeled the exact dimensions of the board, then I did an offset to give some tolerance to have the board fit in the bracket. I may move on eventually to using the step file from kicad to make sure the board fits, but for now this is as far as I have gone. To design the sidewalls I’m just using another offset so I don’t have to worry about curve radii or anything. 

The board went mostly smoothly, with one issue. I didn’t run a DRC or ERC for this design and the ground fill didn’t reach the negative pin on the usb port. While we’re on this picture though, I did start to shrink the text and it still works great. This is 0.7mm width, height, and 0.1mm thickness. I think with PCBWay I can go further though. I end up pushing things around and even making boards bigger to fit some text in just the right place, having smaller legible text will help me further optimize these designs.

It tried, but a combination of the rules for ground pours and the size of those pins meant it didn’t get connected. The real board matches it perfectly, but my design just does not connect the ground pin.

This is it fixed, on the real part I soldered a small wire from the ground pin to the mechanical mounting pad next to it. For the non-2n7002 fet I used the PMV20ENR, which is close to the original AO3400A but I could source it from mouser. 

The software was not terrible, but it was not as straightforward as the original esphome ratgdo designers made it. For their hardware there is a relatively easy web-based picker that adopts into homeassistant automatically. Mine is a .yaml file that you can manually include in the esphome plugin in your homeassistant instance and manage it from there. 

This is the main part of the difference in my implementation (except removing things). I have the pin definitions at the top for my board, the includes that add the other sensors I have on this board (those files are in my repo as well), and the board definition that I created as 2.5e (e for Evan) because I wasn’t sure if the ratgdo instance would try to pull in things I don’t want. I’m a little annoyed that to set the board I have such a small list. I’d really like to be able to pick the AI-Thinker module I want to put on a board of my own design rather than figure out which dev board is close to my module choice.

The remainder of the file is one of the yaml files for the ratgdo, but with some parts removed. The main reason I had the go this deep is to disable the features that make the ratgdo work as a wall control panel. Those automations were integral to the software, so cutting them out was mostly all it took to get the yaml file going for my needs. This makes for a very minimal implementation that you can add to any esphome sensor or button box. There are no button inputs or relay outputs based on the garage state mostly because my unit is mounted high up so it also works as a temperature sensor for the peak of my roof. 

The reason I mounted it so high is so I can activate my garage roof vent based on the differential temperature between the upper and lower temperature, or the upper and outside temperature. The dumb thermostat in the roof vent controller uses a bimetalic strip, but that set point can be set to a reasonable temperature like 90F, but if the exterior air is also 90F then it will never turn off. 

The updated version of this board can be ordered from PCBWay but it uses sensor breakout boards sourced from… my parts bin. I have yet to work out how to get them to assemble the board for you, but you can order blanks and do it yourself. 

misc 3d models (part 1 of ?)

February 15, 2024

I have recently re-learned solidworks and am taking advantage of this ability to make 3d models for whatever I need. For my circuit boards it usually means brackets (which I post about when I explain those boards). For everything else the uses are many and varied. 

This is the plastic cover for an IBM 5154. It covers the screws and matches the surface texture to make the design appear more clean. The issue with just filling a repaired one with epoxy is that the divet in the middle is required for the screw head, so when the tab snaps off making a new one is ‘easier’. This was the first thing I modeled, but I still haven’t printed it because it requires a resin printer. It’s also not the easiest thing to design, but it helped me figure out a decent number of aspects of solidworks. 

This is my latest design. The lever for a Shugart SA455-3AA 5.25″ floppy drive. The original cracked, this is modeled from my remaining good one. I had some issue with it because the original had some draft angles and it was hard for me to implement them all exactly as the original. I also made this part twice. My first time was trying to make a 2d sketch including every feature on top of each other and then do extrudes and cuts from the same sketch, but only certain aspects of it. I had so many overlapping lines, curves, rectangles, circles… It did not work. This model is largely made one feature at a time and carved out of a large block of material. It got a little questionable near the end where I removed material and then put it back from another direction, that means this model is not quite as parametric as I would like. It’s not a complete house of cards that will fall apart if I change one dimension, but you should double check that you didn’t unintentionally create a hole if you modify it. 

This is an adapter. I originally bought an LED light bar for my prusa mk3, but then I upgraded to a mk4. I didn’t want to re-model the whole thing so I made a 3-part adapter to allow me to make a standalone light out of the original light bar mounting hardware and then mount it to the top of the mk4. It uses more plastic and is more cumbersome, but I only had to model mostly flat parts and none of them required any support material. 

If you look closely in the picture above you can see my printer sitting on an ikea based drybox/buffer with a broom handle through it. I found that when my spools got nearly empty they pulled off the rollers and got stuck in that drybox design. I fixed it by sticking a broom handle through the whole thing (I have yet to seal that hole very well) and putting a shaft collar on the end of the handle so it doesn’t fall out. This is just an M4 bolt and nut, I may have even accounted for an M4 washer under the bolt head, but it’s not needed. 

This is a setup I designed, but haven’t coded yet. My intention was to have a cheap differential pressure transducer for esphome. I didn’t design a board, but I have a holder for the two dev boards. The DFRobot part is cheap, but I don’t think it’s in esphome yet. The second part is a flange that’s supposed to mount on your furnace on either side of the air filter to see how ‘full’ it is. I may have to redesign that part to add an o-ring groove, or make it large enough to put some weather-stripping between the sheet metal screw holes and the pressure port. 

This one was real dumb, I knocked my fallout blind box funko pop off the shelf and lost the base. It was easier for me to model and print a new base than try to find and glue the original base back on. I could print this out of transparent plastic to make it look more original, but I think black is fine. 

This is my first contribution to the gridfinity standard. I saw this video on the Tamiya Handy Drill and immediately went out to get one. I spend enough time drilling out holes in 3d prints that I was going to get a pin vise to do it, but this is just super cool. After building the kit and looking around I found that I had some leftover dremel collets from before I switched to a slightly larger jacobs chuck rotary tool and with a little kapton tape around the base to space them out they fit in this drill perfectly. I went out to harbor freight and got a $3 assortment of small metric drill bits (or at least drill bits labeled in metric). That assortment is covered here with the holes, but even drilling them out it’s way easier to stick the small drill bits in the trough. I added some 12mm magnets there for holding spare drill bits and the small ones just all went there. 

All my models are up on github here. I may start putting stuff up on printables or something like that, but my models are mostly for me and have very specific uses (I didn’t put much effort into making them generically useful). If you need these in a different format feel free to ask, and if you have any suggestions for upgrades I’ll take whatever you care to share. 

Atari Lynx HDMI hotplug detect

February 9, 2024

First, the problem statement: VGA is old and annoying, but easy to generate from an FPGA so screen retrofits tend to include it, how do I make it HDMI with audio?

The main issue is not converting the VGA to HDMI, I can do that readily with these little boxes that take 5v for power, hang off a vga port, and take in a 3.5mm headphone jack. This is all fine, and if I were just mounting this inside of a portable game console I wouldn’t think it that noteworthy. Cool, but in the sort of ‘making a portable game console’ sort of cool, not really much circuitry fun. The clever part comes in the fact that these old handhelds have stereo audio when you use headphones but were cheap enough to use mono when you do not have headphones plugged in. I drove myself nuts trying and failing to mod the amp in the game gear to work on stereo audio and eventually ended up saying ‘if you want stereo on hdmi plug in headphones to trick it and then your hdmi is stereo’. I don’t like that solution and decided to fix it. 

the lynx audio is actually pretty good and sensible. They have amplifiers for left and right, then from the headphone jack pass-through they have separate wires that mix through some resistors and are then amplified again for the speaker. This is a good design that makes it relatively easy to mod in some stereo sound even when the headphone jack is not plugged in. 

Except Atari’s a god damn liar and there’s no resistors and they tie together the sound channels under the headphone jack so I had to desolder it to find that out. 

There, I fixed it. Now I can tie into the stereo audio before it’s mixed even if the headphones aren’t plugged in. But how do I do the switching?

This is what I came up with. The heart of it is a 4052 dual channel analog multiplexer, but that presents some issues. The HDMI hotplug detection is pretty straightforward, it looks like when you have a display plugged in voltage is presented to the driving device on pin 19 of the HDMI connector. Based on my research though, it only has to present 2.4v on that pin. Where do they get 2.4v from, and what do I need?

Well, looking at the CMOS levels we can see that the minimum voltage for a logical “1” is 0.7*Vcc, and if you have a 3.3v logic level then you get 2.31v as a minimum, making that 2.4v just over that. This works well if you have 3.3v logic you’re talking to. Based on the 4052 datasheet I can only get full performance out of the chip at logic voltages over 4.5v and because I want to make sure I’m not clipping any audio I decided to run the chip at 5v. That means I need at least 5*0.7=3.5v logic voltage to trigger the chip. 

To level convert from 2.4v to 3.5+v I decided to use a comparator. I could have used a single n-channel fet and inverted the signal, but I would have to trust that the fet would turn completely on at 2.4v. I could have used a 3.3v logic level inverter or buffer with open collector outputs to pull the output up to 5v. What I had lying around was several hundred LM339 quad comparators, so this is a perfect example for how to use a comparator. 

The essentials are “when the voltage at the non-inverting input is above the inverting input, then the output goes (or is allowed to go) high”. The above circuit shows a resistor divider with potentiometer on the inverting input to have a variable voltage reference. But for my purposes why would I want a reference point that’s not zero? Well, look up at that CMOS level chart above any you can see that anything below 0.3*Vcc is a logical “0” so that means I need to quantify that on the comparator. I chose to set my point at around 1.5v so anything above that is a logical “1” and anything below is a logical “0”. 

Now, the output I said “allowed to go high”, why did I do that? Well, the output of this comparator is what we call ‘open collector’. Well, if you look at the ‘output’ pin above you can see the Q8 transistor can be turned on to pull output down, but there’s no other control of that pin. It cannot be pulled high internally. This is useful for converting between different voltage levels, and here I just need to pull the output pin high (to 5v) with a resistor and then whenever the Q8 transistor is not on the output pin goes up to 5v since no current is flowing. This also leads to what I did with the unused comparators, I wanted to make sure they were not dissipating any power so I tied the inputs so the output is always ‘high’ and thus the Q8 transistor is off. 

To mount all this I decided to modify the bracket for the BennVenn IPS LCD. I was 3d printing anyway so the first thing I did was recreate the existing bracket. This was just to make sure all the dimensions worked and after that I started adding new content. 

This was what I came up with to capture the HDMI converter board and a small amount of protoboard to hold my circuit. My first part was not exact, but I have since updated my model. 

I slid the HDMI converter up to get it flush with the faceplate which meant nibbling a bit of the bracket. 

I think it turned out alright, just very slowly carving away with a craft knife. 

This is where the protoboard landed, but that is mutually exclusive with the battery compartment. Oops…

I had to carve out a bit of the mount, slide it up, and hot glue it down. 

It now fits. 

For the audio (those connections I cut up above) I broke them out to a three pin connector so I can remove things for servicing. To restore it to OEM functionality though I need to connect all three pins together. 

I have left a bridge connector inside so anyone in the future looking to operate the device without the HDMI mod can just plug this in. 

This is essentially what it looks like (this is before I moved the protoboard). I also printed a strap for the HDMI board and potted it with a bunch of hot glue anyway. 

Now I just need to rotate my television to play Gauntlet…

The technical details are up on my github here. I have the cloned IPS bracket, the HDMI bracket with some updates, and the clamp for the HDMI bracket. I also have the schematic with component values up there. If I do this sort of thing again I may make a board and then it can be thinner and easier to mount. 

[EDIT]

I have a revision to make to this project. The speaker did work with the previous design, but not well. I eventually found out why, the entire speaker amplifier after the headphone jack does not exist on the lynx 2! I had been driving a 16 ohm speaker directly from the 4052, so I built the amplifier in the schematic and it didn’t work great. The configuration there is what the datasheet refers to as ‘bass boost’ configuration. I set it up as a standard amplifier, but since I wanted essentially a gain of 1 I had to put a big resistor divider on the input of the amplifier. I also put some 100k resistors to pull the audio signal to an average value of 2.5v instead of plus and minus 2.5v. This helps when feeding single sided chips (like how I am powering the 4052). I also have that dc-blocking cap feeding the speaker and everything sounds alright now. The 10k potentiometer is to tune the final max amplitude of the sound. Perhaps i could have sampled the sound before the first amplification stage for the HDMI, but this seems to work.

PCBWay ruler and coaster

February 5, 2024

Normally these days my PCB builds are sponsored by PCBWay, this time I actually have a couple of cheap products you can buy from them. 

This ruler is pretty ‘standard’ for a PCB ruler. It has packages you can lay some parts on to make sure you have the right part in your CAD program, it has some silkscreen examples so you know how nice the text will turn out. It also has these holes in the upper left. I originally thought the gold outline was indicating the wire size, but then I checked. 

As is sensible, the ID of that plated VIA is calibrated to be pretty damn exactly the right wire diameter for what is labeled there. This only works for solid wire, but still, a useful feature. It goes down to 28 gauge, so you can even check what sort of hookup wire you have, or what size wire wrap wire you need to replace something on a project that may be unlabeled. 

The other side is good too, trace width is shown for reference (sometimes it’s hard to remember what it actually looks like 1:1 and if you are planning to allow for cut-and-jumpers then you may want to glance at a real scale. 

The metric ruler is useful as… a ruler and with some math it looks like this unknown screw terminal is about 8mm pitch. But that’s doing things the hard way. 

This is the coaster, it has package sizes on the top side, which is fine. These can be useful for determining how small you realistically think you can solder stuff by hand (I tend to stop around 0402). 

This side contains some of my favorite stuff. The capacitor codes, sure. The packages, again, useful but not something you can’t usually eyeball. The grid in the center is quite nice. It acts as a 2D grid so you can line up parts and easily measure them even if they’re awkward shapes (just count the squares). My favorite part is the lines around the outside. 

How about this flat flex connector? well, I could have used any protoboard to check that alignment. 

What size header is this? well, I could have guessed that one at 1.27 (it’s half of the standard 2.54, or 0.1″). 

This is where I start to get off, what standard is that? I have parts from a couple of these so which one is this? Super helpful for using up some specific parts on a one-off build. 

Turns out that double the standard spacing exists too, not sure I would have guessed that before pulling parts out for this exercise. 

This one’s my own board, but hey, it works well on connectors too. There’s all sorts that start to blend together when you’re working with lots of standards. 

These boards are cheap and I just threw them on my last PCBWay order, I recommend you do as well if you run across the sort of design challenges as I do. The ruler is here and the coaster is here. Get some in different silk, see what your boards will look like when you get something other than green.