Quantcast
Channel: Controlrede
Viewing all 4677 articles
Browse latest View live

Linux Fu: Watch That Filesystem

$
0
0

The UNIX Way™ is to cobble together different, single-purpose programs to get the effect you want, for instance in a Bash script that you run by typing its name into the command line. But sometimes you want the system to react to changes in the system without your intervention. For example, you might like to watch a directory and kick off some program automatically when a file appears from a completed FTP transaction, without having to sit there and refresh the directory yourself.

The simple but ugly way to do this just scans the directory periodically. Here’s a really dumb shell script:

#!/bin/bash
while true do for I in `ls` do cat $I; rm $I done sleep 10
done

Just for an example, I dump the file to the console and remove it, but in real life, you’d do something more interesting. This is really not a good script because it executes all the time and it just isn’t a very elegant solution. (If you think I should use for I in *, try doing that in an empty directory and you’ll see why I use the ls command instead.)

Increase Elegance

Honestly, you want something more elegant right? Modern kernels (2.6.13 and later) have filesystem notifications in the form of an interface called inotify. You can use these calls programmatically with the sys/inotify.h header file. There is also a set of command-line programs you can install, usually packaged as inotify-tools.

One of those tools is inotifywait and it makes for a nicer script. For example:

#!/bin/bash
while true do if FN=`inotifywait –e close_write,moved_to --format %f .` then cat $FN rm $FN fi done

That’s better, I think. It doesn’t wake up frequently, only when something has changed. I figure any sane program putting something in the directory will either open the file for writing and close it, or it will move it. Either way will work and the %f tells the command to report the file name. There are other events you can wait for as well, of course.

If you are wondering why the move case is necessary, think about how most text editors and network download software works. Usually, a new file doesn’t have the final name until it is complete. For example, Chrome will download the file test.txt as test.txt.crdownload or something like that. Only when the file is done will it rename (move) the file to test.txt.

If you want to try the command without a script so you can see the effect, just open up two terminal windows like this:

In the lower terminal, issue the inotifywait command. Don’t forget the period at the end which tells it to monitor the current directory. Then in the other terminal create a file in the same directory. The name of the file will appear in the first terminal and the program will exit. The script just takes advantage of this behavior to set the FN variable, takes action, and then relaunches inotifywait. You can ask the program not to quit, by the way, but that makes scripting a little more difficult. However, it also removes the problem of a file changing while you are doing your processing.

The other command line, inotifywatch, also outputs file change events but it watches for a certain amount of time and then gives you a summary of changes. I won’t talk about it any further. If you think you need that capability, you can read the man page.

A New Cron

The script is still less than ideal, though. Presumably, a system might have lots of different directories it wants to monitor. You really don’t want to repeat this script, or a variation of it, for each case.

There is another program for that, called incron (you will almost surely have to install this one). The incron program is like cron but instead of time-based events, the events are based on file notifications. Once you install it, you will probably have to change /etc/incron.allow and /etc/incron.deny if you want to actually use it, especially as a normal user.

Suppose you want to run a script when a file appears in the hexfiles directory. You can use the command incrontab -e to edit your incron table. The format is very picky (it wants spaces, not tabs, for example). Here’s a line from the file that will do the job:

/home/alw/Downloads/hexfiles IN_CLOSE_WRITE,IN_MOVED_TO /home/alw/bin/program_cpu $@/$#

The $@/$# at the end provides a full path to the file affected. You can also grab the vent time as text ($%) or a number ($&). You can monitor all the usual events and also set options to do things like not dereference symbolic links. You can find it all in the incron man pages.

GUI

I’m not a big fan of GUI editors, but I know I’m in the minority. If you like, there’s a Java-based incrontab editor available. There isn’t much documentation, but you can import your incrontab — if it exists — from /var/spool/incron/your_user_id. If you look at the image below, you can see it offers a form that builds the incron table line for you.

You can find the system files in /etc/incron.d, usually. All the locations can be set by the /etc/incron.conf file, so if you aren’t sure where to look or you want to change the location for the table files, start there.

Go Forth and Watch

Using incron is quite elegant. A system program does all the waiting and our script only runs when necessary. It is easy to look and see all the things you have notifications set for. You can do a lot with these tools, and not just in the embedded space. How are you going to use them?


Vaporwave For The Parallel Port

$
0
0

FM synthesis is the sound of the 1980s, it’s the sound of shopping malls and Macintosh Plus. It’s the sound of the Motorola DynaTAC, busts of Helios, and the sound of vaporwave サ閲ユ. The chips most responsible for this sound is the OPL2 and OPL3, tiny little FM synthesizers on a chip, produced by Yamaha, and the core of the AdLib and Sound Blaster sound cards. It’s the chip behind the music in all those great DOS games.

Unfortunately, computers don’t have ISA slots anymore, and cards don’t work in 486 and Pentium-based laptops, the latest hotness for retrocomputing enthusiasts. For his Hackaday Prize entry, [serdef] is bringing the sound of the 80s to the parallel port with the OPL2LPT. It’s a sound card for the parallel port that isn’t just a resistor DAC like the Covox Speech Thing.

The design of the OPL2LPT is pretty much what you would expect; it’s an OPL2 chip, opamp, a 1/8″ jack, and a few passive components. The real trick here is in the driver; by default, every DOS game around expects an Adlib card on port 338h, whereas the parallel post is at 378h. A driver takes care of this in software, but it is possible to patch a game to change every write to an Adlib card to a write to a parallel port.

Already, [serdef]’s parallel port graphics card is a real, working product and has caught the attention of Lazy Game Reviews and the 8-Bit-Guy, you can check out those video reviews below.

WiFi Pool Controller Only Cost $20

$
0
0

