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 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
element14's The Ben Heck Show
  • Challenges & Projects
  • element14 presents
  • element14's The Ben Heck Show
  • More
  • Cancel
element14's The Ben Heck Show
Forum Complete- LCD Footage Counter
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join element14's The Ben Heck Show to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 26 subscribers
  • Views 143 views
  • Users 0 members are here
  • avr
  • lcd
  • encoder
  • embedded
  • wire
  • counter
Related

Complete- LCD Footage Counter

colecago
colecago over 13 years ago

I bought an Olimex dev board on Sparkfun to help a friend on a car project.  I never ended up using it but saw an ad on Craigslist for some freelance engineering work so I made it into a encoder based wire counter.  The goal was to have a wire pulled off a reel and pinched on to a wheel so if someone pulled the wire or had some unwinder, the wheel would spin and an encoder would give feedback to a device that calculates the feet and inches.  Well after making the product things kinda fell through in a crappy way so I am posting build info up here.

 

The dev board has 6 buttons, several inputs, an LCD, buzzer, relay, and assorted other IO.  I ended up using the DALLAS input with an added cap from R8 on the micro side as a low pass filter to help with bouncing.  I used all the buttons, left/right changes the Pulses Per Inch (PPI), up/down changes the inches and feet offset, the center button resets to the setpoints, and the lower left button stores the values to EEPROM.  If you hit the center button upon power up, the EEPROM values are set to 0ft,0in,10ppi. I removed the Relay and Buzzer and tied into the relays terminal block for the encoder to plug into more conveniently.

 

You set PPI by finding your encoder Pulses per revolution, and then finding the circumference to find your inches per revolution, combine those (divide pulses by inches) to get pulses per inch.

Offset is used if you have to thread the wire so far before pulling, then you can keep track of that wire.

image

 

The code contains two interrupts, one for calculating adding and subtracting values for PPI and Offset adjustment.  If you hold the button long enough the speed of the change increases.  The second interrupt is INT0 as is connected to the encoder.  Every rising edge a pulse is added, inches are added based on PPI and feet are added at 12inches and inches are reset.  The main loop does all the button reading and lcd updating.  LCD updates when a button is pressed or when an onscreen value is changed.  I ended up using 99.2% of the flash and like 5% of the EEPROM.  I had to make my own printf function because I did not have enough space for the standard library.  Readbuttons is a routine that does all the I/O changes and matrix reading to do the button reading.

 

And that’s about it.  Here is a video of me showing it off with my raspy sick voice.  Not the greatest video, I  have a video camera but not a battery charger or stand so I used my phone.  Eventually I’ll get the better camera up and running.

http://www.youtube.com/watch?v=Vag71qeeLfw

 

I might put this thing in a box, I can tie in some better panel mount buttons, mount the screen, and maybe find a buyer.

 

It won't let me attach the source files so go to my blog below

http://blog.colecago.com/?p=64

 

I built it using code vision and their LCD library so you will need to modify it for a different compiler.

  • 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