February 14, 2015

Hey, look what I scored!

Hi there, just a quickie to show off what I picked up recently...
I always wanted one of those part organizers or whatever you'd call them - you know, those boxes with a bunch of little drawers in them one could store one's parts in it and be all happy about it and having it all sorted. So one day, it just so turned out my classmate wanted to get rid of his grandad's boxes which weren't actually used for years if not decades (which is actually pretty likely based on what's inside). It was stuffed full of parts and I hauled those heavy things around in the public transport all the way back home... But anyway, here have a quick look at what I scored:

I think I should go build something using those parts... hmm...

I also scored about 54 tubes too, if anyone's interested,
I'll post a whole list of them. I don't have any use for them,
so maybe if you ask, I could get a couple of them to you!

That's what the whole
thing looks like. I love it.

Just a sneak-peek of the contents...

I also scored a bunch of 78xx
voltage regulators in this TO-3
package... The curious thing is
they actually reused the transistor
packages and it still says E and B
next to the leads! And there's also
a couple of 10kV rated 2.5nF caps.
Marx gen anyone?
A lifelong stock of ganged switches!
This one looks like a very very early LED... It barely glows,
even at 30mA going through it, but it really is beautiful.

A drawer-load worth of oldschool opamps in cans...

And I also have a whole bunch of germanium transistors in
those funny long-leaded packages. Sorry for the blurry image.

And I also have a ton of high voltage 20A diodes. I wonder
what the original owner used those for...

More random stuff, mostly just all sorts of high power resistors
and pots. And tubes. Tubes everywhere.



And there also was quite a bunch of those pretty large
electrolytic caps... TO 220 package for scale.



December 17, 2014

Getting power over 5kV isolation

Maybe you're asking why on Earth would I need to get power over a 5kV insulation, for Bob's sake. Well, there's a little bit of explanation: I got bored once again, so I started working on an open-source multimeter design based on Dave's idea on EEVblog #184 (in case you don't know the EEVblog channel, I do highly recommend it as I've watched nearly all of the episodes already, and I think it was worth it. Also, the EEVblog forum is really nice and helpful).
Since the meter does actually have no less than four different isolated channels and I kind of want to shoot for a decent CAT rating, I thought it might be a pretty nice idea to put the ADC and all the front-end stuff at the isolated side, since I'll only have to deal with getting the data over, and the ADC (I'm using an MCP355x, it's a nice differential delta sigma ADC with a nice 22bit resolution and mains frequency rejection) itself is fairly low-power - only about ~110 µA plus some other stuff, so I'm looking for about roughly 150-200 µA of current at a steady voltage between 5-2.7V.

I'll write about the multimeter design itself in some additional length later once I advance a bit further in the design stage.

My first thought was to build my own DC-DC converter for getting power over to the other side and using optocouplers to get the data through.
It probably would work, but after I saw the prices of those transformers and how slow the opto's usually are - not as if I really needed any high speed there anyway - I realized these things simply aren't cheap nor small. I don't think anyone would exactly want to carry around a massive brick, no matter what could it do. Also, there's a little bit of a disadvantage of using a DC-DC converter there - it's the noise. Filtering it out to something that won't exactly cut the ENOB of the 22bit ADC there to something ridiculously low would be a bit of a challenge, although a couple of good ferrite beads and caps should do the trick.

The other approach I've tried is to use one of those Analog Devices iCouplers - these things are pretty much chips with integrated transformers, they have multiple channels and they come in isolation ratings up to 5kV and 25kV transient immunity. That's about exactly what I need here - yay!
Some of them even come with an integrated DC-DC converter and some even have the transformer built in - but their efficiency gets pretty horrible, somewhere around 30%. The ones with just the built-in controllers aren't too bad, they can reach efficiencies at up to 80% or something, but I need a high voltage transformer there once again, ugh.

I came up with yet another idea - what about using high voltage capacitors to get the power over through capacitive coupling? That should do the trick I thought. I've then looked up the prices and properties of such devices, and they can be obtained for a reasonable price only in very low capacitance variants, usually in the order of tens of pF. On a second thought I realized the transients could easily pass through and blow the heck out of the circuitry on the other side. That won't be exactly plausible. Argh.

So what did we learn?

  • Doing this kind of stuff on a low power device is madness.
  • Doing this kind of stuff while one needs a fairly low noise output is nearly mad.
  • Doing this with caps is bananas, because transients can pass through and they'd need to be driven at fairly significant frequencies anyway

In case you wonder what have I ended up with so far, there you go:
I'm pondering about using an ethernet isolation transformer since those can be fairly cheap even for 5kV versions, but they aren't exactly the smallest and I might be forced to do double-sided component load to fit everything in, which isn't exactly what I want to do. But the chip of choice ended up being an ADUM4471. I'll have to do some further testing and number crunching about that still, but I guess I'm mostly set. The major problem making me a bit worried would be the massive power requirement of about 10 mA per isolator, and since there will be four of them... Nope, that isn't any much good for battery life I suppose.
I've actually ended up using button cell batteries on the input side and using ADUM144x instead afterall... This solution ended up being much cheaper and should just work, no need to care that much about filtering the supply rails then and yeah, that should just do.
Whew. Electronics engineering is fun at times.

October 31, 2014

Transistor - 1: A 16-bit madness designed right out of discrete transistors

Hi there again,

I've decided to go a little crazy and design a whole 16-bit processor out of individual discrete transistors.  Why?  Well, why not?
A nice full adder with just 9 transistors.
Let me know if you can do better.
I actually had this idea for quite some time now and I'm kinda taking a CPU arch design as a kind of a hobby...  I just find it fun for some reason. But now I actually sorta got to it and I have designed a couple of basic building blocks.  Not just logic gates.  Designing stuff just out of logic gates is pretty lame, trust me.  I have actually done a few transistor-level optimizations already, and well, I kinda find making a 3-transistor XOR kinda impressive. :P

Anyway, there's a couple of various schematics of those blocks on the side. Sorry if they're ugly or unclear, but yeah, it seems to work, so I'm happy.

A full, 1-bit ALU slice. In case you wonder,
bit-shifting is done in a separate bit shift unit.
I've also missed those ZX and ZY bits,
but that should be rather easy to implement
- just don't read an input from a register. Easy.
I've managed to squeeze a full 1bit ALU slice down to 20 transistors, but I bet I could still do better than that, hopefully.

I figured the thing taking the largest amount of transistors would probably be the register file.

I'm having about 8 general purpose registers there as well as a couple of 'special' ones, and each of them being at least 4 transistors worth per bit, and well... that doesn't really make a smiley face, does it?  I'm thinking about using 'dynamic' registers in the actual physical version of this thing instead, but refreshing the actual registers all the time... not really sure. But I guess that might not be a problem since I might use some nice MOS transistors to read that out and some massive electrolytics caps to hold the charge...  I'll see, it's all still in quite an early phaseof design as you can see.

I'm designing the logic using a combination of RTL and DTL by the looks of things, but I don't know really.  I'm just really whacking it up the way I try to get to the lowest possible transistor count.  I've set myself a limit of roughly 1000 transistors pretty much for no reason whatsoever.  I'm quite doubtful about that, but I'll see.  I'll probably actually end up making the ALU just 8 bit and pass stuff through twice - that actually saves a whole bunch of transistors, but it makes it quite a bit slower.  But I don't mind that really, I guess.

I think I should describe the whole architecture a bit more. I'd be making a softcore version of it in VHDL soon, so in case you'd like it, just ask me for that somewhere or write your own if you're so inclined.

So there you go.  I will hopefully finish the design sometime and possibly even make it someday...
In case I'll be REALLY building this, I'd go oldschool wire-wrapping style, I guess.  Let's face it - soldering wires to all those 3500+ joints?  No thanks.  That would just take ages.  So I'll just quickly solder the leads of all of those things to a board and then wrap it, test it, blow it up, fix it, blow it up again, fix it again, give up, get back to it, fix it again like a pro, make sure it works, pot it up and be done with it.  I guess.  I bet it's not gonna be so easy, so expect a couple of more entries about this thing since I'm actually fairly excited about it.

October 3, 2014

ST Nucleo Development Board Review

So I got my wage once again and wondered what to spend it on, so I thought I might get one of those ST Nucleo devboards, because they're pretty cheap, I might wanna learn how to program those nice ARM micros, and they come with a fairly decent support and hardware resources as well, so I got one. Yay.

I've ran for the L152RE one for a number of reasons:

  • Amount of flash memory. It's got whopping 512KiB of it. Freaking half a meg. Suck that, Arduino!
  • Amount of SRAM. I almost went jawdrop mode when I saw it's got 80KiB of it. Why'd I ever need so much memory anyway? More about that later.
  • It's also got a pretty much standalone ST-Link V2 on it, which could be used to program other micros and hack random other stuff, and seems to be supported by the OpenOCD too! Yay!
    This thing alone's worth a nice buck.
  • Triple SPI and double I2C, not bad.
  • No less than 5 USARTs. Neat.
  • It also supports USB somehow, too.
  • It has arduinous headers on it too, in case one might wanna use any of those ubiquitous shields
  • They claim it's also got 11 timers and up to 34 capacitive sensing channels and it can drive up to 8x40 segment LCD. Yeah, not bad. also a 1MSPS ADC - cool.
  • It's also got two 12bit DACs. Yup. THIS was the main reason why I bought it.
There it is.

When I got it (I even was late for school just to pick it up at a local post office, because I thought I could play with it at school, but alas, I didn't have the goddamn miniUSB cable it needs that day, damnit), I was actually fairly surprised when I discovered it acts like a flash drive after plugging it in! It comes with a little html file on it which pretty much only redirects you to the mbed.org site and gives you their online compiler. That thing also comes with a whole range of examples, I haven't even tried a half of them, even though I might do so later, and I went straight to playing around with that dual-channel DAC on the thing, because you know, I just love drawing stuff on the 'scope in XY mode. I dunno why, but that's one of the few things that kinda satisfy me.

And that turned out to be pretty nice.


Anyway, back to the review,
Both of those waveforms should display the same, but they don't.
The first one comes from the DAC on PA_4 (aka A2),
the second comes from the PA_4 (D13) crippled by the onboard LED.
One thing I found slightly disappointing, is the fact it's got an LED connected to one of the DAC outputs. I know why, the DAC just so happens to end up on Arduino pin D13, which is where a LED is typically attached to on most arduinous boards of this form factor. So what's the problem, dude? Well, it just so happens the LED cripples the wave coming out of the DAC in a pretty ugly fashion. So it basically doesn't let anything over about 2V out, which almost made me go mad. This can be solved by removing a little jumper resistor at the bottom, but since I'm lazy, I've just downscaled the output in the code to be always under that value in the linear range. Nailed it.

But apart from that, I can't really complain much about this thing. I think I'd even recommend you getting one - they have a very wide range of them, each sporting a different processor with a different set of features that might be handy for something else. Anyway, it costs less than a half of the price of the Arduino Uno, and it has the same headers too, so in case you happen to be running low on money and actually think going with something slightly nicer than just a simple 8bit micro, I guess this might be the choice for you. I also really like the fact it's got that ST Link debugger on it ready to be broken out and being used standalone, so that might really come in handy too later, once you actually make your own little board or something.


August 20, 2014

Woo, got a new phone!

Just a quickie - I've got a new phone now, which seems to have a somewhat decent camera on it.
That means I'll be able to take pics one could actually make heads and tails of and generally document stuff a little bit better, I hope.

For those who are interested, it's a GIGABYTE Gsmart Aku 1 Quad, not a bad one, and it was really cheap too!

June 11, 2014

Pong on a 'scope: Dicking around with XY mode

I'll start this entry like this:
The 'problem' with me is, that when I figure out how to do something, I keep expanding that, until it goes completely mad. What I'm talking about now is dicking around with the XY mode of a scope with a DAC.

Pong-o-scope.
After some more dicking around with drawing stuff with the XY mode, I rumbled upon my parts bin again, and found a pot. That made me think the junk I make appear on the screen is just a little bit too uninteractive, and after an hour or so, I wrote this Pong game. I know it sucks, it's buggy and glitchy at times, it looks awful, but that's just something I made once again, so I thought about slapping it onto my blog. Why not, right?

How not to breadboard 101
On the right you can see a couple of photos of my current setup. If you are any sane, you're probably looking for something to puke into now, because that's pretty much how NOT to breadboard 101, but it works, right?

So, in case you're as crazy as I am and you'd like to slap one together as well, here's a quick howto:

What you need:


  • an Arduino or something like that
  • an MCP4822 DAC
  • a couple of pots of a reasonable value (anything between 2k2-100k should be right)
  • a breadboard
  • and obviously a dual channel analog oscilloscope - it has to be analog, because the XY mode on digital ones doesn't really work for this stuff well.

How to slap it together:

Here's a fritzing sketch for ya:
And HERE's the arduino source code.

Here's a video of it in action:


Conclusion:

I've slapped this thing together in just about an hour or so, so don't expect anything very much polished as always, but that means there's a ton of space for improvement - I'll probably add at least one thing into this project later - sound. It's completely silent now, which kinda sucks.
Also, I'm using a pixel approach - which kinda sucks as well! I'll probably switch to vectors once I figure out how to draw these properly (facepalm)...

I hope you like this project.
Also, don't forget to leave a comment!

June 8, 2014

Nixie Clock: First Sparks

It probably wouldn't be a proper today's self-made electronics blog if I hadn't built myself a nixie clock, so I gave it a shot.

So this is the result:
It looks rather ugly IMO, but that's hopefully subjective. I'm using a couple of ZM1080T tubes there, because I just got those two and couldn't be assed getting something else, driven by a couple of classic 74141 driver chips I've salvaged somewhere. It's all powered from a 9V power supply connected to those two screw terminals. I don't have any schematic for this, built it off-hand pretty much with a help of some pinouts I found on the net.

The microcontroller there is the everpopular ATMega8, and I've even got an LM335 temperature sensor, so it shows temperature too!

How the hell can I show time on just two nixies? What kind of sorcery is that? Well, the sorcery's called decimal points, and each of those tubes has two. I'm actually using just one in each tube to indicate what's it showing. If the left one's on, it shows hours, if the right one's on, it shows minutes, if both are on, it shows seconds, if none is on, it shows temperature (Celsius!).

I have yet to figure out how to make the time properly user-settable, I even thought about making it radio-controlled, but I can't be assed either buying or brewing my own DCF77 receiver or something of that sort, so yeah.

Well, this is the project preview and I hope you like it!
Anyway, sorry for the picture and video quality, both was shot with my crap mobile phone.