Pools have come a long way. It used to be you had a pump and if you were lucky it had a mechanical timer switch on it. That was it. Now you have digital controllers and spa jets and heaters. You can even get them that connect to your home automation system. If your pool isn’t new enough to do that already, you can get a range of add-on accessories. For a price. [Rob] paid $500 to get a remote for his pool. It wasn’t even WiFi, just a simple RF remote. In 3 years, the transmitter had burned out ($300 to replace) and he decided he had enough. For $20, [Rob] added MQTT control and monitoring to his pool using an ESP8266. You can see the video description of the project below.

Naturally, the instructions are a bit specific to the Pentair system he has. However, it isn’t as specialized as you might think. The project relies on the connection for a wired “spa-side remote” that most modern pool systems support. The electrical connections for these aren’t quite standard, but they are all very similar, so you have a good chance of reproducing this for your setup assuming you have a connection for one of these wired remotes.

The remote has a few buttons and LED for status. The LED reacts differently depending on the pool’s current mode, so connecting there not only gives you control but also allows you to provide some limited status. It isn’t going to let you monitor pump currents or anything exotic, but it is a simple place to gain access. Using the Arduino pulse input function makes it easy to sense if the LED is on, off, or blinking. Another sensor reads the water temperature. The controller makes it available, but it isn’t simple to read, so the project just reads the raw sensor voltage from the existing thermistor and computes the temperature.

[Ron] does a nice job of explaining some basic concepts like using opto-isolators. However, the real value to the video is the easy way to interface to the existing controller. A little configuration into Home Automation rounds out the project.

If you have an older system, you might like to see more of a pool system rebuild. If you are interested in controlling the pool chemistry, we’ve seen that before, too.

VCF East: SDR on the Altair 8800

$
0
0

You’d be forgiven if you thought software defined radio (SDR) was a relatively recent discovery. After all, few outside of the hardcore amateur radio circles were even familiar with the concept until it was discovered that cheap USB TV tuners could be used as fairly decent receivers from a few hundred MHz all the way up into the GHz range. The advent of the RTL-SDR project in 2012 brought the cost of entry level SDR hardware from hundreds of dollars to tens of dollars effectively overnight. Today there’s more hackers cruising the airwaves via software trickery than there’s ever been before.

But as it turns out, the RTL-SDR project wasn’t the first time software and hardware serendipitously combined to allow hackers to pull back the curtain on the world of radio. All the way back in 1975, an article written by Steve Dompier was published in the People’s Computer Company Newsletter and republished in Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia in 1976 that described a very curious discovery. Nearly a decade before a team at Raytheon would coin the term “software radio”, the article showed that with just a few lines of code one could generate AM radio transmissions from their MITS Altair 8800.

At the time, this was a huge deal. Some even argue that it made an AM radio one of the first I/O devices for use with the Altair 8800. At demonstration of the code at a meeting of the Homebrew Computer Club reportedly ended in a round of wild applause, and Bill Gates would later describe it as one of “The best demo programs I’ve seen for the Altair.” A particularly strong endorsement, considering at this point Gates would have been pushing Microsoft’s BASIC language for the Altair, which this technique didn’t use.

At the recent Vintage Computer Festival East, Bill Degnan showed off an evolved version of Dompier’s original concept that he calls “Altair Jukebox” (on this page you can also find a PDF version of Steve Dompier’s 1975 article). Even 43 years after the discovery that the Altair could perform such a feat, it delighted everyone who stopped by the table. With the LEDs flickering away as the songs came strong and clear through the nearby vintage AM radio, the whole thing seemed almost magical. It’s no wonder Bill Gates was impressed.

How Does it Work?

Naturally, more than a few people wanted to know exactly how the music was being generated. For awhile Bill even had the top off of the Altair so you could see inside; akin to the magician pulling up his sleeves so you can see he wasn’t hiding anything. No, there was no little AM radio transmitter hidden inside the Altair, the effect is simply the product of carefully generated electromagnetic interference (EMI). In truth, it’s due more to a design flaw in the Altair than anything else.

Inadequate EMI shielding in the computer allows a nearby radio to pickup the switching noise of the electronics, causing considerable interference in the low AM frequencies when it’s in operation. Similar effects have been observed with other computers of the era, such as the PDP-8. You can pickup the interference regardless of what program is running on the Altair, it’s just that most programs will generate unstructured noise. But with skillful manipulation of this effect, it’s possible to create something that’s actually quite pleasant sounding.

As it so happens, this is almost precisely the mechanism which has recently allowed the use of cheap USB VGA adapters as software defined transmitters. The interference generated by the device, normally nothing more than an annoyance, is expertly honed to become a useful transmission. Seems like the best tricks never get old.

Taking Requests

Bill took the original research published in Dr. Dobb’s and created a much more polished experience. Rather than having to toggle in data for each song you want to hear on the front panel, the user now has access to a menu which allows them to select from pre-defined pieces stored in the program. The upshot of all this is that anyone could sit down at the table and call up a song without any knowledge of the software or even the Altair itself necessarily.

As an added bonus, Bill had set up an absolutely mint TRS-80 Model 102 as the terminal for the day’s demonstration. Which served as both an excellent example of the incredible battery life the Model 100/102 could achieve with nothing but AA batteries, and a chance for attendees to get hands on time with something different in a sea of green and orange CRT terminals.

The dichotomy between the Altair with its brazen LEDs flickering away madly and the overtly 1980’s Model 102 definitely stood out on the show floor, and it seemed the chair in front of the Tandy was rarely empty. Based solely on the number of times one could hear it launch into the Star Wars theme during the course of the show, it’s safe to say this demonstration was a huge hit today. Just as it was all those years ago at the Homebrew Computer Club.

Minimum Viable 1-D PONG

$
0
0

What makes a game a game? Like, how do we know that we’re looking at a variation of PONG when confronted with one? And how do we know how to play it? [Bertho] sought to answer this question as he designed what is probably the smallest-ever 1-D PONG game. His answer involves charlieplexing LEDs, using a voltage divider to save I/O pins, and a couple of AAAs that should last for a long, long time.

