post

Calculators and numerical differentiation

It happens that I quite like scientific calculators, and lately I’ve been adding a few to my collection. Several calculators are CAS (“Computer Algebra System”)-capable, meaning they are powerful enough to do symbolic / algebraic processing, and thus are able to understand and manipulate algebraic expressions containing any mix of unknowns, operators and numbers, and simplify, expand, and solve those in a general form. They normally can also do symbolic differentiation and integration, computing the general derivative/integral “function” from a expression first, before you can evaluate them at given points, if desired.

But I’ve always found quite fascinating that some less advanced calculators still offer the possibility of doing numerical integration and differentiation. They don’t know for instance that the derivative function of 3⋅x² is 6⋅x, but they can still tell you that when x = 2 the derivative is 12.

Before you ask; I got into this rabbit hole because numerical differentiation and integration are kinda standard features nowadays of any decent calculator. It doesn’t need to be a high end or an expensive calc. In fact, I noticed that even my fx-570MS “entry level” scientific calculator I purchased like 10 years ago can do both operations, while three of my “high end” vintage programmable Casio calculators can’t. As they were “programmable” I think Casio kinda expected users to write their own programs for whatever “advanced” feature they needed. So I started wondering what is the method/algorithm used by current scientific calculators to compute these functions, so I could add the same functionality to my these calcs.

Now, I’ll focus on differentiation here because it’s way easier to deconstruct and understand how that works. A post about integration may follow, if this doesn’t turn out to be a massive borefest.

The concept of derivative

So if you go back to the formal definition of a derivative;

You’ll see that it basically attempts to find the “slope” of the function f(x) at a point x by evaluating the expression at x and (x+h) (as you would do with a straight line), and trying to reduce the difference in the X-axis between those two points (h) to a tiny fraction. In fact, it uses the concept of limit to find out where that expression converges when h approaches 0 (It never really gets there though, because the whole expression goes to hell at that point). Read More

ZEPPP : Zero External Parts PIC Programmer

A couple of months ago I was asked if I could prepare a sort of workshop on one of my favorite topics: ASM Programming for PIC microcontrollers, which I of course accepted on the spot.  Now, I wanted to include a couple of “hands-on” lab sessions in this workshop, and because of this, I needed a way for all attendants to actually work with real PICs that hopefully did not involve purchasing PIC-programming hardware in bulk for what is probably going to be a one-shot activity.

The Quest

Simple DIY programming circuits exists, and in fact, my first PIC programmer was a home-built “Enhanced” NOPPP (No-Parts PIC Programmer); a fully functional device that required only a couple of components (Not really “No-parts” but pretty close to it). The problem is that it used the PC parallel port (R.I.P), and required an external power supply. And this goes for pretty much every “classic” DIY PIC programming circuit; they all either require extra hardware or can no longer be used on current computers.
Read More

Making a dedicated Logic Analyzer, Part 2

It took me a really long time to do this second part of my Pi-based Logic Analyzer project, mostly because of two things; the first one being that at one point (after I had pretty much all the case design, extra hardware and software tweaking done for my RPi1) I decided to switch to a Raspberry Pi 3, which of course meant discarding a lot of work and starting again but with the RPi3 in mind.

Why? Because I figured that my device was getting needlessly bulky (the case required extra room for a small fan (for the overclocking), extra width for the full-size SD card, and extra thickness due to the back-facing P5 connector, etc), and it would have been almost impossible for others to replicate this project (because I was using the old Pi1 Rev.B board, which is discontinued) so using a more modern Pi made sense. The physical layout of the Pi has stayed the same since the latest revision of Pi1 I believe, and -sans the position of the status LED- both the Pi2 and Pi3 are identical and completely interchangeable for the purposes of this project.

The second reason for the delay was that in an spectacular display of stupidity, I managed to fry my Waveshare TFT screen when I was done with the whole setup and designs for the Pi3, so I had to order another one online, and wait until it arrived, which took a long time. Read More

0-30V 3A Linear Power Supply Kit

It has become pretty common for me to have one or two unfinished projects on my bench or the shelf, because “I just can’t find the time” to complete them, or because I’m “waiting for something the project needs”. And both things happened in one way or another with a Linear Power Supply kit that I bought after watching a review/build by VoltLog.

