a healthy criticism of everything


November 13, 2021
by: jovial_cynic
I think I'm going to say goodbye to social media entirely.

Earlier this month, I stopped logging into Facebook and took it off my browser quick links and my phone. I still have the account, but if I find that I don't log into it through the end of the year, I'm going to just delete my profile entirely. I never check my Instagram account (although I just posted a photo of my kindle and the new composition-notebook cover). Twitter is starting to bore me. And with the advent of the Metaverse, I think I'm just done.

And this means that I'll have more time to do everything else, to include maintaining this site and posting photo journals of my projects. We'll see.

Anyhow, goodbye social media. Hello, new protesters.

comments [0]

np category: site


July 12, 2021
by: jovial_cynic
Today is my last Monday at the current job with Washington State.

It's weird to have changed jobs during Covid. Twice. The first job was as a Sales Leader with Allstate. Early in the pandemic, they transitioned to work-from-home, like many jobs, and my office became the space around my laptop. It worked out quite well - my family and I lived on a 51' boat, which meant that my office was really anywhere along the Puget Sound waters - sometimes in Poulsbo, sometimes in Tacoma. We didn't make it to Canada or Alaska like we planned (due to travel restrictions) but I'll still argue my office was nicer than anyone else's.

When I left Allstate (or Allstate left me? It's complicated) and picked up a job with the State of Washington Office of the Insurance Commissioner, my office view didn't change. We still lived on the boat at the time, so my adventure into state government employment didn't feel like much of a change. My "office coworkers" were still my wife and my kids, and aside from being on the phone a lot more (my job involved talking to consumers who complained about their insurance companies), my routines were pretty similar. Another key difference is that I was a supervisor. Having subordinates has been a little strange in a remote environment. True story: I've never met 5 out of 6 of my subordinates, except by Zoom. Aside from little "how was your weekend" chats as the late-arrivals would log into virtual meetings, I can't say that I know much of anything about my team. And I think that's why transition out of this current job feels so odd. I'm saying goodbye to people I've never met, and due to lack of time and face-to-face interaction, there's not really any emotions about it. I think the only emotion that I've had is this growing feeling that a state government job isn't for me.

If you know me at all, you know that I like to tinker. I like to create things. I like to come up with creative solutions to problems, and really push the borders on what is possible. I crave adventure, exploration, discovery. So as you might imagine, being chained to policy and procedures and paperwork and the correct crossing of "T"s and dotting of "I"s has been, in a word, torturous. It has been soul crushing for me. Not to be thwarted, I *did* impose some change on the way the office was run. I set new expectations on my team that encouraged my subordinates to ask more questions and to look for solutions in novel ways. But some borders are functionally immovable; policy and procedure documents could take months... YEARS, even, to change in meaningful ways. I just don't have the patience for that.

At some point, I polished my resume and updated my LinkedIn profile. It was, in fact, my LinkedIn profile that caught the attention of a head hunter who was eager for somebody with my background. They were looking to create a new Sales Leader position in the Northwest, and having already been a Sales Leader with 17 years of insurance experience, I was exactly what they were looking for.

Initially, I was not interested. I mean, it's a bit of a contradiction to suggest that I'm creative, exploratory, and always looking for new adventures when I've spent nearly half my life in a single career field. All in insurance! I told the recruiter that I was hesitant, and that quite frankly, if I was going to accept any interview (seven separate interviews with the company, as it turned out), I wanted it to be very clear that it was I who would be interviewing them, and not the other way around. I needed to make sure that there was a philosophical alignment between myself and the company. I previously chose not to reapply with Allstate due to philosophical differences; I wasn't interested in tying myself to another company with whom I disagreed.

In the end, I decided that the new company was acceptable to me. The interviews revealed to me that the company is very interested in new ideas, changes, new ways of succeeding, and that in my role, I would have a seat at the table for these discussions. Additionally, the role would give me a tremendous amount of freedom. Freedom to solve problems, and to look for efficiencies. The structure is basically, "Here's your territory, here are your resources, and here is the goal. Go get it!" I love that. I thrive in that. And it's for that reason I accepted the job and am eager for next Monday.

I'm very excited about this. No mixed emotions at all. Just a sense of wonder as a new adventure opens up in front of me. I can't wait.

comments [0]

np category: personal


June 07, 2021
by: jovial_cynic

So... I listed my original six Handolin MIDI instruments on eBay and facebook, just to see what would happen, and in two days, they all sold out.

Clearly, I sold them too cheaply. I've ordered components to make more, and I'm increasing the price by $5. Because... why not?

I've had to start printing more cases. Based on my current print settings, these take about seven hours to print!

My next batch is a set of 30 of them. I've got a long ways to go!

comments [0]

np category: audio


May 13, 2021
by: jovial_cynic
I've been nerding out this evening correcting a bunch of broken links on this site. Apparently, I had (and maybe still have?) a bunch of embeded youtube videos using some sort of Flash-based code. Since Flash support went away a long time ago, I have to go through and clean it all up.

Having embedded code at all is kind of a weird thing. Who knows if some competitor will come in and swallow youtube up, breaking all the links on this site? How annoying would that be?

I could personally host all of my own videos, I suppose. But I certainly couldn't host videos that don't belong to me, so I don't know what I'd do in that situation, other than just have to go through and clean up my code again.

It's kind of annoying.

comments [0]

np category: site


May 13, 2021
by: jovial_cynic

I've been working on a music project for a little while now, and a couple of months ago, I managed to complete the code for the Arduino Pro Micro microcontroller to bring this prototype to life.

Lots of electronic-music folks use a MIDI keyboard, bang out some keys, record it into their computer, and then mix with all kinds of electronic sounds. I've always wanted to do that, but I don't play the keyboard. I don't think about music through a keyboard. I do it through a violin or mandolin (they're the same strings). There's something about progressing up the strings in 5ths that just makes sense to me.

