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 nooby needing a sketch to simulate action of a pot
  • 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
  • Replies 2 replies
  • Subscribers 391 subscribers
  • Views 289 views
  • Users 0 members are here
Related

nooby needing a sketch to simulate action of a pot

coldfire0101
coldfire0101 over 8 years ago

hi to all

 

ive just started venturing into arduino land for various projects that keep springing to mind. i seemed to have hit a road block which maybe simple for some people here or ive just overlooked the obvious. i need to simulate the actions of a potentiometer moving from 0v up to 5v and back down to 0v in a continuos cycle, i also need to be able to set the increments in which the sim pot steps up in ie 0.01v or 0.02v etc, the delay between each increment also needs to be adjustable ie 0v 15ms  0.01v etc.

 

any and all help appreciated

  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 8 years ago +1
    Hi Gavin, The Arduino Uno doesn't (as I understand) have a digital-to-analog converter (DAC) built-in. So there is no analog output capability. It would require an external DAC circuit or perhaps PWM suits…
Parents
  • shabaz
    shabaz over 8 years ago

    Hi Gavin,

     

    The Arduino Uno doesn't (as I understand) have a digital-to-analog converter (DAC) built-in. So there is no analog output capability. It would require an external DAC circuit or perhaps PWM suits your needs. You didn't specify the actual end goal so it's not clear. It might or might not meet your needs.

    Anyway, PWM provides an output which changes rapidly and the _average_ voltage over time can be set to (say) 0.1V or 0.2V. But at any point in time the actual voltage will be close to 0V or 5V. See here for more detail:

    PWM

    There is also information at that site on how to smooth the output so that the average looks closer to the actual output at any time, and that involves at the least using a resistor and capacitor (the formulas are there too). This is still just an approximation of what the potentiometer is really doing, and again to know if it would meet your needs would require knowing a lot more detail about your end goal.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • coldfire0101
    coldfire0101 over 8 years ago in reply to shabaz

    what im trying to do is control a scan feature that is used in a radio. currently ive got it my sketch set to recognise 0v - 5v on pin a0 from the pot for the scan range so 87.5 to 108. i trying to find a way to drive that pin a0 up and down continuously without using a pot. ive also been looking at making something to drive that pin maybe using a 555 timer or something

     

    edit

    ok my boo. the pin im using for the pot is a0 this connects to the center pin on the pot

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • coldfire0101
    coldfire0101 over 8 years ago in reply to shabaz

    what im trying to do is control a scan feature that is used in a radio. currently ive got it my sketch set to recognise 0v - 5v on pin a0 from the pot for the scan range so 87.5 to 108. i trying to find a way to drive that pin a0 up and down continuously without using a pot. ive also been looking at making something to drive that pin maybe using a 555 timer or something

     

    edit

    ok my boo. the pin im using for the pot is a0 this connects to the center pin on the pot

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
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