Saturday, November 25, 2017

Holiday Trinkets

I've been messing around with ring oscillators and decided to make a little holiday-themed trinket to give out. It was a good opportunity to get back into PCB layout and to learn how to use LTSPICE to simulate the circuit.

I originally wanted white LEDs, but with their high voltage drop and the 3V of the coin cell, they would never light up. In the end I had to use red LEDs with their Vf of ~1.8V. (This is when a green soldermask is more fitting for the occasion and better complements the red. However, the purple still looks amazing.)

Snowflakes!
Backside!
Of course, since I didn't think there could be an error in layout after checking that the schematic was right, there was an error. An error I found a few days after sending off the design.

Turns out the pin out for the default 2N3904 in KiCAD differs from the SMD MMBT3904 (which I really should have checked the datasheet for). The base and collector pins have swapped pin numbers, so when I solder up these circuits, I will have to flip the transistors upside down. And I thought I would have learned from the nixie tube clock. Oh well.

Friday, November 3, 2017

Ray Tracing and College

Working on a ray tracer has been quite fun, especially when debugging it when the image doesn't come out right.

I don't think that box is supposed to be cut off.
This was a bug with transforming the bounding box with a rotation.
It's mainly based off of Peter Shirley's raytracer in the Ray Tracing in One Weekend series of books, just implemented in Java. It's certainly not fast, but that's not really a big issue since I'm treating this renderer mostly as toy to learn more about the fundamentals of ray tracing.

Teapot! This uses a rather inaccurate model of glossy surfaces
but looks nice.