Shared posts

06 Aug 09:03

Build a Baby Plasma Cutter–Right Now!

by Al Williams

What hacker doesn’t want a plasma cutter? Even if you aren’t MacGyver, you can probably build this one in a few minutes using things you have on hand. The catch? You probably can’t cut anything more than tin foil with it, and it is probably more a carbon-air arc gouger (which uses plasma) than a true plasma cutter. Still, as [Little Shop of Physics] shows on the video, it does a fine job of slicing right through foil.

If you are like us, you are back now after getting four 9V batteries, some tin foil, a pencil lead, and some clip leads and trying it. If you have more self-restraint than we do, you might want to think about what you are going to put the tin foil over. In the video, they used a laundry basket and a rubber band, but anything that keeps the foil suspended would do the trick.

Although it isn’t really a practical plasma cutter, we were thinking about strapping something like this to a 3D printer and cutting foil stencils. The jagged edges on the video are, hopefully, more from being operated by hand and less from the jagged mini-lightning bolt vaporizing the foil.

The video repeatedly talks about lead, but a pencil lead is confusingly not made of lead. It is actually graphite (a form of carbon) which makes it a good (and inexpensive) electrode for this application, even though it is mixed with a clay binder.

If you want something more practical, prepare to spend at least a few hundred dollars or more. You’ll need a source of gas (or maybe a few gasses), a high voltage supply in the MHz range, and a hefty constant current DC power supply. You might also want to throw in LinuxCNC.


Filed under: cnc hacks, misc hacks
31 Jul 13:01

Hacker Creates Thermal Probes by Welding with a PC Power Supply

by Nava Whiteford

[Illya Tsemenko] decided to build his own thermocouples from bare wire. [Illya] is interested in measuring the temperature of Liquid Nitrogen and for this he needed T-type probes. While you can buy these for about 20 bucks, he felt this was too expensive for what is essentially two pieces of wire and decided to build his own.

Thermocouples use the Seebeck effect, when a piece of metal is hot at one end, and cold at the other the electrons in the hot end will be more energetic and migrate towards the cold end, creating a voltage. While this migration occurs in single metal, it can’t easily be measured (as the voltage will be the same as the measurement point). For that reason thermocouples use two metals in which the migration occurs at different rates. This difference creates an overall migration in one direction, and a voltage can be measured which correlates to the temperature where the metals meet. Thermocouples are extremely common and have many applications.

In order to make his thermocouples [Illya] needed to weld the two metals together, and knocked together a quick welding rig using a PC power supply and graphite electrode from a powertool. The graphite electrode is important as it prevents oxidization during the welding process.

The process worked well, and [Illya] was able to make both K and T-type thermocouples and successfully measure temperatures down to -190 degrees C. Awesome work [Illya]!


Filed under: misc hacks
21 Jul 11:24

Why Is There Liquid Nitrogen On the Street Corner?

by James Hobson

Any NYC hackers may have noticed something a bit odd this summer while taking a walk… Giant tanks of the Liquid Nitrogen have been popping up around the city.

There are hoses that go from the tanks to manholes. They’re releasing the liquid nitrogen somewhere… Are they freezing sewer alligators? Fighting the Teenage Mutant Ninja Turtles? Or perhaps, cooling our phone lines??

Luckily, we now have an answer. Popular Science writer [Rebecca Harrington] got to investigate it as part of her job. As it turns out, the liquid nitrogen is being used to pressurize the cables carrying our precious phone and internet service in NYC. The cables have a protective sheath covering them, but during construction and repairs, the steam build up in some of the sewers can be too much for them — so they use liquid nitrogen expanding into gas to supplement the pressurized cables in order to keep the them dry. As the liquid nitrogen boils away, it expands 175 times which helps keep moisture out of the cables.

Sounds expensive, but apparently liquid nitrogen was the cheapest option. Helium is way too precious, liquid oxygen is combustible, and carbon dioxide is also more expensive than nitrogen. Who would have thought.

As for the public’s reaction to these tanks?

While the warning signs on the tanks may seem alarming, [Bonomo] said they have never exploded or significantly leaked in the city, but they have tipped over on occasion when a car has backed into them, for instance. The cans are so sturdy that toppling hasn’t caused any leaks, [Diachok] said, and Verizon technicians are able to simply stand them back up.

Did we mention the tanks also randomly release pressure by blasting liquid nitrogen into the air? It’s like a little poof of snow on a hot summer’s day…

In the future when everything is run through fiber optics we won’t have to waste liquid nitrogen on silly things like this. Then we can get back to making our own liquid nitrogen at home in order to super-cool our Arduinos!


Filed under: chemistry hacks, misc hacks
02 Jul 14:14

Logic Noise: Ping-pong Stereo, Mixers, and More

by Elliot Williams

So far on Logic Noise, we’ve built up a bunch of sound-making voices and played around with sequencing them. The few times that we’ve combined voices together, we’ve done so using the simplest possible passive mixer — a bunch of resistors. And while that can work, we’ve mostly just gotten lucky. In this session, we’ll take our system’s output a little bit more seriously and build up an active mixer and simple stereo headphone driver circuit.

For this, we’ll need some kind of amplification, and our old friend, the 4069UB, will be doing all of the heavy lifting. Honestly, this week’s circuitry is just an elaboration of the buffer amplifiers and variable overdrive circuits we looked at before. To keep things interesting we’ll explore ping-pong stereo effects, and eventually (of course) put the panning under logic-level control, which is ridiculous and mostly a pretext to introduce another useful switch IC, the 4066 quad switch.

At the very end of the article is a parts list for essentially everything we’ve done so far. If you’ve been following along and just want to make a one-time order from an electronics supply house, check it out.

klangoriumIf you’re wondering why the delay in putting out this issue of Logic Noise, it’s partly because I’ve built up a PCB that incorporates essentially everything we’ve done so far into a powerhouse of a quasi-modular Logic Noise demo — The Klangorium. The idea was to take the material from each Logic Noise column so far and build out the board that makes experimenting with each one easy.

Everything’s open and documented, and it’s essentially modular so you can feel free to take as much or as little out of the project as you’d like. Maybe you’d like to hard-wire the cymbal circuit, or maybe you’d like to swap some of the parts around. Copy ours or build your own. If you do, let us know!

OK, enough intro babble, let’s dig in.

DC Bias Voltage

We perceive compression waves in the air as sound when they reach our ears. We make these compressions by pushing and pulling a speaker cone back and forth. And to make the cone move, we need to get current to flow one way and then the other through the speaker’s magnet windings.

