Show Posts
Pages: 1 ... 80 81 [82] 83 84 ... 91
1216  Forum 2005-2010 (read only) / Interfacing / How do I make a resistive touch switch? on: May 02, 2010, 01:45:37 am
I've been searching for schematics on the web for how to make a touch switch, but 90% of what I find either shows how to make a capacitive touch switch, or has all these extra components like transistors and nand gates which confuse me as to how to make it function with the Arduino.

I need a resistive touch switch for two reasons:

1)  I'm building a replica prop, and the original uses a resistive touch switch, so for authneticity's sake I want to mimic this.

2) I'm fairly certain that a resisitve touch switch is not unlike a potentiometer and as such requires only one pin to function.  Capacitance switches appear to require two.

I found this post dealing with them:

But the ascii schematics aren't clear.

I'm pretty sure that what PaulS is trying to show is the following:

And I suspect that the reason mburkit was having issues is because he connected the circuit up this way:

...and because he used a 10K resistor which according to this page is much less than the resistance of skin:

Other pages I've read seem to indicate that the finger should have a lower resistance than the resistor you use in the circuit.  Which if I understand how potetiometers work, makes perfect sense.

And that page seems to indicate that a human finger has a resistance somehwere between 50K and 10M ohms.  Though I'm sure this probably differs based on how far apart you have the contacts.  (Mine will have 0.2" (5mm) or less seperation.)

But it also says a 10M resistor makes the signal noisy, so I dunno.  And PaulS didn't specify the size of resistor needed.

Also, assuming PaulS's cicuit works, I am concerned about something in the design.  When you place your finger across the terminals, they have a lot of resistance, and things are hunky-dory.  But what happens if a piece of metal accidentally comes in contact with them?  Then there's no resistor between the +5v and the pin of the Arduino.  Is that a problem?  I'm not sure, but I think that would let hundreds of milliamps of current flow and would fry the Arduino.

So to prevent the Arduino from being fried, I think I should use one of the following setups.  I suppose it doesn't matter which, since R2 would only be 1K or so.  Though perhaps it should be larger than that?  

Another thing that concerns me is how much current will be flowing across your finger.  I saw something that said 10mA is painful, and 40mA is dangerous.  But is that a concern with a battery?  I don't know.  But I could select the size of R2 to get the mA down into a safe range if that's an issue.  I suspect it isn't though.

Speaking of which, I found this page on wikipedia:

Which says the resistance of skin is 1K to 100K, which is quite a bit  different from what that other page said.  

So much conflicting info. smiley-sad

Anyway, one last thing...

When no connection is being made, do you suppose the Arduino will return 0 for the value on the analog port, or might I want to treat say, any value less than 512 as an off state?  I suppose I may need to do debouncing as well because this switch will need to toggle an action.  There's a debounce library right?  I'm sure I saw one.
1217  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 28, 2010, 08:05:54 pm
Well, I put the order in for these today.  Hopefully if there are any glitches they can be fixed with the extra pads I put on the board.  I could spend several months on this and still not be sure I've got everything right.

Assuming all goes well, I'll post some videos in the exhibition forum around May 18th when I'll have gotten the boards back and had time to put them together.

Thanks for all the help!
1218  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 28, 2010, 09:52:15 am
Anyway, if this was my board, I would move the mode and Arduino power traces over to the right and snake a ground trace from the batteries, jog right and beside the power trace up to the ground pin of the Arduino, rather than sending it up to the LEDs, and then over to the Arduino.

I assume you mean connect the ground trace to the ground pin on the right side of the Arduino.

Problem with that is then the Pot1 and R4 grounds have to go through the small traces on the Arduino.  And I'm guessing that if everyone feels these ground traces need to be thicker, taking that shortcut would be bad.

I was having a hard time figuring out the A4/A5 box in the upper right.  Is that a jumper?

If by jumper you mean a place where I can solder a couple wires to connect to those analog pins on the Arduino because they're in the middle of Arduino instead of at the edge where they would be more easily acessable, then yes.

If by jumper you mean a couple pins I intend to short, then no.

Anyway, I would rotate it and move it above R4 and put an .1 bypass on the Arduino in its place.

I'm not sure what you're suggesting.  What's a .1 bypass and where would that go?

It's okay to put the 47ufd across the battery, although it would be more common to put it after the power switch.  No harm where it is.

Too late, already fixed. :-)
1219  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 28, 2010, 09:40:24 am
Rerouted the capacitor so it's across the power switch:

1220  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 28, 2010, 09:00:50 am
Hm... should I have connected C1 across the battery termianls like that?  I'm thinking that might drain them, though I have no idea if that would take days, weeks, or months to have any effect.

