Show Posts
Pages: 1 ... 8 9 [10] 11 12 13
136  Using Arduino / Programming Questions / Re: Arduino is freaking out with +19,000 bytes sketches on: February 03, 2011, 01:02:48 pm
Is there a way to make the sketch output the current SRAM usage to the serial port for debugging?
137  Community / Exhibition / Gallery / Re: Bathroom alarm system on: February 02, 2011, 11:59:55 am
hehe, We're on a well with a septic system, no point in conserving that small amount of water, it just goes right back where it came from. smiley-wink
138  Using Arduino / Sensors / Re: How does Ardupilot do it?? GPS accuracy issues !!! Distance Calculations on: February 02, 2011, 01:24:18 am
Is there a way to put everything to the left of the decimal into a long, and everything to the right of it into another long, and work with the number that way?
139  Using Arduino / Audio / Re: rMP3 (MP3 Shield) Giveaway! on: February 02, 2011, 01:10:46 am
Shame I don't use twitter.. I'll just have to look into buying one I guess.
140  Community / Exhibition / Gallery / Bathroom alarm system on: February 01, 2011, 08:36:18 pm
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? smiley 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..
141  Community / Exhibition / Gallery / Re: Another way to do periodic timing (Timer2) instead of millis() on: January 31, 2011, 12:00:05 pm
Ahhh.. Ok, thanks.
142  Community / Exhibition / Gallery / Re: Another way to do periodic timing (Timer2) instead of millis() on: January 31, 2011, 03:58:09 am
Great information.. But where did you get the 16000000 that you divide by?
143  Using Arduino / Sensors / Re: AC on: January 30, 2011, 11:36:23 pm
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..

credit: david in #SeattleRobotics.. smiley
144  Development / Suggestions for the Arduino Project / Re: Better idea for SMT Uno on: January 28, 2011, 08:03:04 pm
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. smiley
145  Development / Suggestions for the Arduino Project / Better idea for SMT Uno on: January 28, 2011, 11:37:30 am
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.
146  Using Arduino / Programming Questions / Re: LoLShield library on: January 28, 2011, 01:29:49 am
Ok. Thanks for the info.
147  Using Arduino / Programming Questions / Re: LoLShield library on: January 26, 2011, 10:09:26 pm
anybody?
148  Using Arduino / Motors, Mechanics, and Power / Re: Interfacing multiple TIP120's with PWM on: January 26, 2011, 07:13:11 pm
That's great. You can still use that heatsink, you just have to get insulator kits for the TIPs. Mouser sells them, part # 532-4880M, $1.15 a piece..
149  Using Arduino / Motors, Mechanics, and Power / Re: Interfacing multiple TIP120's with PWM on: January 26, 2011, 04:01:14 pm
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.
150  Using Arduino / Programming Questions / Re: LoLShield library on: January 26, 2011, 01:17:04 pm
And yes, I did try emailing the guy that made the thing, he didn't write back.
Pages: 1 ... 8 9 [10] 11 12 13