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?
Hi Chris,Post your circuit
Hi Chris,
Post your circuit diagram -> 1 picture = 1000 words
My guess (without diagram) is, your sinking too much current, and should have used a biasing resistor somewhere else in your circuit.
Did the pot smoke and not the pic? or both?
Current…
Hey Grog,
I think it is a current problem… The connections are simple 3 terminals on the pot, Left is +v : Center is signal : Right is Gnd.
I think in might be the fact that it is only a 5k pot. All the "pull down to gnd resistors I have seen are 10k and above. Do you have any thoughts on some current limiting resistors to pull the current down a bit? Or maybe some thoughts on only using 2 of the pins on the pot (to V+ and signal) and using a pull down resistor on the signal pin to grnd. I dunno. Like I said I am missing something very simple here. By the way, it was only the pot that smoked, not the pic.
Center is signal to what?
Center is signal to what? I’m guessing without a diagram to some AtoD input on the PIC? If the signal pin is grounded in some way and you turn the pot all the way in one of the directions you will have a direct short 5v -> GND, with no current limitation except the wire itself. (poof goes the magic smoke)
the picture on the left is a pot in middle position. the pot in the middle has been turned so a direct short occurs if the signal is grounded in some way. the drawing on the right has a current limiting resistor to protect the pot if its cranked all the way in one direction
see pictures are good :)
PS - do you have a tattoo on your finger - i tried to convince my wife we could get them when we married, you don't loose them, they don't get caught in machinery, etc .. and if you ever get a divorce you can commit Yakuza ... she wasn't convinced :P
I hook em up like that all
I hook em up like that all the time; +/- to either side, ADC in middle, readadc, bingo, no prob!
Perhaps your pots are special ones, try some others?
I’d have to agree with the
I’d have to agree with the always pragmatic Frits, maybe what you think is signal is ground?
Did you check the pot with a “measuring thingy”(dk) ?
Check the pin programming
It’s clear that there’s too much current flowing through the wiper circuit of the pot. One cause might be that the microcontroller’s pin is still programmed (by default) as an output, which means that the chip is driving current through the pin. Have you made sure that the software reconfigures the pin as an input, and have you made sure that the pot is really connected to the right pin?
Well, I got it… sorta…
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.
Tapers and stuff
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.
hey anachro,
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
Yup, I’m stupid…
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
The typical radio shack pot
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.
Good news, everybody
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).
How about this for a safe®
How about this for a safe® pot usage (on the right with 2 dangerous wiper positions, compared to the left) :
Just add a resistor to the wiper, and it would limit the current. Probably a 500 ohm or 1k is all needed.
Dave
Now, why are you giving GroG