I'm thinking maybe I should have connected it to the line coming off the power switch that goes to the Raw pin on the Arduino.
1221  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 28, 2010, 08:50:44 am
Well, I worked on the circuit all night cleaning up the traces for power and ground which I wasn't happy with, changing the angles of some traces to take them further away from the corners of the square pads, and adding some additional pads which might come in useful for correcting problems or adding new features.  I also moved those vertical traces on the EGB screen away from the pads a bit.

Here's the final result for the controller boards:

1222  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 28, 2010, 08:44:34 am
Thanks, that's what I thought!

1223  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 27, 2010, 11:06:56 pm
I've lookd everywhere, but I can't find any examples of anyone decoupling a ULN2803 darlington array.  I see how you decouple an IC with a Vcc pin, but the 2803 doesn't work like that.  There's a Com pin, which I don't have connected in my circuit (per Grumpy Mike's suggestion) which I see is standard practice when connecting it to LED arrays.  It is connected when powering stepper motors.  I think it's to reroute the voltage spikes when the motor stops.  
1224  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 27, 2010, 07:55:16 pm
Okay, here's the revised PCB with:

* Wider power and ground traces (.030")
* 47nF decoupling capacitor across battery terminals
* Shortened power trace to voltage regulator
* Increased distance between traces and corners of square pads.
* Power trace to LED's routed around Arduino pin 1. (bottom traces only)

1225  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 27, 2010, 05:21:51 pm
The big reason for bigger power/ground is transients.  When the logic levels switch, the parts consume power; much more than the steady state.  You want the power and ground not to move at all when the outputs are switching rapidly.   The inductance is the problem, as noted.

I'm increasing the trace width for the power and ground to .030", twice the width of the other traces.  If I increase it any more than that I get too close to the corners of the square pads on my battery connections.  (Need a minumum trace seperation of .008" according to Pad2Pad)

Decoupling is there for the same reason: the inductance of the traces is big enough that the power needed for a lot of output switching causes a dip.  The capacitor supplies the power to the device during the switching period.  Usually, you use a mix of big and small capacitors.  The suggestion of one 47 ufd for the board is good.

I'll try to find space to include that then.

Then use a mix of .1 and .01 for other parts that have lots of switching outputs.  Get the power and ground as close to the chip pins as possible.  For decoupling, the ground matters as much as the power.  The ULN2803 is a prime candidate for decoupling.  The ideal is one per chip, but that is probably overkill.

One per chip is overkill?  I've only got one chip on the board. :-)

And I'm still not clear on what pins and to where this decoupling cap on the ULN2803 should go.  And whether I should use a .1 or .01uF for that.

Unlike prior advice, I usually prefer vertical on one layer, horizontal on the other - you get much more trace in less area that way.

I haven't seen anyone suggest doing otherwise?

I would route power and ground first as many have said.

I'll keep that in mind in the future, but I don't see the point of resdesiging this whole board from scratch.  I've already widened the power and ground traces and all I had to do was move a few corners of a few traces around.

Also, I added a bunch of stuff to the design after the fact, and I am working with very limited space.  I couldn't route the power and ground traces first because I didn't know all the components that would be on the board.  And even if I did, I can't see how I could have a clean layout without a bunch of vias on such a small board if I were to lay out the power and ground traces initially without regard to keeping all the other traces as short as possible.  

Plus if I had to route other traces all over the place just for the sake of the power and ground, I'd end up with a board that probably wouldn't work because I couldn't keep track of what was connected to what.

Of course, if it is absolutely vital to have thick power and ground traces that are as short as possible then obviously that trumps any other consideration.

Lastly, I can't tell which of these suggestions are 'best practices' for complicated board, and which are 'vital for it to work' on a simple board like this.  I've seen folks build 64x256 led arrays with 6 IC's on a breadboard and they worked just fine with wires going everywhere.  I don't see why these short little traces should give me all sorts of problems with noise and capacitance and stuff.

Anyhow, I'll post an update to the circuits once I finish adjusting these power and ground traces and add the spot for that 47 cap.  Come hell or high water, I gotta put in the order for these PCB's tomorrow.  That it's taken three months to develop these props is ridiculous.
1226  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 27, 2010, 04:58:54 pm
I've never seen a resistor used with a piezo unit like that, the capacitance is minimal.

I'm just going by what I was told by Grumpy Mike, and he seems to know what he's doing. :-)

You definitely need decoupling capacitors, and I'd include a bulk capacitor, something like 47 uF, across the supply as well. The supply and ground tracks should be a lot wider.