Why the return to fundamentals? Because it’s important to think of the voltages and currents that we want to amplify as being bi-polar, oscillating around some central voltage level. When the signal voltage is higher than neutral, current flows one way and the cone gets pushed. When the signal is lower, current flows the other way and the cone is pulled. The neutral voltage around which we’ll oscillate is called a DC bias (or level) voltage.

In the course of Logic Noise we’ve ignored DC bias voltage whenever possible, but in mixing several signals together, we can’t do that anymore, because signals only add up correctly if they’re generated with respect to the same bias voltage.

envelope_with_xor_drumWe’ve gotten away without blocking DC voltages before because our square wave and triangle wave signals were biased around VCC/2, just like an amplifier with feedback built from a 4069UB inverter is. It all worked fine until we introduced the drum and cymbals circuits, which are so strange that they don’t really even have a well-defined DC level.

Blocking DC voltage is simply done by passing the signal through a capacitor. How large? Large enough that combined with the input resistance of the next stage in the audio chain, it doesn’t cut too much into our low frequency components. In the case of the 4069UB output amplifier stage, a 1 microfarad capacitor will do nicely.

So for now, let’s assume that we first pull the DC level off of any signals that we’d like to mix together, noting that we can “get away with it” for full-swing square waves. Now it’s time to get down to the mixing.

Mixers: Passive and Active

Passive Mixers

passive_mixer.sch“Passive mixer” is a two-dollar name for combining signals together by passing them through resistors. The higher the resistor value, all other things equal, the quieter the contribution to the overall mix.

It’s the simplest way to add a few signals together, and you should play around with passive mixing anyway, just to get the feel for it. The key to making a passive mixer work is using relatively large resistors for all of the mix inputs.

The downside of the simple passive mixer is that because all of the signals combine at the junction, one signal can influence the others. Essentially, each input signal can pull the junction’s voltage higher or lower than the neutral voltage, and this can feed back out to the other “inputs” through their input resistor. Passive resistor mixers are tremendously simple, but they don’t isolate the signal sources well from each other.

Active Mixers

The trick to active mixing is adding negative feedback. Otherwise, it’s just the same circuit as the passive mixer, but it’s a whole lot better.

active_mixer.schRemember from the session on filters that the inverter acts as if it were trying to zero out any net incoming signal current that shows up on the input pin; the logic is that if the voltage on the input rises up above the switching point, the output goes low and fights it back down again through the feedback path.

How much resistance is present in the feedback determines how hard the inverter needs to work to cancel out the input signal. More feedback resistance leads to larger voltage swings on the inverter’s output, which end up as louder tones in our headphones, so the feedback path is a great place to add in a master volume control knob.

In the passive mixer example, when one input was high, it raised the voltage at the junction which could then flow “backwards” to the other connected circuits through their input resistors. In an active mixer, when one input is high the inverter cancels it out by lowering the overall mixed output voltage until the input to the inverter sits at its neutral point again. By the negative feedback mechanism, the junction of all the summing resistors is held at a constant midpoint voltage, and none of the inputs can affect each other. Only the output voltage swings around.

Here we see the need to remove the DC level from the input signals — the 4069UB will do whatever it can to hold its input at roughly VCC/2 by pushing current through the feedback loop. A 1uF capacitor before each input resistor will take care of that.

Beyond isolating the inputs from one another, we can also control the gain of an active mixer by changing the value of the feedback resistor. This gives us a simple place to insert a master volume control just by replacing the feedback resistor with a potentiometer. The convenience of a master volume knob should not be underestimated.

If you’re mixing signals, and you have electricity at your disposal, you almost always want an active mixer.

Multiple Input Volumes

The main function of a mixer is to make a bunch of sounds with different volume levels play nicely together. For instance, the square wave output of a 40106 oscillator swings fully from GND to VCC, while the (unbuffered) triangle wave coming from the input of the same oscillator is a lot quieter. The bass drum circuit is also by nature fairly quiet, and the output of the VCA that gave the cymbal its percussive envelope swing only a few volts. Aesthetically, you’ll want to tweak the volume of each different sound source.

Kookie_Studio_MixerA studio’s mixing console is dominated by an impressive array of faders that fine-tune the volumes of the individual tracks. But before we end up investing in hundreds of dollars of fancy potentiometers, let’s see how far we can get with a bunch of one-cent resistors.

Let’s think about this like an engineer for a second. We want around one volt peak-to-peak of output signal, either for line-level inputs or for headphones. That means that if we’re seeing 9V peak-to-peak square waves, we’ll want to cut them down by about a factor of ten. On the other hand, the one or two volts peak-to-peak that we get out of the low-level signals can plausibly be run through with simple unity-gain buffering. (Bear in mind, this is all before the global output volume control knob.)

If we’re using a 100k potentiometer for the variable feedback resistance (and overall volume), this means that we can use something around 1M Ohm for the high-volume digital signals to knock the amplitude down by at least a factor of ten. Using a 100k Ohm resistor for the quieter signals means that they’ll pass through with unity gain when the channel’s volume knob is turned up to maximum. Of course, you can tweak these values to fit your exact preferences by picking different resistor values.

So round up a bunch of noise-making devices and pick some input resistor values that make them sound good together. (Remembering to remove the DC level with a capacitor if necessary.) If the end result works, nobody will know that you didn’t spend hundreds or thousands on a mixing board.

Headphone Out and Line Out

We saw DC bias issues on the input side, and DC bias raises its ugly head again on the output. Our amplifier’s output is centered around VCC/2, but for headphones (or other speakers) we ideally want no current to flow at this neutral voltage level. This suggests two solutions. First is to create a constant “virtual ground” voltage level at VCC/2 and feed the headphones with our signal and the virtual ground. The other is to strip the DC bias off of the signal and connect the downstream headphones or amplifier to real ground.

Virtual Ground

virtual_gnd.schThe clever way to create a virtual ground at the 4069UB’s neutral voltage (roughly VCC/2) is to set up an inverter with negative feedback as usual but with no input signal. The output of this inverter will be constant and exactly at the inverter’s switching midpoint, so we can use this voltage as the symmetric voltage midpoint that we need for the headphone’s “ground” connection. In the circuit here, a big (100uF) capacitor keeps the VCC/2 level steady. If you’re only going to be driving headphones, or if you’ll only be running the circuit on batteries, this is the hi-fi way to go.

The virtual ground solution runs into trouble when our circuit and the amplifier share a ground connection, as can happen when both are powered by (switching) AC adapters. Then the output’s virtual ground (around VCC/2, remember) gets connected directly to actual ground, and that’s not good. The 4069UB will struggle trying to pump out VCC/2 into a short to ground, probably get hot, and certainly not work so well. The moral of the story: if you use a virtual ground voltage, don’t connect it to actual ground.

Output Capacitors

