Go Down

Topic: Garage door, getting the position (Read 4 times) previous topic - next topic

retrolefty

Quote
But, that much isn't needed either... 500 steps over 195cm makes it precise within 4mm. That should do it


And that is the main point, more then enough counts to work with. You can then map it to whatever scale you want in your code, perhaps mapped to show 0-100%

Lefty

tasosstr

An idea if it is not too late, me in that case i was using the encode and also i was monitor the voltage power if the power looks it is fail then i was write in the EEPROM the direction it has and what the persent of the door if the power fail made when the door it was close then the data it will be zero if not then go on with this values and reset the memory.  ;)

tkbyd

#52
Jun 30, 2010, 12:23 pm Last Edit: Jun 30, 2010, 12:24 pm by tkbyd Reason: 1
Regarding the wiring of your trimmer pot to your Arduino: You CAN have (unless I'm missing something!) NEARLY 0- 1023....

Your solutino of the MECHANICAL problem was BRILLIANT! The electronic wiring should go as follows....

From Arduino's 5v to "top" of pot. (If you know where to find the V-analog ref, use that. Almost the same thing.)
From Arduino's "Gnd", or "zero volts" to "bottom" of pot.
From one of the the Arduino's analog inputs to the pot's "wiper".

If you put an ohm-meter on the pot WITH IT NOT CONNECTED TO ANYTHING ELSE, and the reading doesn't change when you "turn the knob", then you are connected to the "top" and "bottom". It doesn't matter if you reverse them. (The 5v can go to the bottom if the gnd goes to the top)

Don't worry about the "short circuit" between the Arduino's 5v and the analog input which this will result in when "the knob" is "twisted" all the way to one end. The Arduino's analog input... as long has you haven't done a
Code: [Select]
pinMode({that pin}, OUTPUT);... is a "high impedence" input... it won't let much current through. (Same is true for digital I/O pins when they are set as inputs.)

eggplant

jumping on late here, but what about a simple limit switch at either end of the garage door 'swing'. if the arduino starts up from BOR or POR and does not see either 'all the way open' or 'all the way closed', it will monitor or ignore sensor input until it gets the shut/open signal. then it can start taking reliable readings. You would need two digital pins dedicated to 'open' and 'shut'.

love the idea of the tape measure! I will use that in future!

bld

Quote
jumping on late here, but what about a simple limit switch at either end of the garage door 'swing'. if the arduino starts up from BOR or POR and does not see either 'all the way open' or 'all the way closed', it will monitor or ignore sensor input until it gets the shut/open signal. then it can start taking reliable readings. You would need two digital pins dedicated to 'open' and 'shut'.

Already talked about earlier in the thread. But my tape measurer will take care of that. I am going to make it so it calibrates when it hits either of the ends, and from a power up, it will still have a pretty close idea of where the door is.

The project is just on stand-by for a week or two, until I can use my right hand normally again. :)
captain-slow.dk | non contagious!

Go Up