Let's Make Robots!

Help with smoking pot(s)

Chris the Carpenter's picture
Well, I thought this would be simple, I'm a bit embarrassed really. I was hooking up a simple 5k potentiometer to one of the ADC inputs of a picaxe28. I had +5v to one terminal gnd to the other outside terminal and signal to the center pin. I used readadc and a debug and the set-up worked and did what I needed, however after about 20 seconds came the evil blue smoke. What did I miss? Man, I feel like an idiot -such a simple thing to hook up. Any ideas?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
robologist's picture

How about this for a safe(r) pot usage (on the right with 2 dangerous wiper positions, compared to the left) :

paint drawing of potentiometer use

 Just add a resistor to the wiper, and it would limit the current. Probably a 500 ohm or 1k is all needed.

 

Dave

anachrocomputer's picture

Glad to hear that you've found the source of the problem!

Oh, and thinking about the audio vs linear taper thing, with a linear pot, you should get a reading from the ADC of about 128 with the pot in mid-position.  And 0 at one end, and 255 at the other.  Which is probably what you'd want.  With an audio taper, you wouldn't get 128 in mid-position. Incidentally, here in England, we call it a log pot or a linear pot (that's log, short for logarithmic).

GroG's picture

The typical radio shack pot is on average 1/4 watt, as anachrocomputer explained the resistance value (5K or 10K) makes no difference on how much current the pot can handle.

Just take a resistance meter and measure the different points of the pot as you turn the knob. It should become very apparent quickly which pins are which (signal will always be one of them if it changes - so will be able to isolate signal very quckly - e.g. test 2 pins, move the knob, if the value changes one of the pins is signal - test the untested pin and one of the pins you have tested if it moves when you move the knob then the pin which was in both tests is the signal). Then measure your source voltage and the ADC voltage value.

It sounds like you might have accidently connected the potsignal to ground (that could explain the short), and your making a fixed resistance bridge with the resistors you've added.

GroG
my robots
my garden

Chris the Carpenter's picture

I would first like to appologize to everyone for wasting you guys' time. Yup, it was a stupid, simple problem...

Grog -you got it! Much love to you.

So here's the deal AND IMPORTANT INFO TO EVERYONE USING THE 28 BOARD!!!

*****Note*******

The ADC inputs on the 28 board are set up a little funny. (And I should have remembered this from the time I fried my sharp sensors)

Ground is on the INSIDE!

Hot is on the OUTSIDE!

And....... 

SIGNAL IN IN THE MIDDLE!! --THE MIDDLE I SAY!!!

So I guess this is a lesson to all:

Allways check your pins. Especially if you use servo connectors as the red turns into the signal wire and orange is V+.

_______________________________________

Well, I'm going to chalk this up to a learning experience. Thank you, thank you all for helping me! Much Love.

 

C the C 

OddBot's picture

Even these "BUGGER!, I stuffed up" post are a good reminder and an education for newbies.

I like the tattoo ring idea. As an electrician I was not allowed to wear metal in the powerstation where I did my apprenticeship. They showed us photos of guys who fried their fingers or worse as a result of wedding rings.

fritsl's picture

Now, why are you giving GroG the credit?

I wrote:  +/- to either side, ADC in middle

I want that credit from GroG!

GroG's picture

GEEZE - YOU TURNED INTO QUITE THE MEGLOMANIAC !

BUT I'LL STILL GIVE YOU MUCH LOVE !

PS - My diagram was prettier ! 

GroG
my robots
my garden

Chris the Carpenter's picture

See, this is what is so confusing!

I am using a standard 28 board, the one from start here, in a very standard way! It has a total of 4 adc channels, 2 of which cover my sharp IR distance sensors, one is to the pot and the last is open. Digital inputs include my IR sensor for my remote control (also O.E.M for this board), one for sonar echo and another digital input is connected to my encoder on one wheel. The outputs are my drive servos, head servo, sonar trigger and that's it. Also, I am using servo connectors for all conections to the board so everything is color coded. It is all on the up and up. Again, this has got to be a very simple, stupid mistake I am making. I think I am just going to have to grab my multi tester and check every wire and pin -step by boring, slow step...

 

-Keep givin' me whacha got, though.

Thanks bunches 

anachrocomputer's picture

Audio taper is used for volume controls and the like.  It has a logarithmic relationship between knob position and resistance.  Linear taper is, well, linear.  Resistance is directly proportional to knob position.  You probably want linear for this sort of circuit.

 

Resistance value will not affect the amount of power a pot will handle.  They're normally just a fraction of a watt, and that's the overall rating for the whole track.  If you try to pass a large current through just a small part of the track, you'll get smoke.

 

Sounds like your circuit still isn't right, though, because if you wired it up like your diagram shows, you should get 0-255 readings from an 8-bit ADC.   And, you shouldn't need any other resistors, either.  Your diagram is correct!  Are there any other circuits on the Picaxe that connect to that pin, like a LED or a TTL chip's input?  Or is that pin any part of an in-circuit programming setup?  I'm asking because I'm trying to find out if there's anything else in the system that could be drawing excessive current from that pin.

Chris the Carpenter's picture

Well I got it working, but with simple trial and error and I don't know what I did.

First I tried a resistor bridge to knock the power down before it even got to the pot. I dunno if I got the values wrong or what but no-go. I ended up with a breadboard and a bunch of assorted resistors with a debug window scrolling away on my screen. I randomly swapped out resistors (one resistor in series on the V+ in and one resistor in series on the signal out to the ADC input) until it worked and didn't get hot. What I have now is something that works however the values it is spitting out are something like 125-175 instead of 0-255. Hey, it works for what I am doing now but I still don't know what I did wrong or right.

P.s. Anyone know anything about this whole audio-taper, linear-taper etc. business? I am begining to think this might have something to do with it. And again, I have to think a 10k pot would handle a little more juice than a 5k. --I'll take any ideas you got.