I don't know where to put decoupling capacitors.  I'll look into including a spot for a 47uF cap across the battery supply though.  Not like I have to include it if it turns out it's not needed.
1227  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 27, 2010, 03:46:16 pm
I'd start again from scratch. Route the power and ground tracks first, using wide tracks. Decoupling capacitors are essential.

You don't need the resistor for the piezo element.

I had Grumpy Mike take a look at the schematic for this, and he didn't suggest I needed any decoupling capacitors.

He did however suggest that I needed a resistor on the piezo element.  Why do you think I don't need one?  Grumpy said the piezo acts like a capacitor, and as such will momentarily appear as a short if I put it directly across two pins.  

And on top of that, I'd have no idea how much current the piezo was using, and no control over it.  At least this way I know with a 1000ohm resistor I'm only sourcing at most 5mA to the thing.

Also, starting from scratch is out of the question.  Besides the fact that I don't see how it would be necessary to make the power and ground traces wider, (Moving a few traces around a bit is sufficient to make them fit.)  I simply don't have the luxury of doing so.  I'm already way over my budget for time and money on this project.
1228  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 27, 2010, 03:28:58 pm
The reason I don't have wider traces for power and ground is partly because I've got traces going between pads and traces passing diagonally past square pads, both of which set a maximum on how wide the trace can be.

I guess my question is, how wide do you reccomend I make these power and ground traces?  .040" looks positively silly with how wide it is compared to everything else.  And at 0.050" when routing LED3 to the Arduino's ground pin over Arduino Pin 1, the trace actually touches the edge of the board, that's how close it is at 0.040".

Also, I just notcied the software doesn't give me any warnings about how close my traces get to the corners of those square pads untile they're actually physically touching at 0.050".  And shouldn't those gaps be like 0.006" at least?  Also, I could get rid of many of the traces that pass close to the corners, but then I'd have to have traces with 90 degree bends in them.

So what's more important, no 90 degree bends, or wider power/gnd traces?  And how wide must I really make those power and gnd traces?  Do I really need to go all the way up to .040"?

And what counts as a power trace anyway?  Traces coming off Battery +?  Traces coming off Arduino VCC?
1229  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 27, 2010, 07:23:36 am
Decoupling capacitors go between power and ground, with the capacitors as near the power pin as practical/comfortable.

I still don't understand.  The power going to the IC is being drawn through eight pins via the LED's.  Are you saying I should connect a pin from the gorund pin to the positive pin of the battery, or to VCC on the Arduino which is what is providing the current for the IC, or what?

I think the answer here is ground to VCC, but I'm not certain.  Also, it seems like the only good place to stick a cap that connects between ground and VCC is right above resistors R1 and R2.  And that's a rather tight space.  Hm.

? why use a surface mount C2, or at least have holes for a non surface mount cap

What are you talking about?  C2 isn't surface mount.  There's two PTH holes to either side of the label.  Is it too small?  It's the only footprint provided by Pad2Pad's software that I could find that looked like it was for a ceramic cap.

(Just double checked.  A ceremic cap needs one hole between the pins when on perfboard, so it should fit that fooprint, which looks like it was for an axial cap.)

If you can avoid tracks between pins do it.
e.g. track from LED3 to Pro mini pin 23 could go around Pin1

I tried to avoid that, but moving that trace would bring it close to the edge of the board.  And I wanted to keep traces away from the edge because I didn't know how precise they'd cut it.

Besides, if routing traces between PTH is bad, then I've got much worse problems to worry about on the screen portion of the circuit where I have about 50 such connections that were unavoidable.

3. Eliminate Via's when ever possible
e.g. track from VR1 to via under pro mini could be routed around to pin 24

Once again, that would take the trace extremely close to the edge of the board.  I did try to avoid vias, but in that one instance I thought using one was the safer choice.  Also it makes the circuit easier to parse.

[edit]Okay, I found I could route the trace on the underside of the board on the inside side of Pot1, so I got rid of the via.  There should be enough space between the trace and the top edge of the board.[/edit]

But its a great artwork for your first PCB.

Thanks!  Took me long enough to do.  I was hoping I could just use the auto router at the start, but it made a mess of a circuit and if i tried to run it on the current setup, as densely packed as it is, it would just fail over and over.  I don't know if that's typical of auto routers but the one in Pad2Pad's software at least isn't particularly intelligent.  

Probably should have used Eagle.  (Though Pad2Pad charges a premium for making boards with gerber files for some reason.)
1230  Forum 2005-2010 (read only) / Interfacing / Re: Could someone take a quick peek at these PCB's? on: April 27, 2010, 06:09:10 am
How exactly would I go about decoupling the 2803?  On which pin would I put the capacitor?  
Pages: 1 ... 80 81 [82] 83 84 ... 91