Show Posts
Pages: 1 ... 128 129 [130] 131 132 ... 280
1936  Using Arduino / General Electronics / Re: What is the minimum wiring for two switches? on: February 09, 2013, 06:30:39 pm
The minimum wiring for a switch is to connect the switch between the microcontroller pin and ground, then in the sketch, turn on the internal pullup resistor. This will cause the pin to be HIGH when the switch is open (or if it's a normally open button switch, when the button is not pushed), and LOW when the switch is closed (button pushed). That might be backwards from the obvious way to think about it, but it saves the external resistor. For two or more, just connect each switch between a pin and ground.

Set the pin up as follows:

void setup(void)
    pinMode(2, INPUT_PULLUP);    //set pin 2 as input with internal pullup resistor enabled
1937  Topics / Education and Teaching / Re: Career Day on: February 09, 2013, 05:44:11 pm
Teach them to count in binary. I did a career day once where I did this. It might have been more 4th and 5th grade kids, though.

I started by asking the kids how computers kept track of numbers. Of course they had no clue. I said that computers only had electricity to work with, and asked what was the simplest thing that could be done with electricity. By toggling the room lights a few times, I got to on-and-off. Next I talked about using on-and-off electricity as a code. I had four red 25-watt light bulbs fastened to a board and asked with those four bulbs, if each could be on or off, how far could we count. Of course "four" was the most common answer. I told them in fact that we could count 0-15. I reminded them of how we count in base 10; most are familiar with the "ones place", "tens place" etc. Next I dropped cylinders around each bulb on which I had printed large numbers, 8-4-2-1 (these were just 8.5" x 11" sheets rolled into a tube and taped). I introduced binary by saying computers don't have ten fingers, they only have electricity, which can be on or off, so base 2 instead of base 10. Easy to lose them at this point, but talk about just having two digits, zero meaning the light (electricity) is off and one meaning on.

I had a counter circuit driving the bulbs with triacs. (Some high-brightness LEDs would have been easier.) I was surprised how fast they caught on. I wrote the binary equivalent with ones and zeros on the board as I stepped the counter. They all want to push the button to step the counter!

I finished by telling them that they were all now computer experts, because they understood the binary language, and that they should be sure to go home and teach it to their parents that evening smiley-grin

The other thing that they just loved was tearing down computers. I procured a couple old desktops from work that were destined for the scrap heap. I pointed out and described the main areas, CPU, memory, disk storage. Beforehand I had removed the cover from a disk drive as well so they could see the inside. Several of them asked if they could have parts from the computer. So the chassis came back home with me, but were missing memory and other such things as would fit in small pockets.

1938  Using Arduino / General Electronics / Re: need to know what resistor to use for my project on: February 09, 2013, 02:23:27 pm
We got 20-24", heading out to clear the driveway in a few minutes.
End of the driveway is over 4' from the plows, right up to the bottom of the mailbox.

Yikes! smiley-eek  Hope you have a snowblower. Either way, don't hurt yourself.
1939  Using Arduino / Networking, Protocols, and Devices / Re: Read parameters of xbee on: February 09, 2013, 02:21:23 pm
To connected the xbee with arduino I use the xbee shield
You misspelled "one of the dozen or so".

Yes, it's kind of a shame too.  Makes it hard to pick the right one and they take up shelf space where other shields could sit.  They just add to the confusion.  Another rant issue I have is that they cost way too much.  With the competition, they should be cheaper.  I feel kind of odd paying more for a shield than the module that fits in it.  Just rantin'  ;-)

Good point. I prefer to use an adapter like Adafruit's on a breadboard, or if I really want to go bare bones, this one from Sparkfun which does nothing electrically, but adapts the module to fit the 0.1" breadboard spacing.
1940  Using Arduino / Project Guidance / Re: RISING and FALLING interrupt on same pin? on: February 08, 2013, 11:36:46 pm
Use a pin change interrupt, or INT0 and INT1 can both be configured to interrupt on any logical change. Looks like it will be up to the code to determine rising or falling, but that should be straightforward. Read the pin first thing in the ISR, if it's low, then falling, if high then rising. So one ISR rather than two, but the same functionality can be accomplished I think.
1941  Using Arduino / General Electronics / Re: need to know what resistor to use for my project on: February 08, 2013, 11:26:53 pm
Ah, blizzard, its just snow!
Greater hindrance is the governor banning all traffic on the roads with fines & jail time smiley-cool
(except public safety kinds of vehicles - and the media!)

