Waterproof DIY momentary-push switch

[Patman2700] has a nice scope for his paintball gun that uses a red dot instead of cross-hairs. The problem is that he kept forgetting to turn it off which ended up running the batteries down frequently. His solution to the problem was to get rid of the toggle switch used to turn it on and replace it will a home-made momentary push button switch. Now he presses the switch to aim and doesn’t waste juice when he’s running around, trying not to get pelted with paint.

Since this is used outside he wanted it to be water-tight. The switch is built using materials we’ve seen in previous diy switches; adhesive-backed copper sheets for conductors, foam to keep them separated until pressed, and plastic as a support. Copper is applied to the plastic base, with a ring of foam separating the base from the second layer of copper. When squeezed, the two layers of copper come in contact to complete the circuit. To make it work a bit better [Patman2700] added a dab of solder in the center of the bottom copper layer so there is less distance between conductors, and used extra foam to build up a bump in the center of the assembly for a better ‘button’ feel. The whole thing is encased in shrink-wrap with the seams sealed with super glue to keep moisture at bay.

Open Call: send us your Debounce code

If you’ve ever designed an embedded system with at least one button you’ve had to deal with button debouncing. This is also know as contact bounce, a phenomenon where a button press can be registered as multiple button presses if not handled correctly. One way to take care of this is with a hardware filter built from a resistor-capacitor setup, or by using a couple of NAND gates. We find that [Jack Ganssle] put together the most comprehensive and approachable look at contact bounce which you should read through if you want to learn more.

We’re interested in software solutions for debouncing buttons. This seems to be one of the most common forum questions but it can be hard to find answers in the form of reliable code examples. Do you have debounce code that you depend on in every application? Are you willing to share it with the world? We’d like to gather as many examples as possible and publish them in one-post-to-rule-them-all.

Send your debounce code to: debounce@hackaday.com

Here’s some guidelines to follow:

  • Please only include debounce code. Get rid of other unrelated functions/etc.
  • You should send C code. If you want to also send an assembly code version that’s fine, but it must be supplementary to the C code.
  • Please comment your code. This will help others understand and use it. You may be tempted to explain the code in your email but this info is best placed in the code comments
  • Cite your sources. If you adapted this code from someone else’s please include a note about that in the code comments.

As an example we’ve included one of our favorite sets of debounce code after the break. Please note how it follows the guidelines listed above.

[Read more...]

Build a simple switch

Forget hacking an easy button, grab a couple of those outdated CD-Rs and build your own switch for that next project. This was developed with handicapped accessibility in mind; assembled easily with common products and it’s fairly robust. In fact, our junk box has everything you need except the adhesive backed copper foil. Combine two old CD’s, covered in copper on facing sides, separated by two strips of Velcro to separate the conductors. When pressure is applied, one CD flexes to make contact with the other and complete the circuit. So easy, yet we never thought of it. We’ll add it to our list of homebrew input devices.

[Thanks Michael]

My what a large capacitor bank you have

[Daniel Eindhoven] put together this 11,344 Joule capacitor bank that he says would be perfect for weapons such as a rail gun, coil gun, or electrothermal-chemical gun. He machined a couple of aluminum plates to act as a positive and negative bus. The two are separated by a denuded sheet of PCB (making us wonder how he got the copper to peel off like that). Once charged there’s the little problem of how to discharge the system without getting bit, which [Daniel] solved by building a pneumatic switch. We didn’t find the test-fire footage very interesting but we did embed the demonstration of his switch after the break.

[Read more...]

That light switch is disgusting!

[Katrin Baumgarten] has fourteen switches that are made to gross you out. From a button that retreats into its hole as your finger approaches, to a mysterious goo-oozing faceplate, to a hairy housing that gets aroused as your try to flip it on, the intrigue is enough to get you to try out the next creepy node in the network. There’s a clip of several different switches after the break and if that’s not enough she’s got more on her Vimeo channel.

[Read more...]

Unlocking the crippled potential of an unmanaged switch

[Sprite_TM] outgrew the features of the cheap unmanaged TL-SG1005D switch he was using on his home network. Instead of buying a new and much more costly switch he cracked the cheap one open and found that the RTL8366SB chip inside possessed the ability to work harder but was crippled for sale as a low-end model. It wasn’t as easy as that oscilloscope firmware upgrade we saw a while back. He had to add an AVR ATmega88 to send I2C commands to the switch. Turns out that the I2C protocol wasn’t standard and after much head scratching he found some Linux drivers for the chipset that gave him enough info to send the configuration commands he needed. Now he’s go the managed switch he needed for his VLAN for the cost of a microcontroller and some wire.

Update: IR controlled lighting

[Muris] is back with another infrared controlled lighting hack. When we checked in with him last year he was showing off an IR controlled dimmer module. Now he’s back with this device that is CFL friendly. Because standard CFL bulbs are not dimmer compatible he’s adapted the project away from dimming and toward switching. The new design still uses an infrared remote but now it can turn two devices on and off again or toggle between them. Our favorite part of the build is that the PIC based device can learn the codes of whichever remote you choose, rather than having to rely on one specific type of remote.