output_caps.schIf you might have this shared-ground situation, the simple solution is to include DC-blocking capacitors on the output for each of the two stereo channels. While it was easy enough to just say “1uF capacitors” on the input side, the size of output caps should probably be larger but this depends on the load resistance and the amount of current we’ll need to drive into the load.

For example, I have a pair of headphones with 32 Ohm drivers inside, which puts the cutoff frequency of a 100uF capacitor at 1/(2*pi*C*R) = 1/(2*pi*100uF*32 Ohms) = 50 Hz — a low pitch, but one I’d like to hear. Maybe 220uF would be better for low impedance headphones. On the other hand, a less-demanding pair of 600 Ohm headphones will run fine with a 100uF cap down to around 3 Hz which is way below human hearing, and more like a fast tempo than a low note. You could probably get away with 10uF in this case.

In sum, the capacitor-based solution won’t end up shorting to ground, but requires a fairly big capacitor to pass bass notes. The virtual ground solution is clever and works perfectly well with headphones or when battery powered. Shorting the virtual ground to actual ground is to be avoided.

(Discrete) Stereo Mix

Stereo audio is nothing more than a right and left channel, that is two inverters on the 4069UB instead of one, but it’s a great step forward for our synth devices. You can either send all of one instrument voice to the left or right channel, or connect a single voice to both channels through different input resistors.

stereo_output_dongle_smallIt’s nice to have a simple stereo jack breakout board at this point — something you can simply clip or plug into your circuit and then connect up to your headphones or amplifier. Ours was made by soldering a 3.5mm stereo jack to a scrap of copper-clad, traces hand-drawn with a Sharpie, and etched. We tossed on some small wire loops to serve as nice ‘scope test points, because it’s nice to see as well as hear what’s going on.

Let’s take a break from all this theory and build up two capacitor-decoupled mixer circuits.

The 4066 Quad Switch

We’ll play around with ping-pong stereo just to show off, and use the 4066 quad switch chip to do it. Just above, we plugged a given voice into either the left or right channel, or both, and then swapped them around. Now, we’ll use the 4066 switch IC to do the plugging and unplugging for us.

The 4066 quad switch is both as useful and as simple as it sounds — it’s four logic controlled single-pole, single-throw switches in a package. If you want to connect and disconnect stuff, naturally under logic control, this IC is a great solution.

4066_pinoutPreviously we’ve looked at the 4051 8-way switch and used it to select one from eight possible inputs. The limitation with the 4051 is that it’s only possible to select one from the eight inputs at a time. The 4066, on the other hand, is just a set of four switches. This lets us build setups where more than one input channel is active at a time.

Here, we’ll be using the 4066 to route two sound inputs each into one or both of our right and left outputs. Take one voice, say a quiet one like the drum or cymbal circuit, and connect it through two 100k resistors into two switches from the 4066. The other side of each switch is connected to the left and right 4069UB amplifier circuits, respectively. When only the “left” switch is active our drum sound comes out the left side, and vice-versa. When neither is active, the drum is silenced, and when both are active the drum will be centered in the stereo field, and a bit louder because you’ve got two drum signals in place of one.

We can repeat the same hookup for a second voice. Let’s assume that the second voice is a loud one, like a VCC-to-GND square wave or similar. For comparable volume level with the quieter sound, we’ll need to run this loud input through a larger resistor, say 1 MOhm. Any of these input resistors can be substituted with a potentiometer if you’d like smooth control of the volume level. And again, if any of the input signals are not centered around VCC/2, pass them through a 1uF cap on their way into this circuit and don’t forget to de-couple the output or use a virtual ground.

4066_stereo_router.sch

Now we can turn on and off the left and right channels for inputs A and B with logic-level voltages at the four inputs.

Getting Fancy

Now don’t forget our sequencing tricks from previous sessions. For instance, adding a 4017 counter to the mix would allow us to trip the different 4066 switches in order by tapping off of the counter stages. Panning two similar sounds (triangle wave and square wave in the demo below) between the two stereo channels in sequence or in pairs can make a neat, evolving sound texture out of very simple sources.

The 4066 switch makes a great general-purpose control for turning on and off a given voice. We’re using it here for panning effects, but you could also imagine hooking up four different pitch oscillators to the four switches and playing a simple tune just by selecting which notes make it through the switches at a given time.

And as you can hear in the videos, the 4066 switch works fast enough to be fed audio signals into the switch control port. Every time a jumper wire is pulled out of the board, it couples with the 50 Hz power-line frequency and makes more overtones as the input frequency and the 50 Hz switching frequency mix with each other, for a sound that’s not unlike what you’d get by running both signals through an XOR.

An on-off switch seems like a humble device, but it’s very broadly useful. So have some fun switching elements on and off in the stereo field here, but don’t think that you’ve seen the last of the 4066.

Next Session

As promised previously, next session we’ll start getting into a little more advanced Logic Noise circuits, and in particular getting into voltage control. The 4046 phase-locked loop IC has a small voltage controlled oscillator inside it (among other parts) so it’ll be our first stop. We’ll make sweeping pitches without turning knobs. Stay tuned!

PS: Parts List

A number of folks have asked for a parts list for the Logic Noise series. Here goes.

I’ve tried to keep the variety of parts used as low as possible, for instance by using 100k resistors as a standard value whenever they’ll work. All potentiometers we’ve used so far are also 100 kOhms. Capacitors have been between 10nF and 10uF, a fairly normal range, and we’ve used 100nF caps for almost all of pitch-determining applications. The point of all this is that you can buy these parts in large enough volume to hopefully get a discount.

ICs / Actives:

All of the 4000-series ICs are available under different names from different manufacturers.  Most of the chips in my drawer are from TI or Fairchild, but I’ve got a bunch from ON and NXP.  Most of the time, they’re interchangeable:
CD4xxx from TI and Fairchild Semiconductor
MC14xxx from ON Semiconductor
HEF4xxx from NXP

In buying ICs, I almost never buy one, and for most of these parts the volume discounts start at 10 pieces. Take the quantites below to be rough suggestions. You can never have too many useful parts.

  • 10x 40106 hex inverter (you’ll use these everywhere)
  • 10x 4069UB inverter, amplifier (UB is crucial)
  • 4x 4051 eight-way switch
  • 4x 4066 quad single-pole switch
  • 2x 4040 binary counter
  • 2x 4017 decimal counter
  • 2x 4015 shift register (or 4094 if you won’t use the dual-clock functionality)
  • 2x 4070 XOR
  • 2x 2N3904/2N2222/BC548 or similar NPN signal transistors

(and soon:)

  • 2x 4046 PLL
  • 2x 4007 misc gates