[Bertho]’s Minimum 1-D PONG, or m1dp for short, puts an ATTiny85 through its paces as gameplay quickly progresses from ‘I got this’ to ‘no one could possibly keep this up’. This state machine sleeps until one of the two buttons is pressed, at which time a wait animation starts. The action begins with the next button press.

Game play across only five LEDs makes for some pretty intense action, too. Fortunately, the buzzer is a big part of the experience. It sounds one tone for each LED when the ball is in play, and a different tone to confirm button presses. [Bertho] saved so many I/O pins with charlieplexing that he added a green LED that lights up when it’s OK to return the ball. If we were playing, we’d keep our eye on this LED instead of trying to watch the ball. We’re serving the demo after the break point, so don’t let it get past you.

For a study in minimalism, there sure is a lot going on here with all the different tones and animations. If you’d prefer maximalist 1-D PONG, there’s always LED strips. If dungeon crawlers with satisfying hardware are more your thing, you really need to check out Twang.

Via [Dangerous Prototypes]

Biasing That Transistor Part 4: Don’t Forget the FET

$
0
0

The 2N3819 is the archetypal general-purpose N-channel FET. (ON Semiconductor)The 2N3819 is the archetypal general-purpose N-channel FET. (ON Semiconductor)

Over the recent weeks here at Hackaday, we’ve been taking a look at the humble transistor. In a series whose impetus came from a friend musing upon his students arriving with highly developed knowledge of microcontrollers but little of basic electronic circuitry, we’ve examined the bipolar transistor in all its configurations. It would however be improper to round off the series without also admitting that bipolar transistors are only part of the story. There is another family of transistors which have analogous circuit configurations to their bipolar cousins but work in a completely different way: the Field Effect Transistors, or FETs.

In a way it’s less pertinent to look at FETs in the way we did bipolar transistors, because while they are very interesting devices that power much of what you will do with electronics, you will encounter them as discrete components surprisingly rarely. Every CMOS device you deal with relies on FETs for its operation and every high-quality op-amp you throw a signal at will do so through a FET input, but these FETs are buried inside the chip and you’d be hard-pressed to know they were there if we hadn’t told you. You’d use a FET if you needed a high-impedance audio preamp or a low-noise RF amplifier, and FETs are a good choice for high-current switching applications, but sadly you will probably never have a pile of general-purpose FETs in the way you will their bipolar equivalents.

That said, the FET is a fascinating device. Join us as we take an in-depth look at their operation, and how and where you might use one.

FET basics

A diagram of an n-channel JFET. As the negative gate voltage on the p-type silicon decreases in the lower diagram, its electric field restricts the area through which electrons can flow in the n-type channel. Chtaube,(CC BY-SA 2.0 DE)A diagram of an n-channel JFET. As the negative gate voltage on the p-type silicon decreases in the lower diagram, its electric field restricts the area through which electrons can flow in the n-type channel. Chtaube,(CC BY-SA 2.0 DE)

A basic FET has three terminals, a source (the source of electrons), a gate (the control terminal), and a drain (where electrons leave the device). These are analogous to the terminals on a bipolar transistor, in that the source fulfills a similar role to the emitter, the gate to the base, and the drain to the collector. Thus the three basic bipolar transistor circuit configurations have equivalents with a FET; common-emitter becomes common-source, common-base becomes common-gate, and an emitter follower becomes a source follower. It is dangerous to stretch the analogy between bipolar transistors and FETs too far, though, because of their different mode of operation. A closer similarity exists between a FET and a triode tube, if that helps.

The simplest FET for demonstration purposes has a piece of N-type semiconductor with source and drain connections at opposite ends, and a zone of P-type semiconductor deposited in its middle. This is referred to as an N-channel junction FET or JFET, because the channel through which current flows is N-type semiconductor, and because a diode junction exists between gate and channel. There are equivalent P-channel devices, just as there are PNP and NPN bipolar transistors.

Were you to bias an n-channel JFET as you would a bipolar transistor with a positive bias on its gate, the diode between gate and source would conduct, and the transistor would remain a diode with two cathode terminals. If however you give the gate a negative bias compared to the source, the diode becomes reverse-biased, and no current to speak of flows in the gate.

A characteristic of a reverse-biased diode is that it has a depletion zone between anode and cathode, an area in which there are no electrons. This is what causes the diode to no longer conduct, and the size of the depletion zone depends upon the size of the electric field that exists across it. If you’ve ever used a varicap diode, the capacitance between the two sides of this variable-width zone is the property you are exploiting.

In a FET, the depletion zone stretches from the gate region into the channel, and since its size can be adjusted by the gate voltage it can be used to “pinch” the remaining conductive region within the channel. Thus the area through which electrons can flow is controlled by the gate voltage, and thus the current that flows between drain and source is proportional to the gate voltage. We have an amplifier.

A simple FET radio receiver circuit showing FET biasing. The gate is biased at ground potential through the inductor, and the source is held above ground by the current in the 5K resistor. Herbertweidner [Public domain].A simple FET radio receiver circuit showing FET biasing. The gate is biased at ground potential through the inductor, and the source is held above ground by the current in the 5K resistor. Herbertweidner [Public domain].In the JFET diagram above, the negative gate bias is represented by a battery. Tube enthusiasts may have encountered equipment that derives negative grid bias from a power supply, and you will find tube power units that include a -150 V rail for this purpose. In general though this is inconvenient in a FET circuit even though the voltage is lower, because of the extra cost of a negative regulator.. Instead the gate is held at a lower potential than the source by careful selection of a source resistor such that the current flowing through it brings the source up above ground, and a gate bias circuit that holds the gate close to ground. The base resistor chain from the bipolar circuit is for this reason often replaced with either a single resistor to ground, or a gate circuit with a very low DC resistance to ground such as an inductor.

MOSFETs, where the FET becomes more useful