Wow, that is serious.  Sure am glad the media can do their thing though smiley-zipper

How much snow?
1942  Using Arduino / General Electronics / Re: need to know what resistor to use for my project on: February 08, 2013, 08:03:10 pm
Oh, OK, 330 will be fine. It's a current-limiting resistor for the LED. With 330 it might not be as bright, but actually 330 is sort of my "standard" resistor for most 5mm LEDs, many of them are quite bright with 330 ohms at 5V.

Good luck digging out. The storm has moved out here, it will be a cold and clear night with lows around 5°F. We had maybe 4" or 5" of snow, so nothing all that remarkable here.

Good weather to stay in and play with microcontrollers, enjoy!
1943  Using Arduino / General Electronics / Re: what the flux? on: February 08, 2013, 05:42:48 pm
Denatured ethanol or tetrachloroethylene, a toothbrush, and an air compressor. Brake cleaner (Brakleen brand in the red can, not the green can) is tetrachloroethylene, and works well. Best used outdoors.
1944  Community / Gigs and Collaborations / Re: Tons of new Arduino jobs on: February 08, 2013, 05:38:19 pm
I wonder what the pay scale is for "genius"?
1945  Using Arduino / General Electronics / Re: need to know what resistor to use for my project on: February 08, 2013, 05:28:36 pm
I might go back to RS and get some 100 ohm resistors.

My crystal ball is in the shop, so I can't comment on whether a 330 ohm resistor would work, without seeing the project (hint: got a link?)

If you have three 330-ohm resistors, put them in parallel, that will give 110 ohms.
1946  Using Arduino / Programming Questions / Re: Meddling with the runtime clock on: February 05, 2013, 08:33:53 am
Substitute a variable in place of using millis() directly. Instead of

if ( millis() ... whatever ) { ...


unsigned long ms = millis();
if ( ms ... whatever ) { ...

Make sure the code works as desired that way, then to test what happens around rollover, something like this:

unsigned long ms = 4294957296;    //ten seconds before rollover
if ( ms ... whatever ) { ...
1947  Using Arduino / General Electronics / Re: track separation for mains voltages on: February 05, 2013, 08:02:49 am
I've used these optoisolators and just followed the examples in the datasheet, no diac required, as the output side includes a silicon bilateral switch which is similar to a diac.
1948  Using Arduino / Project Guidance / Re: Will this setup cause a fire? on: February 05, 2013, 07:49:23 am
For what it's worth, this Wikipedia article says it's good for .577 A per conductor and 125VDC. Seems there are 8 conductors per wire so that gives you under 5A per wire; your 7A is asking for trouble.

And since the peak value of a 120VAC sine wave is around 170V, the answer to the original question should be abundantly clear.

Too often on this forum we are presented with a solution rather than a problem, and asked, "Will it work?" Not only can this be difficult to answer without knowing the problem, but it precludes alternate suggestions that may represent improvements on the original "solution".

In this case the answer is clear: Yes, this could very well cause a fire as the cable is clearly being operated beyond its specifications, relative to both current and voltage.

At the risk of sounding like a broken record (remember records?), I will ask again: Why do you want to do this?
1949  Using Arduino / Networking, Protocols, and Devices / Re: ZB-Pro Router issue in large network on: February 05, 2013, 07:29:50 am
Now, I'm going to try a nonsense. I change the 'sleep mode' to 'pin hibernate' in one router (I know it must be always awake), and let it falls asleep for an hour, then I wake it up, and try again the communication.

I would have to agree that is nonsense, as the product manual (p34) says:

A router has the following characteristics: it
•Must join a ZigBee PAN before it can transmit, receive, or route data
•After joining, can allow routers and end devices to join the network
•After joining, can assist in routing data
•Cannot sleep--should be mains powered.
•Can buffer RF data packets for sleeping end device children.
1950  Community / Gigs and Collaborations / Re: I need a hundred bright morse code emitters - must be light, bright and small. on: February 01, 2013, 06:29:00 pm
A single LED is not bright enough.

There are some pretty bright individual LEDs out there.
Pages: 1 ... 128 129 [130] 131 132 ... 280