Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Reading potentiometers with 16F628A?

Status
Not open for further replies.

MathGeek

New Member
I need to read a value of potentiometer, which would be changing constantly (like once in every two seconds.)

Why do I need this? Read below.
------------------------------------------------------------------


I am designing a feather-weight walker (< 200grams) with four or six legs with two motors (hence two degree of freedom) in each leg.

The problems is that, currently in the market, even the micro servos or pico servos cannot satisfy my need because they have low gear reduction and consequently low torque. Not to mention the cost of purchasing them. (Good ones go very high.)

I already have a selection of gearheaded pager-motors with 96.5:1 ratio (slightly better than those servos). I think the motors suit the job perfectly ONLY IF I could have a feed back from the position of the motor. So, I decided to use potentiometer for position feedback.

One more question: what is the lifetime of a typical cheap trimpot? Could they endure 10,000 turns? (I wouldn't know because i never turned trimpot that many times, but I might have to use trimpot intead of fullsize metal pot for weight.)

Any ideas improving my project is welcome.
 
Hmm... Im not sure about the endurance issue. I could very well be wrong, but what would wrong with making an encoder? I would imagine it would save you a bit of weight if you used a pair of smd emitters and phototransistors.

Using a potentiometer might work. I know the trimmers I have dont seem to work well around 0 ohms and the maximum resistance, and that might be a problem.
 
Google around for pots. I know I have seen some with life-cycles listed. I think it's between 10,000 and a million (but I may be mistaking the million for buttons so it may be much lower).

I wouldnt worry too much about lifetime...just make it easy to replace. At 10,000 rotations, that's 3 days STRIAGHT of rotating the pot at 1 rotation per second...Would you rather have an old expensive pot? Or a brand new decently priced one? Just make it easy to replace.
 
Last edited:
Standard trimpots (especially the small surface mount buggers) have very short lifetimes. I've used some surface mount 3mm ones that were good for 20(!) rotations. I think most small screwdriver adjust pots are in the hundreds of rotations range. I'd assume that bits of resistor start flaking off after that point.

Check www.kemet.com - they had some pretty good app notes. I vaguely remember that conductive plastic ones were the most robust type.

How much accuracy do you need?
 
I would suggest using a pic that has an ADC built in such as the 16F88. A better suggestion would be to use the electronics out of an existing servo and have the pic just send it pulses.

Mike.
 
Why not make an electronic pot? It would consist of three parts:
1. LED
2. Cadmium sulfide photo cell
3. Rotating shaft with clear disk with a tapered black line.
Do you need futher directions?
 
Wait a second, I just noticed you said you want to use trim pots...why?! Trimpots are designed for equipment calibration and as such are cycled VERY infrequently. That's why the life cycle is so low. Use actual pots. (How do you plan to mount the trimpot's dial to the joint anyways? Trimpots don't have a shaft because they are designed to be hard to adjust to prevent changes in setting. Use a regular pot.

You won't be saving any money by getting an optical encoder. You might as well just save money by getting a stronger servo.
 
dknguyen said:
.

You won't be saving any money by getting an optical encoder. You might as well just save money by getting a stronger servo.

The main point was that microservos are too weak. I have motors (pager motor with 96.5:1) that are smaller than microservos and still stronger.

I actually thought of using GWS mini "L" servos--strong and light. Hmm, maybe someday.
 
Rolf said:
Why not make an electronic pot? It would consist of three parts:
1. LED
2. Cadmium sulfide photo cell
3. Rotating shaft with clear disk with a tapered black line.
Do you need futher directions?

isn't that what basically opto interrupter is? Isn't it? (Correct me if i misunderstood your post.) Look at my previous post (the one before yours).


I already have a bunch of opto interrupter. Does anyone know how to use them in a circuit?

I have done some experiments and I am getting somewhere.

Thanks for your help, guys.

Edit: Hmm, when you say "tapered" black lines, you mean black lines are different in size at different parts of the wheel?
 
Last edited:
This is what you need to build a quadrature encoder with your photo-interuptors:
http://zone.ni.com/devzone/conceptd.nsf/webmain/665470207873076386256B35007957A2

And this is to clarify how to understand which direction the motor is spinning in from the order of 1s and zeroes from the sensor:
http://www.sxlist.com/techref/io/sensor/pos/enc/quadrature.htm

YOu know what a quad encoder is? It's a spinning disc with holes (or a reflective or transparent segments) so that light can be reflected/passed back to the photo-detector. If you position your transmitter/receiver pair so that they are 90 degrees out of phase, you can tell the direction the motor is travelling in by comparing the current output pair of 1s and zeroes to the previous one. You can also derive speed by how many flashes occur per time interval. You can use this to get position information from a point of reference (if you take 5 steps to the right, then you can figure out where you are now assuming that you know where you used to be standing).
 
Last edited:
Did you know that your using an encoder right now. Yep its in your hand and sometimes can be found at a dollar store. If you were to gut a mouse you'd find 2 encoders inside the older mouse that has a ball. I've used them to make spinners for arcade machine emulation. I dont see why they couldnt be used in robot building. Just an idea for you to ponder
 
brihoo2k said:
Did you know that your using an encoder right now. Yep its in your hand and sometimes can be found at a dollar store. If you were to gut a mouse you'd find 2 encoders inside the older mouse that has a ball. I've used them to make spinners for arcade machine emulation. I dont see why they couldnt be used in robot building. Just an idea for you to ponder

Yep. You are absolutely right. In fact, I have a quite few of those (they are very cheap too!). I call them opto interrupter (which I think is more specific term.)

Now the problem is making the "slotted wheels" that go between sensors. Since I will be making quite a few "wheels" i need a easy way to do this. At the same time, the wheels have to be small.
 
Use construction paper? Easy to work with, light and small. Or maybe really thin balsa wood from a hobby store or RC airplane store. How many joints are there? If you need like 18 of them (6 legs @ 3 joints per leg) maybe you can get them laser cut from thin material at Pololulu or something.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top