Anyhow, I couldn't find a violin-like MIDI controller anywhere, so I decided to code my own. Well, code, plus engineer the wiring, tie together some circuit boards, solder a bunch of wires together... and voila.

Here is the original prototype of the handheld violin/mandolin MIDI controller, or "Handolin":

Important note: This is an Arduino Pro Micro clone. It's in the family of the Arduino Leonardo. The normal Arduino is in the family of the UNO, and the UNO cannot be used as a MIDI controller as-is. You have to use a member of the Leonardo family, which uses the ATmega32u4 chip. You need this chip in order to have the Arduino function like an input device.

Anyhow, after getting the code correct, I finally got it built up to look more like the instrument I had in mind:

And... it works!

It's important to note that a strict MIDI instrument controller doesn't make sound. You have to play it through a sequencer or digital audio workstation (DAW). This controller is no different - you're hearing the audio because I'm playing it through the Reaper DAW, and I've chosen some weird space-strings kind of virtual instrument.

MIDI is really interesting. There's plenty of youtube tutorials on how it works, but on a basic level, the instrument controller sends the following data:

  • Pitch (the actual note being played)
  • NoteOn (the instruction to start playing the note at a particular volume or "velocity")
  • NoteOff (the instruction to stop playing the note)

There's lots of other MIDI commands that can add other effects (like pitch blend, volume control, etc.), but I wanted my instrument controller to be as basic as possible. Just the notes.

Unlike a keyboard, where a sound is played when you press a key, a violin is a bowed instrument. If each note was a button on the instrument, the buttons wouldn't do anything unless the bow is played. Or, in the case of the Handolin, they don't do anything less the "string button" is pressed. The other reason this distinction is important is because you can play non-pressed strings on a violin - it's "open string" playing, and that's just a normal part of stringed instruments.