Passives:

  • 100x signal diodes, e.g. 1N4148.
  • 100x 100k Ohm resistors (our mainstay)
  • 100x 10k Ohm resistors (also useful)
  • A handful of odd-value resistors here and there. Get an assortment if you don’t already have one.
  • 100x 0.1uF (100nF) capacitors. Ceramic/MLCC is fine.
  • 100x 1uF capacitors. ditto
  • 10x 10nF capacitors, ditto
  • 10x 10uF capacitors, electrolytic, 16v is fine.
  • 10x 100uF capacitors, electrolytic, ditto.

Potentiometers:

  • 10x 100k Ohm linear potentiometers (this is where most of your budget will go, and honestly 20 wouldn’t be too many)
  • 1x 100k stereo / dual potentiometer for bass drum circuit

Misc:

  • Some pushbuttons, but again you’ll never have too many
  • Breadboard and a lot of breadboarding wires
  • 9V battery and clips to connect to breadboard, or power supply
  • Powered computer speakers or amp and speaker
  • 3.5mm audio jack / stereo cable for output

Filed under: Featured, hardware, misc hacks, slider
29 Jun 11:34

MapleMaker 3D Printer is As Printable as They Get

by Rich Bremer

The term RepRap is fairly common and gets thrown around too often when generally talking about DIY 3D Printers. We must remember that the intent of the RepRap project “…is about making self-replicating machines…” and of course “…making them freely available for the benefit of everyone…“.

[MiniMadRyan] has recently designed a printer that could be considered the embodiment of the RepRap philosophy. He’s calling it the MapleMaker Mini V2. An extremely high percentage of the parts required to build this printer are, in fact, printable themselves. The frame pieces are printed, all of which can be printed on the printer thanks to the 6x8x6 inches print volume. The overall design is aesthetically pleasing, resembling that of a Lulzbot Mini.

The MapleMaker Mini V2 is self-replicating. The other part of the RepRap goal is to be free to the community. The design files are available on YouMagine and the assembly manual is better than those provided by most commercial companies. So if you’re looking to build a printer, be sure to add this one to your short list!

 


Filed under: 3d Printer hacks
25 Jun 09:33

Blinking LEDs For A Timeless Fountain

by Brian Benchoff

We’ve seen a few of these builds before, but the build quality of [Mathieu]’s timeless fountain makes for an excellent display of mechanical skill showing off the wonder of blinking LEDs.

This timeless fountain is something we’ve seen before, and the idea is actually pretty simple: put some LEDs next to a dripping faucet, time the LEDs to the rate at which the droplets fall, and you get a stroboscopic effect that makes tiny droplets of water appear to hover in mid-air.

Like earlier builds, [Mathieu] is using UV LEDs and is coloring the water with fluorescein, a UV reactive dye. The LEDs are mounted on two towers, and at the top of the tower is a tiny, low power IR laser and photodiode. With the right code running on an ATxmega16A4, the lights blink in time with the falling water droplet, making it appear the drop is hovering in midair.

Blinking LEDs very, very quickly isn’t exactly hard. The biggest problem with this build was the mechanics. The frame of the machine was machined out of polycarbonate sheets and went together very easily. Getting a consistent drip from a faucet was a bit harder. It took about fifteen tries to get the design of the faucet nozzle right, but [Mathieu] eventually settled on a small output hole (about 0.5 mm) and a sharp nozzle angle of about 70 degrees.

[Mathieu] created a video of a few hovering balls of fluorescence. You can check that out below. It’s assuredly a lot cooler in real life without frame rate issues.


Filed under: misc hacks
18 Jun 15:47

Embed With Elliot: Shifting Gears With AVR Microcontrollers

by Elliot Williams

Most modern computers are able to dynamically adjust their operating frequency in order to save power when they’re not heavily used and provide instantaneous-seeming response when load increases. You might be surprised to hear that the lowly 8-bit AVR microcontrollers can also switch CPU-speed gears on the fly. In this edition of Embed with Elliot, we’ll dig into the AVR’s underappreciated CPU clock prescaler.

The Fuses

Most (all?) AVR microcontrollers come straight from the factory with their system clock set to run at one eighth of the internal oscillator’s speed. For instance, a stock ATmega168 has an internal RC oscillator ticking away at 8 MHz, but it’s divided down to 1MHz by default. In the bad old days, when dinosaurs roamed the earth and the ATmega8 was the new chip on the block, you had to “burn a fuse” to change this and get the chip up to full speed.

The fuses are configuration bits that stay constant across reboots and aren’t changeable from your code or from within a bootloader — they have to be changed using an external hardware programmer. The idea is that they contain configuration bits that are so sensitive you don’t want something as commonplace as buggy code to mess them up. Things like low-power brownout detection, chip start-up times, lock bits to stop you from reading out the program memory, and so on are stored in the fuse bits.

Basically the fuses contain all the settings that can “brick” your AVR and force you to reach for the high-voltage programmer. Figuring the fuse settings you need is a bit tedious: I’ve always used an online fuse calculator to make sure I get them right.

embed-with-elliot-shifting-gears-with-AVR_current_freqAtmel apparently initially thought that CPU clock speed was one of those don’t-touch parameters. Fair enough; we’ll look into what breaks when you change gears below.

But keeping you from changing the clock speed dynamically also removed an important means of reducing the chip’s power consumption. So the newer chips let you control the system clock prescaler from software.

Note that if you’re using an external crystal oscillator, you’ve still got to program the appropriate fuse bits to enable its use. You can’t switch back and forth from an external clock to the internal one from within your code. However once you’ve got the AVR running on an external crystal, you can still use the clock prescaler to change gears (relative to the crystal’s frequency) on the fly. Which is to say, you can change the CPU prescaler on an AVR-based Arduino.

Using The Prescaler

Which chip families have a software-adjustable clock prescaler? All of the ATmegax8 chips (48, 88, 168, and 328) and most of the modern Tinys, from the Tiny2313 to the Tinyx4, x5 and x61 families, support changing the clock multiplier on the fly. There are others as well, and you can sift through the io.h file for your favorite chip to look for CLKPS definitions.

The short version is that your chip will probably have a prescaler unless you’ve got a stash of neolithic ATmega8’s kicking around that you’re trying to finally use up.

The actual sequence for changing the prescaler is deliberately made a little bit complicated: like turning the keys to launch a nuclear missile, it’s not something you want to do by mistake. First, there’s a prescaler-change enable bit that must be set in order to change the clock division bits. But the enable bit gets automatically reset four CPU clock cycles after it’s turned on, so the timing is tight to get the new division bits in. If an interrupt fires in the process, you won’t manage to set the clock speed in time, so you’d better turn off interrupts when changing speeds as well.

