I’ve had a small problem over a year: I have two headphone amplifiers, a transistor-based O2 headphone amp, and a tube-based Little Dot MKII. I also have two sets of headsets. Because switching the cables all the time is somewhat tedious, I haven’t really used the other amp and headphone set.
There are several Y switches that you can buy, but most seemed either expensive or mostly tailored towards electric guitar enthusiasts. And I would still need to combine two Y switches to toggle between the two amps and headphones. As the construction is really simple, I decided to solder my own. Here’s a short tutorial on how to make one yourself. You’ll need:
4 audio connectors (I chose 3.5mm over RCA), two to each end
2 switches with at least 3 connectors (left, right, ground) – I chose two 4 way switches
A box where you can drill holes for the connectors and switches
Small length of wire, some solder and soldering iron
1. The Schematic
The design of the switch is extremely simple. In both ends, three wires come from each of the two connectors to a switch, and the switches are connected to each other. I chose not to combine any ground lines to avoid ground loops. You need also to select a switch which breaks the connection on one side before connecting the other so the amplifiers will not feed into each other.
2. Soldering the wires
Despite the simple construction, there is a lot of soldering involved. Each of the four connectors will have ground plus left and right channels, and all have the switch on the other end. That makes 24 solder points (4x3x2), and there’s six more between the switches for a total of 30 points. The 3.5mm connectors had small “L” and “R” markings to tell which channel is left and which is right. I used different colors of wires for each type to avoid mixing L, R and ground.
Today’s post is something I’ve prepared for a long time. Hardware-wise it’s a simple thing – ATtiny45 emulating a PS/2 device, sending a keypress when three knocks are detected in the attached piezoelectric sensor (or piezo buzzer as they are also called). But if your computer can boot on PS/2 keyboard input and you have your computer stowed somewhere hard to reach (or just want to impress your friends), it’s a pretty neat little gadget! Here’s a video of it in action:
My PC takes a few seconds to put anything on display, but if you look at the bottom right corner, you can see the blue power LEDs light up immediately after the knocks.
What You’ll Need
Hardware-wise this hack is super simple. You’ll need less than $10 in parts and many probably already have these lying around:
ATtiny45. Actually, any ATtiny or ATmega with 4kB or more flash, A/D converter and two timers will work with small adjustments, and with -Os -DMINIMAL compiler flags also 2kB MCUs (ATtiny2313 doesn’t have a A/D but you can either work around it or use a button)
Piezo buzzer and 1 Mohm resistor to act as knock sensor
PS/2 connector, or alternatively a passive USB-PS/2 adapter (I have half a dozen from old keyboards and mice) and USB cable (like the one I used in my V-USB tutorial)
Breadboard and wire. Alternatively you can solder it on a simple PCB like I eventually did.
Optionally, a 4k7 ohm pullup resistor for RESET line, and a LED and 330 ohm resistor to indicate state
The Schematic and Breadboard Setup
The PS/2 part as discussed in my minimal PS/2 keyboard post doesn’t require any other hardware than the ATtiny. The piezo element uses a 1 Mohm resistor like in the Arduino Knock Sensor tutorial, providing a path for voltage level to get back to zero over time. The LED is connected to PB4.
The PS/2 connector also provides power to the device. Instead of soldering a custom PS/2 connector for the project, I took a passive USB-PS/2 adapter I had lying around and used a multimeter to find out which USB pins correspond to the PS/2 ones. Not surprisingly, PS/2 GND and VCC are connected to USB GND and VCC. In my adapters, PS/2 clock was connected to D+ and data to D-. You can see the mnemonic printout I made on that one below, as well as one possible breadboard configuration. Continue reading Turning PC On with a Knock Using ATtiny45 and a Piezoelectric Sensor
A quick weekend tip for a change, I thought to share a nice small soldering project will make programming ATtiny45 and ATtiny85-based projects a flash:
Basically I took a piece of veroboard, soldered some extra long pin headers on the bottom so it will form a tent of sorts above a ATtiny45/85 attached to a breadboard project. Then I soldered a 6-pin header to attach the ISP programming cable to, and used short pieces of jumper wire to route the header pins to correct ATtiny85 pins.
Now whenever I need to flash a ATtiny45/85 project sitting on a breadboard, I can just put this on top of that and never need to look up the pin layout again!
You can click the images for larger versions. I’ve also been quite busy with my PS/2 projects, so I have some nice material to share regarding that when I have some free time again in my hands!
Having done half a dozen V-USB tutorials I decided it’s time to whip up something cool. As USB keyboards were an area untouched, I decided to make a small USB HID keyboard device that types a password stored in EEPROM every time it’s attached. A new password can be generated just by tabbing CAPS LOCK a few times (4 times to start password regeneration and one tab for each password character generated, 10 is the default password length). Below you can see the device in action:
The place I work at requires me to change my password every few months so this would be one way to skip remembering a new password altogether (as long as I remember to write it down before regenerating a new one so password can be changed :).
What is inside?
The device is powered with a simplified version of the hardware I used in my ATtiny85 USB tutorial – I stripped away the LCD, reset pullup and both capacitors. If you’re better in cramming components inside enclosures I suggest adding at least a 0.1 uF capacitor between VCC and GND, but it seems to work fine even without it: