Linux Fu: Automatic Header File Generation

I’ve tried a lot of the “newer” languages and, somehow, I’m always happiest when I go back to C++ or even C. However, there is one thing that gets a little on my nerves when I go back: the need to have header files with a declaration and then a separate file with almost the same information duplicated. I constantly make a change and forget to update the header, and many other languages take care of that for you. So I went looking for a way to automate things. Sure, some IDEs will automatically insert declarations but I’ve never been very happy with those for a variety of reasons. I wanted something lightweight that I could use in lots of different toolsets.

I found an older tool, however, that does a pretty good job, although there are a few limitations. The tool seems to be a little obscure, so I thought I’d show you what makeheaders — part of the Fossil software configuration management system. The program dates back to 1993 when [Dwayne Richard Hipp] — the same guy that wrote SQLite — created it for his own use. It isn’t very complex — the whole thing lives in one fairly large C source file but it can scan a directory and create header files for everything. In some cases, you won’t need to make big changes to your source code, but if you are willing, there are several things you can do.

Continue reading “Linux Fu: Automatic Header File Generation”

Heathkit IM-13 VTVM Repair

If you are under a certain age, you might not know the initialism VTVM. It stands for vacuum tube voltmeter. At first glance, you might just think that was shorthand for “old voltmeter” but, in fact, a VTVM filled a vital role in the old days of measuring instruments. [The Radio Mechanic] takes us inside a Heathkit IM-13 that needed some loving, and for its day it was an impressive little instrument.

Today, our meters almost always have a FET front end and probably uses a MOSFET. That means the voltage measurement probes don’t really connect to the meter at all. In a properly working MOSFET, the DC resistance between the gate and the rest of the circuit is practically infinite. It is more likely that a very large resistor (like 10 megaohms) is setting the input impedance because the gate by itself could pick up electrostatic voltage that might destroy the device. A high resistance like that is great when you make measurements because it is very unlikely to disturb the circuit you are trying to measure and it leads to more accurate measurements.

Continue reading “Heathkit IM-13 VTVM Repair”

Solar Cells, Half Off

A company named Leap Photovoltaic claims they have a technology to create solar panels without silicon wafers which would cut production costs in half. According to [FastCompany] the cells are still silicon-based, but do not require creating wafers as a separate step or — as is more common — acquiring them as a raw material.

The process is likened to 3D printing as silicon powder is deposited on a substrate. The design claims to use only a tenth of the silicon in a conventional cell and requires fewer resources to produce, too.

Continue reading “Solar Cells, Half Off”

The Linux X86 Journey To Main()

Have you ever had a program crash before your main function executes? it is rare, but it can happen. When it does, you need to understand what happens behind the scenes between the time the operating system starts your program and your first line of code in main executes. Luckily [Patrick Horgan] has a tutorial about the subject that’s very detailed. It doesn’t cover statically linked libraries but, as he points out, if you understand what he does cover, that’s easy to figure out on your own.

The operating system, it turns out, knows nothing about main. It does, however, know about a symbol called _start. Your runtime library provides this. That code contains some stack manipulation and eventually calls __libc_start_main which is also provided by the library. Continue reading “The Linux X86 Journey To Main()”

DIY CNC Uses Lots Of 3D-Printed Parts

There are probably almost as many DIY CNC designs as there are DIY CNCs. And there’s nothing wrong with that! We really liked [maxvfischer’s] documentation on GitHub for a machine he made based on a design by [Ivan Miranada].

In addition to a complete bill of materials, there are Fusion 360 files and very good instructions. There are several tips that seemed like they would help even if you were building similar machines.

The machine uses HTD5M belts instead of the more prevalent lead screw design. Everything slides on MGN12H slides. There are detailed photographs covering not just the tricky parts but even how to extend the stepper motor wires.

The original design used a Makita RT0700C for the spindle, but [max] couldn’t find one of those, but found a similar version with the same dimensions.

The only tip we would add is to be careful using taps in a handheld drill. (Don’t ask us how we know that.) A drill press is safer, or you can even use a tap handle and do it the old-fashioned way.

The firmware is grbl on an Arduino, and there are complete instructions for setting that up, too. We were amazed at the number of pictures included along with the detailed description. If you were ever afraid you couldn’t duplicate a CNC project, this might be the one to tackle.

There are, of course, cheaper and simpler options with fewer capabilities. Some are even almost free courtesy of the local dumpster.

Brain Implant Offers Artificial Vision To The Blind

Nothing makes you appreciate your vision more than getting a little older and realizing that it used to be better and that it will probably get worse. But imagine how much more difficult it would be if you were totally blind. That was what happened to [Berna Gomez] when, at 42, she developed a medical condition that destroyed her optic nerves leaving her blind in a matter of days and ending her career as a science teacher. But thanks to science [Gomez] can now see, at least to some extent. She volunteered after 16 years to have a penny-sized device with 96 electrodes implanted in her visual cortex. The research is in the Journal of Clinical Investigation and while it is a crude first step, it shows lots of promise and uses some very novel techniques to overcome certain limitations.

The 96 electrodes were in a 10×10 grid with the four corner electrodes missing. The resolution, of course, is lacking, but the project turned to a glasses-mounted camera to acquire images and process them, reducing them to signals for the electrodes that may not directly map to the image.

Continue reading “Brain Implant Offers Artificial Vision To The Blind”

DC UPS Keeps The Internet Up

We occasionally get annoyed that so much gear takes the ubiquitous “wall wart” these days. But one advantage is that the devices operate on DC voltage. [TechRally] takes advantage of this to create an automatic DC UPS with dual outputs to power a router and modem in the event of a power outage. You can see two videos about the project below.

Some may say it would be better to use conventional UPS, but think about it. That UPS has a battery in it that gets converted to AC so the wall wart can convert it back to DC. Each conversion loses some energy, of course, and in the case of a cheap wall wart, you may even lose quite a bit.

The project contains eight 18650 batteries, an off-the-shelf charge controller, and power converters. Could you do a more efficient custom design? Maybe, but the use of these inexpensive and commonly available modules makes it quick and easy to pull something like this together.

No one would mistake this UPS for a commercial unit, but it does have a certain hacker aesthetic. We wouldn’t carry it through an airport, though. With those digital displays and all the wiring, it looks like a bad TV show’s bomb prop.

If you don’t care about the automatic switchover, we hear that 5V will power a lot of equipment these days and that makes battery operation as simple as stripping a USB cable. This could probably drive some other gear like a connected Raspberry Pi. Or, you could do that job with some supercaps.

Continue reading “DC UPS Keeps The Internet Up”