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
      •  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
Sensors
  • Technologies
  • More
Sensors
Sensor Forum Doable?!
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 13 replies
  • Subscribers 346 subscribers
  • Views 1451 views
  • Users 0 members are here
Related

Doable?!

Former Member
Former Member over 10 years ago

I am just getting into the Raspberry Pi scene so forgive my ignorance - how difficult would it be to write code that could take a distance measure (maxSonar) in mm and convert it to volume (ounces remaining). I have this hairbrained idea to try and monitor fluid levels in my beer keg or hot liquor tank. Yes I am aware of flow meters - just have the sonar on hand from a friend that I can use. Any suggestions would be greatly appreciated.

-Tad

  • Sign in to reply
  • Cancel

Top Replies

  • xever
    xever over 10 years ago +1
    It appears your range finder has a 4-20mA output, in which case you will require an ADC input to measure the distance and then eventually resolve that into volumetric measurement. The rPi does not have…
  • dougw
    dougw over 10 years ago +1
    RaspberryPi may be a bit of overkill for this application - perhaps an arduino would be simpler... Using a MaxSonar With an Arduino Arduino Playground - MaxSonar
Parents
  • dougw
    dougw over 10 years ago

    RaspberryPi may be a bit of overkill for this application - perhaps an arduino would be simpler...

    Using a MaxSonar With an Arduino

    Arduino Playground - MaxSonar

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to dougw

    Yeah I didn't get the Rpi specifically for this application but when my buddy offered a sensor and challenged me to make it work... I managed to get it wired up by following the tutorial at Maxbotix. I was rather surprised I got it working. That being said, will it damage my Rpi due to the 4-20mA output? Would I be better off getting the TI Launchpad (CC3200) offered by Christever or one of arduino boards?  

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dougw
    dougw over 10 years ago in reply to Former Member

    The 4-20 mA signal can be converted to a voltage using a resistor between the signal and ground.

    The MB7389 operates from power supplies between 2.7 and 5.5 volts.

    If you are running from 3.3V to be compatible with the RPi, the 4-20 mA output cannot exceed the power supply voltage, so it wouldn't hurt the RPi inputs. If you are running from a supply larger than the internal RPi supply you may need to choose a resistor that limits the voltage. It is the same resistor in either case since you always want 3.3 v max. V=IR .... 3.3 = .02 * 165

    So any resistor smaller than 165 ohms should work if my math is right. 150 ohms is the nearest common value. This value will generate 3v at full scale from the sensor.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to dougw

    Douglas,

     

    Thank you for the info, new to all this so I get a bit nervous around voltage, resistors, etc. I was able to get the sonar operational, now to find/write code to convert mm to ounces from the sonar. Appreciate all the info/help.

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

    Douglas,

     

    Thank you for the info, new to all this so I get a bit nervous around voltage, resistors, etc. I was able to get the sonar operational, now to find/write code to convert mm to ounces from the sonar. Appreciate all the info/help.

    • 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