Conveniently enough, the GNU AVR libc provides pre-written assembly code that does this dance for you, takes care of differences across chips, and make your code a ton easier to read in the process. Once you include “avr/power.h“, changing the CPU clock is an easy as clock_prescale_set(clock_div_64). Now your chip is running at 125kHz (= 8MHz / 64).

Instead of the old-school fuse-flashing to get your chip running at full speed, just include clock_prescale_set(clock_div_1) somewhere in your initialization routine. Piece of cake.

The Catch(es)

So now you can change all of the CPU clock speed at will from your code. What could possibly go wrong? In short, everything that relies on the system clock for its timing.

embed-with-elliot-shifting-gears-with-AVR_clock_treeAs you can see, most of the AVR’s hardware peripherals use clocks that are derived from the CPU system clock run through the system clock prescaler. The timer/counters, all of the serial I/O (USART, SPI, and I2C), and the analog-to-digital converter (ADC) all have their own sub-clocks that are divided down versions of the system clock.

The good news is that changing any of these to work at your new CPU speed is as easy as re-setting their clock divisors. The simplest solution is to write something like a “switch_to_8MHz()” function that switches the CPU speed and reinitializes the various hardware peripherals at the same time.

The commonly used standard delay functions, _delay_ms() and _delay_us(), are going to be messed up because they rely on a compile-time macro definition, F_CPU, and that can only take one value. If the macro F_CPU is set to 1MHz but then you change the clock speed down to 125kHz, all of your delays are going to be eight times too long when you’re running slow.

The delay problem is a bit tricky because the built-in delay functions only take constants as arguments, so you’ll need to write your own delay routines that take the current CPU speed into account. This could be as easy as simply looping around a fixed delay eight times when you’re running the CPU eight times faster, for instance. Setting a “delay_multiplier” global variable to specify the number of loops and updating it when you change CPU speed is probably the best way to go.

In Conclusion

So you can see that while it’s trivial to change clock speed from your code, a little care is needed to make sure all of the AVR’s peripherals play along. But if you’re looking to save a little power and the sleep modes won’t work for you, changing the gears that divide the system clock is a great way to go. And even if you’re not going to change the CPU speed on the fly, at least you don’t have to burn the fuse bits just to get an AVR chip running at full speed. Give the CPU prescaler a look!


Filed under: ATtiny Hacks, Hackaday Columns, Microcontrollers
12 Jun 09:37

Solder any Expansion Directly to Your Computer’s Memory

by Mike Szczys

Heat up that iron, you’re going to want to try this one: [Hugatry] is adding hardware to his laptop by tapping into the i2c lines on the memory module. We love this because the penalty for borking memory during the soldering process is much lower than when soldering directly to a motherboard!

Until we watched the video after the break we hadn’t realized that memory modules usually have an i2c EEPROM on them. This is actually a standard called Serial Presence Detect which allows the BIOS to poll the memory and configure automatically. It seems ironic that we knew the Raspberry Pi HAT standard uses this same trick but didn’t know it was on computer memory as well.

Hardware-wise this provides an easy method of soldering your own equipment to the bus. From there it becomes a software hack. Linux, of course, makes this quite easy and that is demonstrated by [Hugatry] with an LM75 temperature sensors. We would like to hear from our Windows and OSX using readers on how the i2c bus can be accessed within those OS’s.


Filed under: computer hacks
03 Jun 08:14

Some Snap-Fits For Thought

by Joshua Vasquez

While laser cutters, desktop mills, and 3D printers might be wonderful tools for rapid prototyping, it’s best to have a strong understanding on a few techniques to really “digitize” those sheets of Delrin and rolls of PLA into something meaningful. In a nutshell, we need to know how to cut-or-squirt parts that fit together.

[Yoav] has a few tips for HDPE. The first technique is a clip-on, clip-off feature meant for repeated use. The second joins two parts with a joint that can’t be removed except by removing a dowel pin, or other press-fit shaft that holds them together. The last technique is similar to the first, except it embeds the deforming geometry directly into the mating surfaces.

If you’re interested in some detailed design guides and a few equations, have a look at the Bayer Guide and DuPont Design Guide; both provide a detailed set of geometric techniques and information about their associated stresses and deflections.

Finally, if you’re looking for a triumph of snap-fit design, have a look at [Jonathan Ward’s] MTM Snap–a snap-fit desktop milling machine and the direct predecessor to the modern-day Othermill.

Thanks for the tip, [uminded]!


Filed under: hardware
25 May 16:17

Need Timing Diagrams? Try Wavedrom

by Elliot Williams

When working with anything digital, you’re going to end up reading or writing a timing diagram before long. For us, that’s meant keeping (text) notes, drawing something on a napkin, or using a tool like Inkscape. None of these are ideal.

An afternoon’s search for a better tool ended up with Wavedrom.

Just so you know where we’re coming from, here’s our list of desiderata for a timing diagram drawing solution:

  • Diagrams have a text-based representation, so their generation can be easily scripted and the results versioned and tracked throughout project development
  • Command-line rendering of images, because we like to automate everything
  • Looks good
  • Simple to use for common cases, but flexible enough to do some strange stuff when needed
  • Output modifiable when absolutely necessary: SVG would be nice

Basically, what we want is graphviz for timing diagrams.

Wavedrom nails four out of these five at the moment, and has promise to cover all of the bases. Give the online editor demo a try. We found it intuitive enough that we could make simple diagrams without even reading the fine manual. The tutorial has got you covered for more esoteric use cases.

foo

Clearly, some good thought has been put into the waveform description language, WaveJSON; it’s mostly readable and makes the essentials quick and easy. Because you can also enter straight SVG, it leaves the door open for full-fledged lunacy.

Wavedrom is written in JavaScript, and built for embedding in webpages; that’s the way they intend us to use it. On the other hand, if you want to run your own local version of the online editor, you can download it and install it locally if you’d like.

Our only quibble is that the standalone, command-line application wouldn’t generate images without the GUI on our Arch system. (Looks like there are some Google Chrome dependencies?) Otherwise, we think we’ve found our solution.

There are other applications out there. Drawtiming looks good, but we can’t quite get our head around the file format and the graphic output isn’t as flexible as we’d like: it only outputs GIF and we’re more into SVG because it can be edited easily after the fact.

There are font-based solutions that let you “type” the timing diagrams. We found Xwave and “Timing Diagram Font“. These work but aren’t particularly flexible; if you want something to happen at odd times, you’re out of luck. Plus, it just feels like a dirty hack, as if that were a bad thing.

Latex users can use tikz-timing, which makes sketching out your timing diagrams as much fun as laying out a very complex table in Latex (that is: not fun at all). On the other hand, it looks good, is ultimately flexible, outputs PDF, and would be scriptable if someone put the time in to write a nice frontend.

So for the next little while, we’re trying out Wavedrom.

What do you use for making timing diagrams?


Filed under: Featured, software hacks
20 May 13:47

Colorizer for ZX81 clone

by Anool Mahidharia

[danjovic] is a vintage computer enthusiast and has several old computers in his collection. Among them are a couple of TK-85 units – a ZX81 clone manufactured by Microdigital Eletronica in Brazil. The TK-85 outputs a monochrome video output. And when [danjovic] acquired a SyncMaster 510 computer monitor, he went about building a circuit to “colorise” the output from the ZX81 clone (Portuguese translation).

The SyncMaster 510 supports 15kHz RGB video refresh rate, so he thought it ought to be easy to hook it up to the TK-85, which internally has the video and composite sync signals available. So, if he could lower the amplitude of the video signal to 0.7Vpp, using resistors, and connect this signal to one of the primary colors on the monitor, for example green, then the screen should have black characters with a green background.

DSCN5584-thumbBefore he could do any of this, he first had to debug and fix the TK-85 which seemed to be having several age related issues. After swapping out several deteriorating IC sockets, he was able to get it running. He soldered wires directly to one of the logic chips that had the video and sync signals present on them, along with the +5V and GND connections and hooked them up to a breadboard. He then tested his circuit consisting of the TTL multiplexer, DIP switches and resistors. This worked, but not as expected, and after some digging around, he deduced that it was due to the lack of the back porch in the video signal. From Wikipedia, “The back porch is the portion of each scan line between the end (rising edge) of the horizontal sync pulse and the start of active video. It is used to restore the black level (300 mV.) reference in analog video. In signal processing terms, it compensates for the fall time and settling time following the sync pulse.”

To implement the back porch, he referred to an older hack he had come across that involved solving a similar problem in the ZX81. Eventually, it was easily implemented by an RC filter and a diode. With this done, he was now able to select any RGB value for foreground and background colors. Finally, he built a little PCB to house the multiplexer, DIP switches and level shifting resistors. For those interested, he’s also documented his restoration of the TK-85 over a four-part blog post.


Filed under: computer hacks, video hacks
12 May 09:50

PicoRico Hacks String Encoder for Bike Suspension Telemetry

by Mike Szczys

It’s simple, it’s elegant, and it works really really well. The PicoRico team built a telemetry system for a downhill bike. Off the top of your head how would you do this? Well, telemetry is easy… just add an IMU board and you’re golden. They went beyond that and have plans to go much further. In fact, the IMU was an afterthought. The gem of this build is a sensor that may go by several names: string encoder, draw wire sensor, stringpot, etc. But two things are for sure, they planned well for their hackathon build and they executed on that plan. This landed them as first-runners-up for the top award at the 2015 Disrupt Hackathon in New York, and the winners of the top Hackaday award at the event.

picorico-thumb[Chris], [Marek], and [Dorian] wanted to log all the telemetry data from [Chris’] downhill bike. One of the biggest challenges is to measure the force absorbed by the suspension on the front fork. The three had seen a few attempts at this before. Those used a retractable wire like what holds keys to a custodian’s belt, mated with a potentiometer to measure the change. This is where the term stringpot comes from. The problem is that your resolution and sensitivity aren’t very reliable with this setup.

That is a sensor problem, not a mechanical problem so they kept the retractable reel and replaced the pot with a much more reliable part. In its place an AMT203 absolute position sensor provides an epic level of sensing. According to the datasheet (PDF) this SPI device senses 12 bits of rotation data, can be zeroed over the SPI bus, and is accurate to 0.2 degrees. Unfortunately we didn’t get a good up-close shot of the installation but it is shown in the video. The encoder and retractor mount above the shocks, with the string stretching down to the skewer. When the shocks actuate, the string extends and retracts, turning the absolute encoder. Combine this with the IMU (and two other IMUs they plan to add) and you’ve got a mountain of data to plot and analyze. The videos after the break show a demo of the string encoder and an interview with the team.

picorico-packing-heavyThey came to play

It’s worth noting that the PicoRico team were in this to win it. They packed heavy for the 20-hour hackathon. Here’s a picture of all the gear they brought along with them to the event… in addition to the bike itself.

We see a solder station, Dremel (with drill press), impact driver, tap and die set, extension cords, boxes full of electronics, and more. This type of planning breaks down barriers often faced at hardware hackathons. You can download a software library; you can’t download a tool or building material that nobody has with them. This is the same lesson we learned from [Kenji Larsen] who, as part of his mentoring at the event, brought a mobile fabrication facility in a roller bag.

If you start getting into hackathons, and we hope you will, keep this in mind. Brainstorm as much as you can leading up to the event, and bring your trusted gear along for the ride.


Filed under: cons, transportation hacks
08 May 09:52

Portable Workbench Is Solid And Space Saving

by George Graves

Last week we covered the topic of electronic work benches. But we know that there’s more to life than soldering irons and tiny components. Sometimes to pull off a hack, you need to get your hands dirty, and get some sawdust in your hair. If you’re limited on space, or need to be able to move to different locations quickly, this shop workbench may just be what you’re looking for.

First, let us preface that this project is not open source. Now before you “boo!” too loudly, the designer [Ron Paulk] only charges $10 for the plans. We think that is a small price to pay for how much though has gone into the design. But hey, if you’re a bit crafty, we bet you could easily reverse engineer the build just from the pictures alone. Personally, we think there are times when it’s a good thing to support a project like this.

The basic design allows the workbench to be very rigid, but light weight. And if you don’t have room for it to be permanently set up, it tears down and stores away nicely. It seems like the plans are well done, but if you need a bit more guidance, there is also a 15 part video series that will guide you along the way (here is the youtube playlist.) Also, there is an overview video after the break.  So what are you waiting for?  Go out and make something!


Filed under: tool hacks
15 Apr 14:06

Bike-Powered Everything

by Rich Bremer

It’s hard to argue that bicycles aren’t super handy. They get you from point A to B in a jiffy with little effort. Since these machines are so simple and convenient, why not use them for things other than transportation? Well, [Job] set out to do just that.

[Job’s] starts with a standard single speed bike and adds a few parts. First, a stand is installed to the back axle. When in the down position, it lifts the rear wheel off of the ground and provides support so the bike does not tip over. When flipped up into the ‘up’ position the stand creates a rack for holding goods and the bike can be pedaled around in a normal manner.

dualpurposebike-midNext, a jack shaft made from a bike bottom bracket and crank is installed up front in between the top tube and down tube of the frame. On one side of the jack shaft is a sprocket and the other side is a large pulley. When converting to what [Job] calls ‘power production mode’, the chain going to the rear wheel is removed from the crank sprocket and replaced with a chain connected to the jack shaft.