Internal structure of an N-channel MOSFET. Fred the Oyster [Public domain].Internal structure of an N-channel MOSFET. Fred the Oyster [Public domain].The JFET we have described is the simplest of field-effect devices, but it is not the one you will encounter most frequently. MOSFETs, short for Metal Oxide Semiconductor FETs, have a similar source, gate, and drain, but instead of relying on a depletion zone in a reverse-biased diode, they have a thin layer of insulation. The electric field from the gate acts across this insulation and pinches the conductive region in the channel through repulsion of electrons, with the same effect as it has in the JFET. It is beyond the scope of this piece to go into their mechanisms, but you will encounter two types of MOSFET: depletion mode devices that require the same negative bias as the JFET, and enhancement mode MOSFETS that require a positive bias.

Why would you use a FET?

So we’ve described the FET, and noted that while its mode of operation is different to that of a bipolar transistor it does a substantially similar job. Why would we use a FET then, what advantages does it offer us? The answer comes from the gate being insulated either by a depletion region in a JFET or by an insulating layer in a MOSFET. A FET is a voltage amplifier rather than a current amplifier, its input impedance is many orders higher than that of a bipolar transistor, and thus you will find FETs used in many applications that require a high impedance small-signal amplifier. The input of a high-performance op-amp will almost certainly be a FET, for example.

This half-bridge power MOSFET driver circuit uses a specialist gate driver IC with a pair of Schmidt buffers to deliver the initial surge required for a fast-turn-on time. Wdwd (CC BY 3.0).This half-bridge power MOSFET driver circuit uses a specialist gate driver IC with a pair of Schmidt buffers to deliver the initial surge required for a fast-turn-on time. Wdwd (CC BY 3.0).

The high input impedance has another effect less coupled to small signal work. Where a bipolar transistor requires significant base current to turn itself on, the corresponding FET requires almost none. Thus almost all complex integrated circuit logic devices are FET-based rather than bipolar because of the huge power saving that can be made by not needing to supply the base current demands of many thousands of bipolar transistors.

The same effect influences the choice of FETs for power switching, while a bipolar transistor’s base current is proportional to its collector current and thus it will need a significant driver, by contrast a power MOSFET requires virtually no standing gate current after an initial surge. A MOSFET power switch can thus be built requiring much less in the way of drive electronics and much more efficiently than a corresponding bipolar switch, and makes possible some of the tiny driver boards you might be used to for driving motors in your 3D printer, or your multirotor.

Through the course of this series you should have acquired a solid grounding in basic bipolar transistor principles, and now you should be able to add FETs to that knowledge base. We suggested you buy a bag of 2N3904s to experiment with in one of the previous articles, can we now suggest you do the same with a bag of 2N3819s?

Turning Tact Switches Into Keyboards

$
0
0

One of the great unsolved problems in the world of DIY electronics is a small keyboard. Building your own QWERTY keyboard is a well-studied and completely solved problem; you need only look at the mechanical keyboard community for evidence of that. For a small keyboard, though, you’d probably be looking at an old Blackberry handset, one of those Bluetooth doohickies, or rolling your own like the fantastic Hackaday Belgrade badge. All of these have shortcomings. You’ll need to find a header for the Blackberry keyboard’s ribbon cable, the standard Bluetooth keyboard requires Bluetooth, and while the Belgrade badge’s keyboard works well, it’s a badge, not a keyboard you would throw in a bag for years of use.

[bobricious] might have just cracked it. For his Hackaday Prize entry, he’s created a tiny USB keyboard out of tact switches. What’s the secret? An entire panel of PCBs. It looks great, and it might just hold up to the rigors of being tossed in a random bag of holding filled with electronics.

The electronics for the keyboard are simple enough; there are 56 standard through-hole tact switches, and an SAMD21 microcontroller. Connections to the outside world are through a micro USB port, serial, or I2C. it’s small, too, coming in at just under 5 cm by 10 cm.

The real trick here is using a stack of PCBs to label the buttons and provide a bit of mechanical support. The panel for this project consists of one base board holding all the electronics and a secondary board that gives the entire project a finished look while adding a bit of structural support.

If you’ve never looked at the options for small keyboards, there aren’t many. Blackberries are a thing of the past, and there’s no good way to add a QWERTY keyboard to small projects. This project does that in spades. Since the basic idea is, ‘put holes in a second PCB’, this idea is transferable to other keyboard layouts too.

CalClock Keeps You Tied To The Mast

$
0
0

Now that most of what we do revolves around our phones and/or the internet, it’s nearly impossible to take a short break from work to check the ol’ calendar without being lured by the sirens on the shore of social media. Well, [samvanhook] was tired of being drawn in when all he really needs is a vague idea of what’s coming up for him in the next 12 hours. Enter the CalClock.

Thanks to color-coded segments, [sam] can tell at a glance if he has something coming up soon in Google Calendar, or if he can dive back into work. When nothing is scheduled, the segments are simply unlit.

We love the mid-century minimal look and craftsmanship of CalClock. This beauty runs on a Raspi Zero W, which fetches the 411 through the gooCal API and lights up the appropriate NeoPixels arrayed behind standard clock movement-driven hands.  [sam] could have diffused the NeoPixels with a single sheet of acrylic, but he went the extra mile to route and sand little acrylic ice cubes for all 24 segments.

Want more control of your day? [sam] took the time to upload both the clock face model and the code so you can. If you need help just getting started each day, check out this calendar-polling Raspi alarm clock.


Arduino Analog I/O Multiplexer

$
0
0

[SeanHodgins] has a project in mind where he needs to sample over 500 analog sensors. To get ready, he made a breakout board for 32-channel analog multiplexer device he wants to use. He put the project out on Hackaday.io and also has a video tutorial you can see below.

There are five input pins to the chip which lets you connect one analog pin to any one of 32 analog pins. Of course, in addition to the five control lines, you need some handshaking lines, too so you could use as many as eight digital pins to control the device.

