Linux Fu: Curling C

Sometimes, it pays to read the man pages of commands you use often. There might be a gem hidden in there that you don’t know about. Case in point: I’ve used curl (technically, cURL, but I’m going to stick with curl) many times to grab data from some website or otherwise make a web request. But what happens if you want to do the same thing from a C program? Well, you could be lazy and just spawn a copy of curl. But it turns out curl has a trick up its sleeve that can help you. If only I’d read the man page sooner!

First Things

The simplest use of curl is to just name a URL on the command line. For example, consider this session:

$ curl http://www.hackaday.com 
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

This isn’t so useful because it is a 301 response (to send you to the https server, in this case). The -L option will make curl go get the page instead of the redirect. Try:

$ curl -L http://www.hackaday.com

Continue reading “Linux Fu: Curling C”

A 1960s PLC Gives Up Its Secrets

When it comes to process automation, the go-to part in most industrial settings is a Programmable Logic Controller, or PLC. These specialized computers will have a modern microcontroller running the show, but surprisingly the way they are programmed still has echoes of a time before electronic PLCs when such control would have been electromechanical.

[Thomas Scherrer] has an interesting design to tear down, it’s a Siemens electromechanical motor controller from the early 1960s. It’s not quite the huge banks of relays which would have made a fully-blown PLC back in those times, but it’s a half-way house with some simple programming capability in the form of several channels of adjustable time delay.

We’re partly sad to see this unit being subjected to a destructive teardown, but nevertheless it’s interesting to see all those very period components. The current sensor has a mechanism similar to a moving coil meter, and the four-channel timer is a mechanical sequencer with four adjustable cam-driven switches. We’re not sure we would be cracking open selenium rectifiers with such nonchalance though.

These units were built to a very high quality indeed, and though it’s obvious this one comes from a decommissioned installation it’s not beyond possibility to think there might be some of them still doing their job over six decades after manufacture. Have any of you seen one of these or something like it in operation recently? Let us know in the comments. Meanwhile the video is below the break.

Continue reading “A 1960s PLC Gives Up Its Secrets”

Electrical Steel: The Material At The Heart Of The Grid

When thoughts turn to the modernization and decarbonization of our transportation infrastructure, one imagines it to be dominated by exotic materials. EV motors and wind turbine generators need magnets made with rare earth metals (which turn out to be not all that rare), batteries for cars and grid storage need lithium and cobalt, and of course an abundance of extremely pure silicon is needed to provide the computational power that makes everything work. Throw in healthy pinches of graphene, carbon fiber composites and ceramics, and minerals like molybdenum, and the recipe starts looking pretty exotic.

As necessary as they are, all these exotic materials are worthless without a foundation of more familiar materials, ones that humans have been extracting and exploiting for eons. Mine all the neodymium you want, but without materials like copper for motor and generator windings, your EV is going nowhere and wind turbines are just big lawn ornaments. But just as important is iron, specifically as the alloy steel, which not only forms the structural elements of nearly everything mechanical but also appears in the stators and rotors of motors and generators, as well as the cores of the giant transformers that the electrical grid is built from.

Not just any steel will do for electrical use, though; special formulations, collectively known as electrical steel, are needed to build these electromagnetic devices. Electrical steel is simple in concept but complex in detail, and has become absolutely vital to the functioning of modern society. So it pays to take a look at what electrical steel is and how it works, and why we’re going nowhere without it.

Continue reading “Electrical Steel: The Material At The Heart Of The Grid”

Make Your Bookshelf Clickable

We’ll confess that we have a fondness for real books and plenty of them. So does [James], and he decided he needed a way to take a picture of his bookshelves and make each book clickable to find more information. This is one of those things that sounds fairly simple until you decide to do it. You can try an example of the results and then go back and read about the journey it took to get there.

There are several subtasks involved. First, you want to identify each book’s envelope. It wouldn’t do to click on the Joy of Cooking and get information about Remembrance of Things Past.

The next challenge is reading the title of the book. This can be tricky. Fonts differ. The book could be upside down. Some titles go cross the spine, but most go vertically. The remainder of the task is fairly easy. If you know the region and the title, you can easily find a link (for Google Books, in this case) and build an SVG overlay that maps the areas for each book to the right link.

Continue reading “Make Your Bookshelf Clickable”

Lift Those Pins With Ease

Reworking is one of the regular tasks of anyone who is involved in an electronic design process, because try as we might, it’s rare to get a design perfectly right the first time. Some reworking tasks are more difficult than others though, and we have to admit that lifting an IC pin doesn’t always result in success. But with this video from [Mr. SolderFix] there’s hope for conquering the technique, as he takes us through the best pin-raising technique on a variety of packages.

The trick it seems is to lift the pin first without attempting to disengage it from the molten solder, then returning to it with some copper braid to remove the solder and leave it raised. Once the secret is revealed it’s so easy, something a Hackaday scribe should be able to do. He does sound a note of caution though, as some packages are prone to disintegrating when stressed. A broken SOT-23 is not something anyone likes to see through their magnifier.

His channel is full of such no-nonsense soldering advice, and should be a fascinating browse for many readers. Meanwhile we’ve covered quite a bit of rework technique ourselves, such as last year when we looked at BGA work.

Continue reading “Lift Those Pins With Ease”

Developing In Pascal On The Commodore 64 With Abacus Super Pascal 64

Abacus Super Pascal 64 for the Commodore 64.

Most people associate the Commodore 64 with Commodore BASIC and precompiled applications, but it also had a number of alternative development environments produced for it. One of these was Super Pascal 64 by Abacus. A solid introduction to this software package is provided in a video tutorial by [My Developer Thoughts] on YouTube. This uses the Abacus Super Pascal 64 software and manual from the [Lyon Labs] website, which incidentally has a lot more development environments and operating systems for the C64 listed for your perusal.

Abacus’ Super Pascal supports the official Pascal language, requiring nothing more than a Commodore 64 and two Commodore 1541 floppy disk drives to get started. One FDD is for the Super Pascal software, which boots into the development environment, the other FDD and the disks in it are the target for the current project’s source code and compiled binary. Although the lack of support for FDDs other than the 1541 is somewhat odd, this comes presumably from the operating system nature of the development environment and the 1541 being by far the most common FDD for the C64.

Continue reading “Developing In Pascal On The Commodore 64 With Abacus Super Pascal 64”

Shuji Nakamura: The Man Who Gave Us The Blue LED Despite All Odds

With the invention of the first LED featuring a red color, it seemed only a matter of time before LEDs would appear with other colors. Indeed, soon green and other colors joined the LED revolution, but not blue. Although some dim prototypes existed, none of them were practical enough to be considered for commercialization. The subject of a recent [Veritasium] video, the core of the problem was that finding a material with the right bandgap and other desirable properties remained elusive. It was in this situation that at the tail end of the 1980s a young engineer at Nichia in Japan found himself pursuing a solution to this conundrum.

Although Nichia was struggling at the time due to the competition in the semiconductor market, its president was not afraid to take a gamble on a promise, which is why this young engineer – [Shuji Nakamura] – got permission to try his wits at the problem. This included a year long study trip to Florida to learn the ins and outs of a new technology called metalorganic chemical vapor deposition (MOCVD, also metalorganic vapor-phase epitaxy). Once back in Japan, he got access to a new MOCVD machine at Nichia, which he quickly got around to heavily modifying into the now well-known two-flow reactor version which improves the yield.

Continue reading “Shuji Nakamura: The Man Who Gave Us The Blue LED Despite All Odds”