With the rear stand down supporting the bike and the pedals now powering the jack shaft and large pulley, it is time to connect the bike to any sort of machine. A belt is slung around the pulley and connected to a matching pulley on a power-hungry machine. This dual-purpose bike has powered a rice thresher, peanut sheller, water pump, table saw and even a wood lathe!

[Job] set out to create a simple and inexpensive way to make a bike even more useful than just riding around town. We think he did just that. For more bike-powered stuff, check out this generator.


Filed under: transportation hacks
15 Apr 08:16

Retro Edition: VCF East X This Weekend

by Brian Benchoff

It’s mid-April and time once again for the Vintage Computer Festival East X. The X means 10. It’s a three-day weekend full of interesting people, cool tech, and computers you’ve only heard about. We’ll be there all three days, and if you’re in New York or are unable to pump your own gas (Oregon excluded), it’s a great way to spend the weekend.

The sessions for this Friday will include everything from chiptunes to retr0bright to emulating vintage computers on FPGAs. Sessions of note include our own [Bil Herd] giving a talk on system architecture. Think of this as a bunch of engineers in a room with a whiteboard. How could you not have fun with that. There will also be the first meeting of the Quarternet committee, headed up by [Jim Brain]. This session will be a discussion of implementing a vintage networking protocol across different models and different brands of vintage computers. Confused? It’s a, “two-bit solution for an eight-bit world.” That’s all we know, and I’m pretty sure that’s all anyone knows. It will be interesting.

Saturday and Sunday will feature an incredible number of exhibits that includes everything from Atari 8-bits, Hollerith cards, mainframes, an amateur radio station (KC1CKV) and somehow a Fairlight CMI. Since this is the 50th anniversary of the PDP-8, there will be a few of these ancient machines on display. A freshly restored Straight-8 will be up and working, as will an incredible emulation from hackaday.io.

Just because there are exhibits doesn’t mean the talks end on Friday. On Saturday the guest speaker will be [Brian Kernighan], the guy who literally wrote the book on C. Sunday will feature [Bob Frankston], co-developer of VisiCalc. There will be very important people here all weekend.

Even if vintage computers aren’t your thing, there’s still plenty of stuff to see at the venue. The InfoAge science center has technological curiosities stretching back a century, and recently they’ve rehabbed an old satellite dish and turned it into a radio telescope. Registration happens here, and if the last few paragraphs haven’t sold you on the event, you can check out [The Guru Meditation]’s VCF preview video below. We will, of course, be posting a lot of stuff from the event.

 


Filed under: cons, Hackaday Columns
14 Apr 14:53

Hackaday Prize Worldwide: Toronto

by Mike Szczys

Tomorrow, April 15th at 7pm, join Hackaday at the Toronto HackLab.

Our own Mythical Creature, [Sophi Kravitz] is headed North of the border to talk about all things hardware hacking! As always, we love to see what people are working on in their labs, basements, garages, and workplaces. Make sure to bring your builds with you to show off to the rest of the crowd. [Sophi] will have her Breathe project on hand. Solenoids, balloons, compressed air, and visualizations are the secret sauce behind this clever interactive build.

Since there will be snacks, hacks, drinks, and swag we’d appreciate a quick RSVP (use the link at the top of this post) just so we know you’re incoming. Apart from seeing a slew of cool builds there will be lightning talks, some information about the 2015 Hackaday Prize, and if you haven’t been to the Hacklab before this is the perfect time for your first tour. We know there’s a lot of awesome to be seen there!


The 2015 Hackaday Prize is sponsored by:


Filed under: The Hackaday Prize
14 Apr 08:50

Old Fluorescent Fixtures Turned Into Fill Lights

by Brian Benchoff

The Tymkrs are hard at work setting up their home studio, and since they’ll be shooting a few videos, they need some lights. The lights themselves aren’t very special; for YouTube videos, anything bright enough will work. The real challenge is making a mount and putting them in the right place, With a shop full of tools, making some video lights isn’t that hard and easily translates into a neat video project.

The lights began their lives as large fluorescent fixtures, the kind that would normally house long fluorescent tubes. The Tymkrs cut the metal reflector of this fixture in half, capped the ends with wood, and installed normal incandescent sockets in one end.

The inside of this reflector was coated with a reflective material, and a beautiful rice paper diffuser was glued on. The Tymkrs attached a metal bracket to these lights and screwed the bracket to the ceiling. There’s enough friction to keep the lights in one spot, but there’s also enough play in the joints to position them at just the right angle.


Filed under: hardware
10 Apr 13:25

Building Super Small Linux Computers From Scratch

by Brian Benchoff

Conventional wisdom says small, powerful embedded Linux like the Raspberry Pi, Beaglebone, or the Intel Edison are inherently manufactured devices, and certainly not something the homebrew tinkerer can produce at home. [hak8or] is doing just that, producing not one, but two completely different tiny Linux computers at home.

The first is based on Atmel’s AT91SAM9N12 ARM processor, but the entire board is just about two inches square. On board is 64 MB of DDR2 DRAM, a USB host and OTG port, and not much else. Still, this chip runs a stripped down Linux off of a USB drive.

The second board is based on the Freescale i.MX233. This board is similar in size and capabilities, but it’s not exactly working right now. There’s an issue with the DRAM timings and a capacitor underneath the SD card is a bit too tall.

The real value of [hak8or]’s project is the incredible amount of resources he’s put into his readme.mds for these repos. If you’ve ever wanted to build an embedded Linux device, here’s your one-stop shop for information on booting Linux on these chips.


Filed under: ARM, Microcontrollers
06 Apr 08:52

More Power For Raspberry Pi USB Ports

by Brian Benchoff

Since the Raspberry Pi 2 was released, everyone building RetroPi emulators has been graced with four USB ports. For those of us doing useful stuff with the Pi, those ports are a little anemic: you can’t plug in a webcam and a WiFi module at the same time without suffering CPU brownouts. The maximum current all USB peripherals can draw from the USB port is 600mA. By changing a value in the /boot/config.txt file, this current limit can be increased to 1.2A for all four ports.

Pisquare
The yellow line traces the signal from the GPIO to the USB power switch.

Because the USB current limit is set in software, there must be a few bits of hardware that do the actual work. Tucked away below the right hand of the GPIO header is the hardware that does exactly that. It’s an AP2253 current-limited power switch (PDF), and the current is adjustable by tying a resistor to pin 5 on the chip.

Pin 5 on the AP2253 is connected to two resistors. One resistor goes directly to a ground plane, while the other is switched through a FET. The gate of this FET goes to another resistor, and when a GPIO pin is high, these resistors are wired in parallel. This means the resistance is halved when the GPIO pin is high, doubling the current limiting circuit in the AP2253.