The device in question is an ADG732. The board layout and the source code is all available on GitHub. Because the switches are analog, they are bidirectional. That is, it isn’t really connecting one output to 32 inputs. It is more like a 32-position switch that connects a single pin out of 32 to one other pin.

Keep in mind that these sort of devices have some practical limitations. For example, the switch resistance is nominally 4 ohms at room temperature. The switches that route the signals also have some capacitance that varies depending on if they are on or off. There’s nothing wrong with any of this, of course. But it isn’t quite the same as having, for example, a 32-position rotary switch. Of course, it can switch faster than a mechanical switch and is easy to control, so — as always — its a tradeoff.

Notice, too, that the mux chip can operate rail-to-rail. However, for some applications, you’ll need a negative supply and the device can accept a +/- 2.5V  supply for that purpose.

There are a lot of uses for something like this. Routing audio signals, for example, or switching between multiple test points in an automatic test system. We looked at a mux last year with a paltry eight channels. Then again, you can always go old school and make mechanical multiplexers.

Restoring an Atari 800 XL that’s Beyond Restoring

$
0
0

Sometimes the best way to get a hacker to do something is to tell them that they shouldn’t, or even better can’t, do it. Nothing inspires the inquisitive mind quite like the idea that they are heading down the road less traveled, if for nothing else to say that they did it. A thrown gauntlet and caffeine is often all that stands between the possible and the impossible.

Preparing the PCB for epoxy injection

So when [Drygol] heard a friend comment he had an old Atari 800 XL that was such poor shape it couldn’t be repaired, he took on the challenge of restoring the machine sight unseen. Luckily for us, his pride kept him from backing down when he saw the twisted and dirty mess of a computer in person. He’s started documenting the process on his blog, and while this is only the first phase of the restoration, the work he’s done already is impressive enough that we think you’ll want to follow him along on his quest.

There’s no word on what happened to this miserable looking Atari, but we wouldn’t be surprised if it was run over by a truck. The board was cracked and twisted, with some components missing entirely. The first step in this impossible restoration was straightening the PCB, which [Drygol] did by clamping it to some aluminum bar stock and heating the whole board up to 40C (104F) for a few days. Once the got most of the bend out, he used a small drill bit to put holes in the PCB laminate and inject epoxy to add some strength. It’s an interesting technique, and the results seem to speak for themselves.

Once the board was straight, he went through replacing blown passive components and broken chip sockets. All the ICs were pulled and treated to an isopropyl alcohol and acetone bath in an ultrasonic cleaner to get them looking like new again. The CPU was cooked and needed to get swapped out, but otherwise it was smooth sailing, and before long he had the machine booted up. While most would have been satisfied to just get this far, [Drygol] considers this to be the easy part.

He next straightened out the metal shielding with a mallet, sanded it down, and sprayed it with a new zinc coating. The plastic around the keyboard and the metal trim pieces were also removed, cleaned, and refinished where necessary. Rather than going for perfection, [Drygol] intentionally left some issues so the machine didn’t look 100% pristine. It’s supposed to be a functional computer, not a museum piece behind glass.

We’ll have to wait until the next entry in this series to see how he repairs the absolutely devastated case. Any rational person would just use a case from a donor machine, but we’ve got a feeling [Drygol] might have something a little more impressive in mind.

In the meantime we’ve got plenty of incredible restorations to keep you occupied, from this sunken VIC-20 to a Pi-packing Osborne.

Monotron Gets All the Mods

$
0
0

[Harry Axten] turned the diminutive Korn Monotron into a playable analog synthesizer, complete with a full-sized keyboard spanning two octaves and a MIDI interface.

Korg Introduced the Monotron analog mini-synthesizer back in 2010. They also dropped the schematics for the synth. Hackers wasted no time modifying and improving the Monotron. [Harry] incorporated several of these changes into his build. The Low-Frequency Oscillator (LFO) has been changed over to an envelope generator. The ribbon controller is gone, replaced with a CV/gate interface to sound notes.

The CV/gate interface, in turn, is connected to an ATMega328P which converts it to MIDI. MIDI data comes from one of two sources: A two-octave full-sized keyboard pulled from a scrapped MIDI controller or a MIDI connector at the back.

The user interface doesn’t stop with the keyboard. The low-cost pots on the original Monotron have been replaced with much higher quality parts on the front panel. The tuning pot is a 10-turn device, which allows for precision tuning. All the mods are mounted on a single board, which is connected to the original Monotron board.

The fruit of all hard work is an instrument that is a heck of a lot of fun to play. Check it out in the video below. Want more? You can read all about hacking about the Monotron’s bigger brother, the Monotribe.

No Microcontroller In This Vending Machine, D’oh!

$
0
0

You might think that a microcontroller would be needed to handle a vending machine’s logic. For one thing, only the correct change should activate them and the wrong change should be returned.  If the correct change was detected then a button press should deliver the right food to the dispenser. But if you like puzzles then you might try to think of a way to do with without a microcontroller. After all, the whole circuit can be thought of as a few motors, a power source, and a collection of switches, including the right sized coin.

That’s the way [Little Puffin] approached this donut dispensing vending machine. What’s really fun is to watch the video below and wonder how the logic will all come together as you see each part being put in place. For example, it’s not until near the end that you see how the coin which is a part of the circuit is removed from the circuit for the next purchase (we won’t spoil it for you). Coins which are too small are promptly returned to the customer. To handle coins which are the right size but are too heavy, one enhancement could be to make them fall through a spring-moderated trap door and be returned as well. We’re not sure how to handle coins which are the right size but too light though.

We really like these low tech hacks which do seemingly high tech things. Check out this electromechanical jet engine model which has a clever switch mechanism that’ll have you scratching your head. Or if you’re hungry for more vending machine food, feast your eyes on Venduino, which is the next step up in that it sports an Arduino, an LCD screen, is lit up inside, and sports a laser-cut birch plywood case.

