element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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 Question on a part I need
  • 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 12 replies
  • Subscribers 403 subscribers
  • Views 837 views
  • Users 0 members are here
Related

Question on a part I need

Former Member
Former Member over 14 years ago

I need a rotating control to adjust some LEDs.

 

However I would like it to infinitely turn (unlike a potentiometer).

 

This is the sort of thing you would get as a volume control on an AV amplifier.

 

Any help on what they are called and links would be great.

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 14 years ago

    Well I ordered this one here...

     

    http://uk.farnell.com/bourns/pec11-4230f-s0024/incremental-encoder/dp/1703830?whydiditmatch=rel_3&matchedProduct=PEC11-4230F-S0024&Ntt=PEC11-4230F-S0024

     

    Now programming I can do (to a point) but I am new to electronics.

     

    I was expecting it to come with 3 connectors but in fact it has 5 and there seems to be no info on the data sheet on the back 2 so I am not sure how to wire it up.

     

    Any ideas?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • tronixstuff
    tronixstuff over 14 years ago in reply to Former Member

    Looking at page two of the data sheet, the diagrams for PEC11-4xxxF-Sxxxx (i.e. your encoder) do show five pins, the three pins A, B and C are for the encoder data and common. Your encoder also functions a as a normally-open momentary button (i.e. push the shaft in... it can be used as an 'enter' button for example). The other two pins are the contacts for the button. (See the "how to order" diagram on page one).

    Cheers,

    John

    PEC11-4xxxF-Sxxxx

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • tronixstuff
    tronixstuff over 14 years ago in reply to Former Member

    Looking at page two of the data sheet, the diagrams for PEC11-4xxxF-Sxxxx (i.e. your encoder) do show five pins, the three pins A, B and C are for the encoder data and common. Your encoder also functions a as a normally-open momentary button (i.e. push the shaft in... it can be used as an 'enter' button for example). The other two pins are the contacts for the button. (See the "how to order" diagram on page one).

    Cheers,

    John

    PEC11-4xxxF-Sxxxx

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Former Member
    Former Member over 14 years ago in reply to tronixstuff
    I just realised that the diagram on page 2 refers to the part number which now makes a lot more sense.
     
    I just checked the encoder and it does indeed have a push button type operation.
     
    I will have a play tomorrow.
     
    Thanks for your help everyone.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 14 years ago in reply to tronixstuff

    Got is working (kind of) using this link...

     

    http://tronixstuff.wordpress.com/2010/06/26/getting-started-with-arduino-%E2%80%93-chapter-eleven/

     

    but I seem to be getting bouncing but delays dont seem to help.

     

    Very odd.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • tronixstuff
    tronixstuff over 14 years ago in reply to Former Member

    To be honest I wasn't all that keen on rotary encoders. I wrote another example in chapter 12 (http://wp.me/pQmjR-zL) but have left them alone since. Another way to combat bouncing is to have the sketch require two movements or value changes instead of one. In other words, the sketch counts two moves but only acts as if they were one.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 14 years ago in reply to tronixstuff

    I wondered about that but Im getting random results so on a forward movment I could be 3 forward and one back or 1 forward and one back ect.

     

    Interestingly I also tried this code:

     

    http://www.arduino.cc/playground/Main/RotaryEncoders

     

    But I just get an incrementing number even when I dont touch the encoder at all.  image

     

    I have not had a lot of time to look at it so I am sure its not hard but will try to make some time today or tomorrow.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • billabott
    billabott over 13 years ago in reply to Former Member

    I will offer some thoughts for T.O.M. and others in hopes that some may find them useful in their search for enlightenment.  This problem sounds like the classic debounce dilema.  What does the digital pin on the arduino expect on its input?  Remember that the pin can be configured in one of three ways.  The choices are current source OR current drain (for output mode) OR Tri-state (Hi-Z).  External to the pin we can attach either a pull down OR a pull up resistor if needed.  The Channel A and B switches are configured to either connect the digital input pin to Vcc or Ground as is appropriate.  I will take a leap of faith and say that in all probability the center pin C is a common  to be connected to the correct level of signal voltage.  The encoder data sheet states the the maximum current the switches are rated for is 1 mA @ 5 VDC.  Therefore,  5 V / 1 mA = 5 k ohms or larger resistors are required to be placed in series with the switches to limit the current to achieve the designed life of the pico-switches inside this encoder.  This begs the question: "How many mA are required to allow the digital pin to recognize that there is now a logic ZERO signal on the pin?"  Hmm . . . oh wait . . . Doesn't "low-power CMOS" sort of necessarily imply very low current requirements!

     

    On page 76 of the ATmega328p data sheet it states: "If PORTxn is written logic one when the pin is configured as an input pin, the (internal) pull-up resistor is activated."  So depending on what the Arduino Team chose (current source or Tri-State) in the implementation of input mode on digital pins; there may not be a requirement for an external pull up resistor AND the encoder's common pin should simply be connected to ground to function without bouncing excessively.  If the signal is erratic then there is a good chance that the pull up resistor is a requirement.

     

    -=Syntax Matters=-

     

    Post Script:  Revealed on page 93 of Simon Monk's Programming Arduino GSWS book that the internal pull-up resistor is not enabled unless and until the following lines of code are executed:

    int inPin = 5;

    pinMode(inPin, INPUT);

    digitalWrite(inPin, HIGH);

     

    //(Alternative Option)

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