The other important design consideration is that a violin has 4 strings. The Handolin has 2 rows of buttons, which represent two strings. In order to access the remaining strings, I included buttons that let you shift between any two string pairs. The instrument defaults to D and A, but by toggling to the right, you get the A and E pairing. If you toggle to the left, it goes D-A, G-D, and also does a C-G pairing for the viola plays our there that like that low C.

The next step was to make this thing look a little less... prototype-ish. So, I got into an online PCB designer and managed to come up with this bad boy:

It's a two-part PCB, because the Arduino Pro Micro needs to basically sit exactly where the bottom 4 buttons are sitting. The only way to do that was to build a daughterboard with some posts that would allow the daughterboard to sit beneath the main PCB. And, after a bunch of design work and 3 weeks of waiting for shipping, I received these in the mail:

Look how much smaller it is than the original!

The next thing to do was to design a case to house the thing, so I got onto Blender and cooked this up:

I decided not to 3D print the scroll on there, just because I wanted to get it done faster, but the next one I print will definitely include it.

And here's the final result. Enjoy!

comments [0]

np category: audio


May 13, 2021
by: jovial_cynic

I started this project because I wanted to see if I could drive a few gauges I owned using the AtTiny85 microcontroller and the sensors that came with my car. In particular, I wanted to display the values for the following:

- Fuel Level
- Oil Pressure
- Coolant Temp
- Fuel Pressure

Because my Datsun 510 is entirely custom, it means that I don't have any of the original gauges. Even if I did, I don't have the original engine, so the sensors wouldn't play nicely with the factory gauges anyway. A custom solution seemed to make sense.

The first step was to get the resistor value ranges for the sensors. Most sensors have some kind of increasing or decreasing amount of resistance, depending on what is being measured. My fuel tank has a float that raises an arm, and as the fuel level decreases, the sensor resistance increases.

In this specific example, the fuel level sensor has a range of 10ohms (full) to 80ohms (empty). From everything I've read about the stock Datsun 510 fuel level sensor, it's a fairly linear relationship. That would mean that 38ohms is roughly half-full.

The next step in this project is to create a voltage-divider circuit.

Basically, this allows you to read a voltage output that will vary, depending on the change in resistance of either one or both of the resistors. If I use a fixed 100ohm resistor in the circuit and push 5v through it, the circuit will generate an output that can vary between 0v and 5v, and that will give me the analog voltage data I need to drive my gauges.

Just for kicks, here is the data and graph that I set up in Excel for the fuel level sensor voltage divider circuit.

This shows the ohms, the fuel level (in percentage) in the gas tank, the voltage output from the voltage divider circuit, and the 10bit value that the AtTiny85 will see when it reads the 0-5v signal. Below that is my little voltage divider circuit calculator that I used so I could see what the voltage would be, given any ohm reading between 10 and 80.

This graph has the same basic data, but shows it in graph format. Excel has a built-in feature that lets you see the slope (or polynomial) formula (y = -57.26x + 128.66) based on the plots on the graph, which will prove to be VERY useful later.

You'll notice that I'm using percent-full for my data. I could have used actual gallons, but because fuel gauges are really about showing that you need to go to a gas station, it doesn't actually matter how many gallons the tank can hold. That's not terribly useful data for my purposes, so I went with percent-full instead.

So, armed with all the data I need, I moved onto the programming the AtTiny85 to do my work. Well, three AtTiny85s. I have three of them for this project, and they're powered by a buck-converter that's taking the 12v car power and bringing it down to 5v for the AtTiny85s and the gauges. If you don't know, the AtTiny85 is like a smaller, less-powerful Arduino. You can use the same basic code, although there are some hardware specific features that aren't available. But for this project, it's perfect.

On the AtTiny85, I'm using the analog input pin (A0) to read the voltage coming in from the voltage divider circuit and running that data through the following processes:

1. Read the voltage into pin A0. That data comes in a 10-bit format, so to convert the value into something that makes sense, you divide 205 by the voltage reading, and that gives you the actual voltage.