This Is An Inordinate Amount Of Switches

$
0
0

How do you start a good habit? As a blogger, someone who spends a spectacular amount of time on Twitter, and a Thought Leader Life Coach, I can tell you: the best way to start a good habit is by doing it every day. [Arduino Enigma] has just the solution to procrastination, laziness, or whatever else is stopping you from forming a good habit. It’s a good habit tracker, and far too many switches on a single PCB.

The inspiration for this build comes from the master of shitty robots, [Simone Giertz], who built something containing 365 switches and 12 LEDs. The idea is simple: every day, [Simone] would do 10 minutes of yoga and 10 minutes of meditation, then flip a switch. At the end of the month, an LED would light up. Do it every day for a year, and all the lights are on, hopefully beginning a new, good habit.

[Simone]’s version is rather large, and quite possibly used panel-mount switches. Where there’s a will, there’s someone able to make a PCB, so [Arduino Enigma] whipped up a board with 365 switches, 12 resistors, and 12 LEDs.

The circuit for this good habit tracker is extremely simple. It’s simply power going into 30, 31, or 28 switches in series, one after the other. At the end of the month, the LED lights up.

Is it complicated? No, but that’s not exactly the point. We’re hacking behavior here and not electrons, although this is a great example of how PCBs can be simultaneously far too complicated and far too simple.

Coming Back to Curving Bullets

$
0
0

What do you do when you have time, thousands of dollars worth of magnets, and you love Mythbusters? Science. At least, science with a flair for the dramatics. The myth that a magnetic wristwatch with today’s technology can stop, or even redirect, a bullet is firmly busted. The crew at [K&J Magnetics] wanted to take their own stab at the myth and they took liberties.

Despite the results of the show, a single magnet was able to measurably alter the path of a projectile. This won’t evolve into any life-saving technology because the gun is replaced with an underpowered BB gun shooting a steel BB. The original myth assumes a firearm shooting lead at full speed. This shouldn’t come as any surprise but it does tell us how far the parameters have to be perverted to magnetically steer a bullet. The blog goes over all the necessary compromises they had to endure in order to curve a bullet magnetically and their results video can be seen below the break.

Here we talk about shooting airplane guns so they don’t get mislead after leaving the barrel, and some more fun weaponry from minds under Churchill’s discretion.

Fail Of The Week: Never Trust A Regulator Module

$
0
0

[Ryan Wamsley] has spent a lot of time over the past few months working on a new project, the Ultimate LoRa backplane. This is as its name suggests designed for LoRa wireless gateways, and packs in all the features he’d like to see in a LoRa expansion for the Nano Pi Duo.

His design features a three-terminal regulator, and in the quest for a bit more power efficiency he did what no doubt many of you will have done, and gave one of those little switching regulator modules in a three-terminal footprint a go. As part of his testing he inadvertently touched the regulator, and was instantly rewarded with a puff of smoke from his Nano Pi Duo. As it turned out, the regulator was susceptible to electrical noise, and had a fault condition in which its input voltage was routed directly to its output. As a result, a component in the single board computer received way more than its fair share, and burned out.

If there is a moral to be extracted from this story, it is to never fully trust a cheap drop-in module to behave exactly as its manufacturer claims. [Ryan]’s LoRa board lives to fight another day, but the smoke could so easily have come from more components.

So that’s the Fail of The Week part of this write-up complete, but it would be incomplete without the corresponding massive win that is [Ryan]’s LoRa board itself. Make sure to take a look at it, it’s a design into which a lot of attention to detail has been put.


Rubber Duck Debugging the Digital Way

$
0
0

Anyone who slings code for a living knows the feeling all too well: your code is running fine and dandy one minute, and the next minute is throwing exceptions. You’d swear on a stack of O’Reilly books that you didn’t change anything, but your program stubbornly refuses to agree. Stumped, you turn to the only one who understands you and pour your heart out to a little yellow rubber duck.

When it comes to debugging tools, this digital replacement for the duck on your desk might be even more helpful. Rubber duck decoding, where actually explaining aloud to an inanimate object how you think the code should run, really works. It’s basically a way to get you to see the mistake you made by explaining it to yourself; the duck or whatever – personally, I use a stuffed pig– is just along for the ride. [platisd] took the idea a step further and made his debugging buddy, which he dubs the “Dialectic Ball,” in the form of a Magic 8-Ball fortune teller. A 3D-printed shell has an ATtiny84, an accelerometer, and an LCD screen. To use it, you state your problem, shake it, and read the random suggestion that pops up. The list has some obvious suggestions, like adding diagnostic print statements or refactoring. Some tips are more personal, like talking to your local guru or getting a cup of coffee to get things going again. The list can be customized for your way of thinking. If nothing else, it’ll be a conversation piece on your desk.

If you’re more interested in prognostication than debugging, we have no shortage of Magic 8-Ball builds to choose from. Here’s one in a heart, one that fits in a business card, and even one that drops F-bombs.

Joe Grand is Hiding Data in Plain Sight: LEDs that Look Solid but Send a Message

$
0
0

Thursday night was a real treat. I got to see both Joe Grand and Kitty Yeung at the HDDG meetup, each speaking about their recent work.

Joe walked us through the OpticSpy, his newest hardware product that had its genesis in some of the earliest days of data leakage. Remember those lights on old modems that would blink when data is being transmitted or received? The easiest way to design this circuit is to tie the status LEDs directly to the RX and TX lines of a serial port, but it turns out that’s broadcasting your data out to anyone with a camera. You can’t see the light blinking so fast with your eyes of course, but with the right gear you most certainly could read out the ones and zeros. Joe built an homage to that time using a BPW21R photodiode.

Transmitting data over light is something that television manufacturers have been doing for decades, too. How do they work in a room full of light sources? They filter for the carrier signal (usually 38 kHz). But what if you’re interested in finding an arbitrary signal? Joe’s bag of tricks does it without the carrier and across a large spectrum. It feels a bit like magic, but even if you know how it works, his explanation of the hardware is worth a watch!