This setup provides a relatively easy mod to increase the current limiting of the USB ports so they can provide 4x500mA, meeting the USB spec. The AP2253 power switch’s current limiting can be set by a single resistor, anywhere from 10kΩ to 232kΩ. By removing R50 and R4, and replacing R50 with a 10kΩ resistor, the current limiting of the AP2253 switch will be set to its maximum, 2.1A. Divide that by four, and you have 500mA per port, just like every other computer on the planet.

There is a reason the Raspberry Pi foundation set the current limiting of the USB ports so low. The Pi was originally intended to run off of a micro USB phone charger. There aren’t many phone chargers out there that will supply more than 1A, and the CPU and related peripherals will take half of that. If you’re going to change the /boot/config.txt file, you’re going to need a beefy power supply. Increasing the current limiting of the USB ports to 2A will require an even bigger, beefier supply.


Filed under: Raspberry Pi
02 Apr 10:28

Building A 20 Inch Disk Sander

by Brian Benchoff

A small disk sander is a useful and cheap addition to the shop. For about $100, you can buy a cheap combination 6″ disk/belt sander that’s extremely useful. The size and cost of power tools does not scale linearly, and if you want a big disk sander you might as well make your own.

The motor for this build is a 1kW single phase motor pulled from a floor polisher found in the trash. That’s enough to push a sanding disk around, but when you get to tools this large, you need a good base, good tilt mechanism, and everything should be extremely heavy.

This build meets all those requirements while still using mostly recycled components. The work table is actually made of three pieces of recycled aluminum epoxied together. Yes, you should cringe at this, but it actually makes a little bit of sense: thinner pieces can be cut on a table saw, and if you’re extremely careful during the glue-up, you can cut the mitre slot without a mill. This frame attaches to a frame made from aluminum extrusion and filled with a homebrew epoxy granite mix. Remember, heavy is better here.

In keeping with making a huge disk sander out of stuff pulled out of the trash, the trunnions and motor hub were cast out of aluminum melted in an old propane tank furnace. Once these were cleaned up, a disk was mounted on the hub and trued up in the most unsafe manner possible.

With a few additions including a machined mitre gauge, dust collector, and legs made out of wood that’s far too pretty for a simple shop tool, this huge assemblage of trash turned out to be a great sander. You can see a few videos of it below.


Filed under: tool hacks
31 Mar 12:45

Measure as Little as You Want with openQCM

by Theodora Fabio

The clever folks over at [Novaetech SRL] have unveiled openQCM, their open-source quartz crystal microbalance. A QCM measures very minute amounts of mass or mass variation using the piezoelectric properties of quartz crystal. When an object is placed on the surface of this sensor, the changes in the crystal’s resonant frequency can be detected and used to determine its mass in a variety of experimental conditions (air, vacuum, liquid). However, most QCM technology is proprietary and pricey – at least US$3000 for the microbalance itself. Any consumables, such as additional crystals, cost several hundred dollars more.

The openQCM has a sensitivity of 700 picograms. At its core is an Arduino Micro with a custom PCB. The board contains a 10K thermistor for temperature offset readings and the driver for a Pierce oscillator circuit. The quartz crystal frequency is determined by hacking the timer interrupts of the Arduino’s ATmega32u4. An external library called FreqCount uses the clock to count the number of pulses of the TTL signal in a 1 second time frame. This yields quartz crystal frequency resolution of 1Hz. The user interface is built in Java so that data can be read, plotted, and stored on your computer. The entire casing is 3D-printed, and it appears that the sensors are standard oscillator crystals without their cases.

Simplistic design makes assembly and maintenance a breeze. It only weighs 55 grams. Replacing the quartz crystal requires no special tools due to the clip system. The openQCM can be used as a single unit, or in multiples to form a network for all of your precise measurement needs. While they have kits available that will set you back US$500, all of the files and schematics for 3D-printing, assembly, and the PCB are available on the openQCM site for free.

[Special Thanks to Augustineas for sending us this tip!]

 

 


Filed under: Arduino Hacks, chemistry hacks
20 Mar 10:50

Auto-sleep Hacked in PC Speakers

by Mike Szczys

We can commiserate with [HardwareCoder] who would rather not leave his PC speakers on all the time. The Creative T20 set that he uses turn off when you turn the volume knob all the way down until it clicks. So shutting them off means repositioning the volume each time they’re switched on again. This hack kills two birds with one stone by turning on and off automatically without touching that knob.

The system is based around an ATtiny45 and a few other simple components. It uses two ADCs to monitor the rear input channels of the PC speakers. If no sound is detected for more than one minute, the shutdown pin of the speakers’ amp chip is triggered. That’s not quite where the hack ends. We mentioned it monitors the rear input of the speakers, but it doesn’t monitor the front AUX input. An additional push button is used to disable the auto-sleep when using this front input. There is also a fancy PWM-based heartbeat on an LED when the speakers are sleeping.

[HardwareCoder] was worried that we wouldn’t be interested in this since it’s quite similar to a hack we ran a few years ago. We hope you’ll agree it’s worth another look. He also warned us that the demo video was boring. We watched it all anyway and can confirm that there’s not much action there but we embedded it below anyway.


Filed under: ATtiny Hacks, digital audio hacks, peripherals hacks
19 Mar 09:51

DIY Oscilloscope with a Scanning Laser

by Ethan Zonca

If you’ve ever used an old-school analog oscilloscope (an experience everyone should have!) you probably noticed that the trace is simply drawn by a beam that scans across the CRT at a constant rate, creating a straight line when there’s no signal. The input signal simply affects the y-component of the beam, deflecting it into the shape of your waveform. [Steve] wrote in to let us know about his home-built “oscilloscope” that works a lot like a simple analog oscilloscope, albeit with a laser instead of  a CRT.

[Steve]’s scope is built out of a hodgepodge of parts including Lego, an Erector set, LittleBits, and a Kano Computer (based on a Raspberry Pi). The Pi generates a PWM signal that controls the speed of a LittleBits motor. The motor is hooked up to a spinning mirror that sweeps the laser across some graph paper, creating a straight laser line.

After he got his sweep working, [Steve] took a small speaker and mounted a mirror to its cone. Next he mounted the speaker so the laser’s beam hits the mirror on the speaker, the spinning sweep mirror, and finally the graph paper display. The scope’s input signal (in this case, audio from a phone) is fed into the speaker which deflects the laser beam up and down as it is swept across the paper, forming a nice oscilloscope-like trace.

While [Steve]’s scope might not be incredibly usable in most cases, it’s still a great proof of concept and a good way to learn how old oscilloscopes work. Check out the video after the break to see the laser scope in action.


Filed under: hardware, tool hacks