float sensorValue = analogRead(A0);
sensorValue = sensorValue / 205;

So, here's an example: Let's say that the resistance from the fuel tank reads 38ohms. If you run that through the 100ohm voltage divider circuit and push a 5v source through it, you end up with a 1.38v output. That shows up as 283 on the analog-to-digital converter, so divide that by 205, and that gives you 1.38v.

As a side note, I'm only doing the "divide by 205" to make my code easier for me to follow. I want the next formula to be a "voltage -> percent-full" value, so I did this for convenience. It's probably cleaner to keep the original ATC value and do the math that way, but I wanted to do it this way.

The next step is to run the voltage through the slope formula from before: y = -57.26x + 128.66

This part of the code looks like this:

percentFull = (-57.26 * voltage) + 128.66;

So, if you put the 1.38 volts into the formula, you get:

(-57.26 * 1.38) + 128.66 = 49.64

Well, 49.64 is basically 50. And because my formula is designed to output a value between 1 and 100, we're showing a tank that's half-full. Or half-empty.

The next thing to do is to take the "50" value and make that output to a gauge somehow. The AtTiny85 has a pulse-width modulator (PWM) output based on a 0 (no output) to 255 (constant output). As it turns out, 5v panel gauges treat PWM output a bit like regular voltage; PWM 255 = 5v on the gauge, and PWM 127 is about 2.5v on the gauge. Since I'm trying to make a value of 0-100 and output it to a value between 0-255, I use the map function:

pwmOutput = map(percentFull, 0, 100, 0, 255);

And then I send that mapped value to the gauge:

analogWrite(A0, pwmOutput);

That's really all there is to the fuel level sensor and gauge output.

The oil pressure is essentially identical, only the ohms range from 10 to 50, and rather than percent-full (which makes no sense on an oil pressure gauge), I'm outputting the actual pressure values (0 to 80PSI), with the target PSI being at 40. The voltage divider circuit is different due to the different resistors needed to make it work properly, and the slope formula is also different. Lastly, the map function will read 0 to 80, so that the target value of 40 ends up in the center of the gauge. That's an intuitive way to read the oil pressure, and I wish more gauges functioned that way.

The water-temp has some of the same differences, but I'm adding one additional function to AtTiny85: once the water temp hits 200F, the microcontroller will send an "on" signal to a 5v relay module, which will flip a switch to turn on the 12v engine fan. This will prevent me from having to keep the fan running all the time.

This is an image of the relay module hooked up to a traditional Arduino, but it works with the AtTiny85 the same way.

comments [0]

np category: 510


May 13, 2021
by: jovial_cynic

Some Nissan engines use an odd technique for regulating fuel. When the engine is at idle, rather than lower the pulse-width modulation (PWM) signals to the injectors by changing the output signals from the ECU, they actually decrease the voltage going to the fuel pump to lower the fuel pressure. That way, the injectors continuing firing off at the "base" frequency, but there's just less fuel pressure behind them.

I did an engine swap into my 1971 Datsun 510, and I didn't know that my replacement engine (1991 SR20DET) was supposed to have this weird Nissan fuel pressure control module (FCPM). It didn't come in my box of parts, so I just constantly battled a fuel-rich condition whenever I let off the throttle.

Anyhow, I learned about this FPCM and poured over the wiring diagram to figure out exactly how it worked. Apparently, when the engine is off-throttle, a signal from the ECU (pin #105, in my case) outputs a 12v+. When I step on the throttle, pin #105 outputs nothing. So... I figured I could wire in a relay from that 12v source, and run the power to the fuel pump through a heap of high-watt resistors - just enough to drop the voltage down to 10v, which is perfect for correcting the air-fuel ratio. But, when I get on the throttle, the relay kicks over and reroutes power straight to the fuel pump.

And... voila! It works!

comments [0]

np category: 510