The demos of OpticSpy pulling data out of a seemingly solid red LED were a blast to see. I’m glad that Joe also spend time walking through the circuit:

He mentioned that he doesn’t always get to stretch his analog design chops and this was a good project for it. Likewise, I enjoy working my way through the schematic, which uses a double-stage amplifier to condition the signal from the optical sensor. The final stage is a comparator which spits out the digital signal. Not shown in the screenshot above is the FTDI chip that takes this signal and spits it out to your serial terminal.

Joe admits that it’s hard these days to find LEDs leaking data, so he got to make his own artificial sources. His demos included using the Parallax open conference badge, a laser diode driven by an Arduino, and Tomu, a microcontroller breakout board that hides in your USB port. The four trimpots allow for adjustment of the stages, something Joe had to do for the talk as the front of the room was getting blasted by the afternoon sun.

Following Joe’s presentation, Kitty Yeung took the stage. A PhD in Applied Physics, Kitty’s talent spans many areas and she is likely to introduce herself to you as a creative technologist. You may have bumped into her at this year’s Bay Area Maker Faire wearing a shoulder-mounted solar panel, but her wearable creations are well known beyond the maker community having had multiple designs shown during 2016 San Francisco Fashion Week.

During her talk Kitty showed off an amazing dress which used LEDs in the garment to light up different constellations. These were controlled by gestures that can be retrained based on the wearer’s preference. The effect is delightful, especially because it is designed to complement her own paintings woven into the garment material.

Unfortunately the labor that goes into creating such a piece means that the idea is difficult to scale. In the image above, Kitty is showing off three of her designs that she has already taken to market. They include her paintings, but not the technology she likes to add to her works. I find her open challenge quite interesting. Right now, anyone can order custom print fabrics. You can even place orders for garments that have mix-and-match components, like different cuts for the sleeves. Kitty wonders what will it take to bring eTextile technology to low-run manufacturing and looks to the engineering community to bring this to reality.

Unfortunately I don’t live in San Francisco, so it’s a rare treat to attend the Hardware Developer’s Didactic Galactic — a monthly meetup focused on developing electronic hardware that takes place each month at Supplyframe’s San Francisco office. There are always featured speakers like Kitty and Joe, but the audience that shows up is a great group of engineers working in all different parts of industry. If you’re in the area, this is a can’t-miss event.

Super Chromatic Peril Sensitive Sunglasses

$
0
0

The Joo Janta 200 super-chromatic peril-sensitive sunglasses were developed to help people develop a relaxed attitude to danger. By following the principle of, ‘what you don’t know can’t hurt you,’ these glasses turn completely opaque at the first sign of danger. In turn, this prevents you from seeing anything that might alarm you.

Here we see the beginnings of the Joo Janta hardware empire. For his Hackaday Prize entry, [matt] has created Nope Glasses. Is that meeting running long? Is your parole officer in your face again? Just Nope right out of that with a wave of the hand.

The Nope Glasses are two LCD shutters mounted in a pair of 3D printed glasses. On the bridge of the glasses is an APDS 9960 gesture sensor that tracks a hand waving in front of the glasses. Waving your hand down in front of the glasses darkens the shutters, and waving up makes them clear again. Waving left flashes between clear and dark, and waving right alternates each shutter.

In all seriousness, there is one very interesting thing about this project: how [matt] is attaching these LCD shutters to his glasses. This was done simply by taking a picture of the front and top of his glasses, converting those to 1-bit BMPs, and importing that into OpenSCAD. This gave him a pretty good idea of the shape of his glasses, allowing him to create an ‘attachment’ for his glasses. It’s great work, and we’d really like to see more of this technique.

Hacking When It Counts: The Magnetron Goes to War

$
0
0

In 1940, England was in a dangerous predicament. The Nazi war machine had been sweeping across Europe for almost two years, claiming countries in a crescent from Norway to France and cutting off the island from the Continent. The Battle of Britain was raging in the skies above the English Channel and southern coast of the country, while the Blitz ravaged London with a nightly rain of bombs and terror. The entire country was mobilized, prepared for Hitler’s inevitable invasion force to sweep across the Channel and claim another victim.

We’ve seen before that no idea that could possibly help turn the tide was considered too risky or too wild to take a chance on. Indeed, many of the ideas that sprang from the fertile and desperate minds of British inventors went on to influence the course of the war in ways they could never have been predicted. But there was one invention that not only influenced the war but has a solid claim on being its key invention, one without which the outcome of the war almost certainly would have been far worse, and one that would become a critical technology of the post-war era that would lead directly to innovations in communications, material science, and beyond. And the risks taken to develop this idea, the cavity magnetron, and field usable systems based on it are breathtaking in their scope and audacity. Here’s how the magnetron went to war.

Short But Powerful

For most of the early days of radio, most of the innovation was geared toward providing communication at a distance. Whether it be radiotelegraphy, radiotelephony, or even radio broadcasting, distance was the driver. The further a single transmitter could reach, the fewer links would be required to make a communicate between any two points, and the larger the audience that could be reached with a broadcast. Due to the physics of radio frequency propagation, this put all the action in the longer wavelengths, the space on the spectrum with wavelengths between about 10 meters and 100 meters or so.

Some researchers were looking further up the spectrum, where wavelengths better measured in centimeters are found. These frequencies wouldn’t be of much use for long-haul communications or broadcasting, but they needed to be explored and exploited, and so the tools and technologies needed to produce them would have to be developed.

