element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum potentiometer instead of rotary encoder
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 14 replies
  • Answers 4 answers
  • Subscribers 395 subscribers
  • Views 3234 views
  • Users 0 members are here
  • help
  • digital
  • me
  • pulse
  • please
  • arduino
  • analog
Related

potentiometer instead of rotary encoder

tomstr21
tomstr21 over 9 years ago

Hello,

I have an project where i don't wanna use a rotary encoder because it has "unlimited" range of motion.

So i thought about using a potentiometer and somehow convert the analog input to digital pulse -what I mean: I need the range of pot to mean 170 pulses (if you would have a 170 ohm pot then 1ohm will be one pulse on the output)-if you're increasing the resistance it will pulse one pin and if you'll decrease it will pulse another pin-also it'll be awesome if you can change the "pulse range" with a dip switch (maybe something like 150-170-190).

I'm not programmer so I would be thankful for help.

 

 

Thanks,

Tomas Vostradovsky

  • Sign in to reply
  • Cancel

Top Replies

  • fvan
    fvan over 9 years ago +2 suggested
    Why not try the following: * take a 10k pot * use analogRead on the Arduino to read the value * divide the measured value by 6 (1024 / 170), giving you your pulse value Something like that ? int potentiometer_pin…
  • beacon_dave
    beacon_dave over 9 years ago in reply to tomstr21 +2 suggested
    Ok, go here and watch tutorials 1 to 4: Jeremy Blum Arduino Tutorials and you will no longer be a 'total noob' Tutorial 4 shows you how to check the current analogue value and do something with it, but…
  • beacon_dave
    beacon_dave over 9 years ago +1 suggested
    Perhaps take a look at this tutorial: https://www.arduino.cc/en/Tutorial/AnalogInOutSerial Connect the potentiometer wiper to the analogue input and then use the map() function to scale the range from…
Parents
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago

    Some more advanced and in my opinion detailed tutorials here Fast Track to Arduino Programming  detailing how to deal with the analog reading and other fun stuff. I am over due updating it but it is more up-to-date than Jeremy's but perhaps a bit more complex too.

     

    As far as using a rotary encoder, a simple limit trap in you code would easily deal with that

    as an example

    if value > MAXlimit, value = limit

    if value <MINLimit value = MINLimit

     

    There is nothing wrong with using a rotary encoder and there easy to use with the available libraries

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tomstr21
    0 tomstr21 over 9 years ago in reply to Robert Peter Oakes

    My problem with rotary encoder is that I wanna make a pedal that for it's range of motion can develop 170(or150, or 190) pulses so if I'm about to use encoder with 24 clicks pre rev then it's obvious that it'd take more thank one revolution..so really- I need potentiometer that thru program makes pulses

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • kulky64
    0 kulky64 over 9 years ago in reply to tomstr21

    Why do you think rotary encoder can't handle your requirement? There are encoders with more than 10 000 pulses / rev. For your application encoder with 500 pulses / rev would suffice.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tomstr21
    0 tomstr21 over 9 years ago in reply to kulky64

    That's true... I watched several videos but I can't figure out how to write the code for it .. I don't really know if I need an arduino.. i just need to pulse two different BJT's depending on the direction you turn it .

     

    It's for tig welder pedal ... this welder uses two pins (add or subtract) -you pull one of these to ground depending on what you want your current to be

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • tomstr21
    0 tomstr21 over 9 years ago in reply to kulky64

    That's true... I watched several videos but I can't figure out how to write the code for it .. I don't really know if I need an arduino.. i just need to pulse two different BJT's depending on the direction you turn it .

     

    It's for tig welder pedal ... this welder uses two pins (add or subtract) -you pull one of these to ground depending on what you want your current to be

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • kulky64
    0 kulky64 over 9 years ago in reply to tomstr21

    Maybe something like this:

    image

    Not a proper way to do it, but it should work.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube