I wanted to get my 3 kids into the habbit of remembering to flush the toilet, so I built this device. It's pretty simple, code wise.. When the door opens, the system arms. If the door opens again without the toilet flushing, the alarm goes off. Some details on the components: I used a power cord with the plug end stuck in the water in the back of the toilet to sense the water. The electrodes are stainless steel, near as I can tell. So they won't rust. They'd still collect deposits if I used DC to detect the water, so I used a Schmidt hex inverter to generate a 1MHz AC signal, which is then picked up through a 1N4148 diode and triggers a 2n2222 transistor to pull one of the interrupt pins on the Arduino low. The door uses a magnetic reed switch, Harbor Freight sells this little door/window alarm that makes a horrible racket when the door/window is open. It's only $2, so it's about the cheapest magnetic reed switch I could find, by a fair margin. I took it apart and desoldered everything except the reed switch from it, and ran wires out the side of it from that reed switch to the other interrupt on the Arduino (using an Uno). The whole thing is stuck inside a toy robot head that I picked up at the mall last year really really cheap. It was originally a toy that you would wind up (3 phase alternator on the back of it that charged a button cell Li-Ion battery), it had a little wand with a loop on it and you'd try to weave it back and forth over the robot's curly antenna on it's head, if you touched the wand to the antenna, it'd make a warbling sound and blink his eyes/mouth LED's.. I kept that circuitry, but tied it into the Arduino. It runs off the 3.3v of the Arduino, and one of the output pins low will make it "go off". I was half tempted to just completely replace the original circuitry, but for the time being, I haven't. I could have put RGB LEDs in and really had fun with it (throbbing red eyes while armed, etc..) Maybe in the future? The alarm talks.. It initially welcomes you to the bathroom, and it'll thank you for flushing, or it'll remind you to flush, or even to shut the door. I looked into several ways of making it talk, and in the end, chose the Adafruit wave shield, simply because it was the cheapest option. I used a pair of G4 iMac internal speakers as "ears" on the robot head. I found that the waveshield just wasn't very loud, so I took apart a worthless set of computer speakers that just couldn't be used for anything because they would distort so badly, and put the amplifier board from that inside the robot head. It runs off the 9v Vin line just fine, it's 1watt at best. And finally, I wanted a way to disarm the thing manually, short of unplugging it completely. I was about ready to drill a hole in the top of it and put in a push button. Then I remembered the capsense Library. So I was able to repurpose the antenna on the top of the robot head as a touch sensor. Using a 1Mega ohm resistor, it works perfectly to detect an actual touch. The sketch (it's still a bit buggy, tends to be dead as a doornail in the morning, requiring a reset) is here: http://paste.org/pastebin/view/28255 If anyone notices a glaring mistake that might be causing that, I'd love to know. I know at one point it crashed when the door was opened and the toilet immediately flushed before the door had even shut. I've also had trouble with it crashing after the 8 minute disarm timer, though I have a return; added immediately after the disarm that might help with that.. And here's some video of it in action..
Sounds like you're trying to do the same thing I just did, to check for the presence of water at a pair of electrodes. I used a 74HC14 Hex Schmidt trigger inverter to create a 1MHz AC signal that was on the output pin in the water. To receive that signal, I created something called an "Envelope Detector", which was simply a 1N4148 diode, a small cap with a 10mega ohm pulldown resistor to ground on the output of that diode (receive pin goes to one end of the diode, output is the striped end). Ran the output to an 2n2222 npn transistor, which when triggered by the "envelope detector" will pull the CPU pin low. I followed these instructions for the Schmidt trigger oscillator: http://www.fairchildsemi.com/an/AN/AN-118.pdf and these instructions for the Envelope detector: http://www.st-andrews.ac.uk/~www_pa/Scots_Guide/RadCom/part9/page2.html
I used a pair of 2.2k resistors and a .001uf ceramic cap for the oscillator circuit, and a 1n4148, a .1uf ceramic cap and 10mega ohm resistor for the envelope detector circuit. It creates 1MHz AC..
Yeah, I figured the "adapter would have to be longer than the socket, so the CPU that's probably too wide to fit between the rows could be at the end of it (maybe underneath to keep the height down). Well, it was an idea.. Are you the guy from Systm? Or just have his picture as an avatar? I loved that show.
I think it'd be a better idea to put the SMT version of the AtMega328 onto a very small daughterboard, with two rows of pins on it, that can plug into the standard Arduino boards. This would allow people to replace the CPU on their Arduino's if it fails, or for any other reason want to change the CPU. It'd be like a breakout board for the CPU. This would have the benefit of there only being one version of the UNO board. It'd have the down side that the CPU's would cost a bit more to make, but with some volume, I bet it would be a negligible difference. Just in case I'm not making any sense, here's an example (albeit in a larger package) of the MegaSquirt 2 CPU that replaced an earlier DIP package CPU.
It sounds like you have the pinout wrong. Or do you have these TIPs all bolted to a single heatsink? The metal tab is the output, so if you have the metal tab grounded, or connected to each other, you'll encounter this sort of issue. They need to be electrically isolated.