I ordered the kit online, and before it arrived I went and purchased a 24V 3A transformer from a local electronics store, eager to build and test the kit as soon as I got my hands on it. By the end of July I received and soldered the kit. The enclosure arrived later I think.

Looks fun, right?

The beginning of the delays

Read More

Enclosure for a D3806 Buck-Boost Switching Power Supply

I kinda like the end result.

Not long ago I purchased this neat and compact DC to DC Buck Boost converter that performs reasonably well. It has a maximum output of 38V, 6A and has more than enough flexibility and features to be a secondary power supply in my lab.  I recently found a review of this product by Julian Ilett on his channel (which I’ve been following for a while) and the way it works is quite clever. The problem for me, however, is that it was a bit messy to have the bare circuit board laying around unprotected on my bench. The top-mounted panel wasn’t too practical either, and it was becoming increasingly clear that it was meant as an adjustable power converter module rather than a supply. Read More

UV Exposure Box Project – Part 2

I disabled the safety feature just for this shot. You are welcome.

This is the second part of my adventure building a UV Exposure box, in which as you can see, I actually finished the build. In the first part I made the structure and planned the electronics. This part covers a whole lot more, distributed over many weeks doing small things here and there. Read More

An update to my desk clock

I like to call this revision “Please believe me, I’m not a bomb”

Like a year ago I made myself a nice little desk clock that has worked fine since then. But recently I revisited the project to do certain improvements.

For starters I wanted a smaller board so I could fit it inside an enclosure.  I also wanted to power the clock from a rechargeable 18650 battery and add the charging circuitry to the design. I was also willing to give up with the ultra low power consumption and use a DC-DC booster that would of course draw more current but would ensure the clock gets a nice and stable 5V at all times. This has two advantages: It keeps a constant brightness for the display, and, more importantly, will give me reliable 5V in the aux port so I can easily interface the clock with other devices or external circuitry if I so desire. Read More

Power supply for a DIY function generator kit

I love DIY/soldering kits, and thanks to online marketplaces like eBay I’ve been able to purchase and assemble a number of them for the past few months.

One of the last ones I got was a very basic but useful function/signal generator, whose only problem was that it required a power supply with +12V/+5V/-12V rails (it also arrived already assembled despite being sold as a DIY kit, which was disappointing in a way).

My firsts tests of the kit were with a PC power supply (the only source of -12V I had in my lab) until I got a “proper” alternative in the form of another kit, which is sometimes advertised as a “Hiland USB Dual Power Multiple Output Supply”. I will call it HL supply during this post (Mine says “Hyland” on the PCB, so assuming an original version exists mine is probably a cheap clone). This one actually required assembly (yay!) and worked fine in my limited tests, but it was still a hassle to have the two boards dangling around connected whenever I wanted to use the signal generator, so after some time I decided to make a (temporary) enclosure for the whole thing.

Read More

UV Exposure Box Project – Part 1

In my neverending quest of improving my homemade PCBs, I discovered that adding a soldermask to my boards is actually not a hard task, thanks to a relatively simple process that involves UV-curable paint. Now, while using the sunlight as a UV source should work just fine, I decided that it was time to build a proper UV exposure box. Winter is quickly approaching and I’m not too fond of the idea of having a variable-intensity light source (the sun) that would make the process (and end result) completely dependent on how good was my estimation of the time required to properly cure the paint given the weather of that particular day.

A UV Box would also allow me to experiment with UV-based transfer methods for the PCB etching process as well, so it was definitely time to build one.

UV Exposure Box. Closed.

Read More

Using your Pocket C.H.I.P as a portable Logic Analyzer

Pocket C.H.I.P + USB Analyzer

So a time ago I purchased a cheap USB Logic Analyzer from eBay that works great with a PC, and it’s been really helpful to debug several projects to date. It uses the Logic software from Saleae as hinted by the label on it, although I am not sure if the device is supposed to be a cheap knockoff of one of the (pricier) genuine Saleae analyzers, or it was just designed to be “Saleae-compatible” and use their software. Read More