One of the devices used to generate short-wavelength radio frequency waves was almost an accidental discovery, and like many great ideas, it started as a way to get around patent protections on somebody else’s great idea. Such was the case in 1917 when Albert Hull, a researcher at General Electric in the USA, was working on ways to control the flow of electrons in a vacuum tube without running afoul of Lee DeForest’s triode patents. DeForest’s tube used electric fields to control electron flows, so Hull experimented with magnetic fields to do the same. Hull named his invention a “magnetron.” His employer’s purchase of the triode patent put further development of the magnetron on the back burner, but not before Hull discovered that by carefully controlling the magnetic field at a critical value, the tube could emit radio frequency waves with a much shorter wavelength — less than a meter — than anything else at the time.

At the same time, physicists around the world were working on similar technologies to produce shorter wavelengths. German and Czech scientists used modified triodes to produce the first real microwave (1 GHz and above) oscillator, and Japanese scientist Hidetsugu Yagi, later famed for the Yagi-Uda antenna, developed his own magnetron design that produced wavelengths as short as 5.6 cm. Dutch, French, and English researchers got into the act as well, pushed down the wavelengths while increasing the radiated power by changing the design of the magnetrons.

Boot and Randall

Cavity magnetron by Mrjohncummings CC-BY-SA 2.0

With war on the horizon, few of them missed the fact that powerful, short-wavelength radio waves would be immensely useful for remote detection of aircraft and myriad other uses. Competition between countries for microwave supremacy was fierce — worldwide, no fewer than 2,000 patent applications were filed between 1920 and the end of the war in 1945. The simultaneous invention process was a sort of artificial selection process, where the good ideas were rapidly identified and used to improve designs. This process led to the cavity magnetron, a design with a cylindrical central cavity surrounded with similar holes arranged around it and connected to it by narrow slots. In use, a central cathode emits electrons which circle around the central cavity under the influence of a strong magnetic field, sweeping past the slots and inducing strong microwave fields inside the resonating cavities.

Correctly engineered, cavity magnetrons can produce powerful microwaves. For the British, the task of turning the cavity magnetron into a working device fell to John Randall and Harry Boot, physicists at the University of Birmingham. They were given a simple but lofty set of goals: build a microwave source of 1,000 watts with a 10-cm wavelength, specifically for airborne radars that could be used against the Germans and their near nightly bombing raids.

This would prove to be no mean feat because at the time, Boot and Randall had not even heard about the cavity magnetron. But they did their homework, and within a few weeks had built a prototype that was able to produce 400 W at a wavelength of 9.9 cm. This success led rapidly to improvements; they made their performance goal of 1 kW a week later, and in subsequent weeks 10- and even 25-kW magnetrons were constructed. Thanks to Boot and Randall, the magnetron was almost ready for battle.

Across the Pond

Unfortunately, the British had a problem. Surrounded by the enemy and virtually cut off from the rest of the world while mobilizing against the coming invasion, England had no resources to turn Boot and Randall’s magnetron into usable weapons. They faced a difficult decision: keep the secret and risk dying with them, or share the secret so that it could be used against the enemy. It was time to look across the Atlantic for help.

The idea of a technology swap with the Americans was the brainchild of Henry Tizard, head of the Aeronautical Research Committee, under whose auspices the magnetron had been engineered. Tizard proposed what was essentially a gift to the Americans, a bundle of every major secret the British had. This passel of technological treasure included not only the Boot and Randall magnetron, but designs for proximity fuzes, plastic explosive, self-sealing fuel tanks, rockets, superchargers, gunsights, and even papers detailing the feasibility of a nuclear fission bomb. With Churchill’s approval, almost every one of Britain’s hard-won secrets would be delivered to the Yanks, no strings attached, with only the hope that the uncommon bond between the two nations and the isolation and industrial power of the then-neutral US would result in something to help the war effort.

Cavity magnetron built in the 1940’s being unboxed in 2015 by the US Office of Naval Research

Six men, mostly from the military, formed what would be known as “The Tizard Mission.” They accompanied the secret stash, which included a working prototype of the Boot-Randal magnetron, on its almost inconceivably risky journey across the U-boat infested waters of the North Atlantic. Somehow, the Tizard mission arrived safely in Halifax, Nova Scotia, and was swiftly shuttled to Washington DC for meetings.

Within weeks, the prototype magnetron was handed over to Bell Labs in New Jersey, where the first 30 copies of the eventual one million that would be produced in America were made. The magnetron would eventually become small and light enough to be used in airborne radar sets, with larger, more powerful versions turned into shipboard and land-based sets. The magnetron had been weaponized, and there’s little doubt that it impacted the prosecution of the war.

It was said by historian James Phinney Baxter that the cavity magnetron the Tizard mission brought to America was “the most valuable cargo ever brought to our shores.” While certainly not an understatement given the importance and prevalence of microwaves in everything from communications to cooking, it’s hard to fathom the impact that all the treasures that simple tin box contained would have on the second half of the 20th century. Both in war and in peace, the Tizard Mission laid much of the technological foundations for the post-war era, with the cavity magnetron leading the way.

Bike-Driven Scarf Knitter is an Accessory to Warmth

$
0
0

Despite all our technological achievements, humans still spend a lot of time waiting around for trains. Add a stiff winter breeze to the injury of commuting, and you’ve got a classic recipe for misery. [George Barratt-Jones] decided to inject some warmth into this scene by inviting people to knit a free scarf for themselves by riding a bike.

All a person has to do is ride the Cyclo-Knitter for five minutes and marvel at their handiwork. By the time the scarf is finished, they’ve cycled past being cold, and they have something to hold in the warmth. Cyclo-Knitter is essentially an Addi Express knitting machine being belt-driven by a stationary bike. Power is transferred from the bike through large, handmade wooden gears using old bike tire inner tubes as belts. [George] built a wooden tower to hold the machine and give the growing scarf a protected space to dangle.

We love the utility of this project as much as the joy it inspires in everyone who tries it. Check out their scarves and their reactions after the break. We haven’t seen people this happy to see something they weren’t expecting since that billboard that kills Zika mosquitoes.

Via [r/woodworking]

Viewing all 4677 articles
Browse latest View live




Latest Images