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
Forget Me Not Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Forget Me Not Design Challenge
  • More
  • Cancel
Forget Me Not Design Challenge
Blog "Remember Me Always!" - Part 011
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: COMPACT
  • Date Created: 8 Sep 2014 6:13 AM Date Created
  • Views 354 views
  • Likes 0 likes
  • Comments 0 comments
  • forget_me_not
  • remember_always
Related
Recommended

"Remember Me Always!" - Part 011

COMPACT
COMPACT
8 Sep 2014

A One Wire Act

image

Pictured is a 19 year old Dallas 1-Wire Demonstration and Development Kit PCB connected to my Model B Raspberry Pi.

That's right!. The 1-Wire Interface is nearly if not 20 years old. The 4/8bit parallel interfaced LCD Character modules are older at about 30 years. The DS1820 Thermometer is the component that is closest to my fingers. The other 1-Wire devices are GPIO devices. One connected to a piezo sensor to detect movement and the other to drive LEDs.

 

Adding a thermometer IC to a Raspberry Pi can be a very simple affair. One of the main features of Dalla's (Now a part of Maxim) 1-Wire Interface is that their devices can operate from parasitic power hence reducing the interface to one wire (plus a ground reference). Maxim have a range of iButtons that present only two contacts to prove my point.

 

image

 

Dynamic 1-Wire device insertion and removal testing shows that the current driver only supports the detection and insertion of new devices but not the deletion of removed devices from the /sys/bus/w1/device directory.

 

Interestingly a VDD between 2.8-5.5V is recommended to enable I/O functions for the DS2812 but a lower minimum voltage of 4.3V is required for +/- 0.5 degree Temperature conversions. This explains why VDD is connected to a voltage source rather than being tied to GND and relying upon parasitic power.

My testing shows that if you don't then you get correct device responses but useless thermometer readings.

 

Enabling 1 wire support is easy.

 

Firstly load the w1 LKM using;

$sudo modprobe w1-gpio

 

From this and if all is working a new directory called /sys/bus/w1/devices should exist.

If you perform an ls on this directory you'll find all of the connected w1 devices by their serial numbers.

 

From the desired /sys/bus/w1/devices/<device> directory of a supported device you can run cat w1_slave to obtain its current register values.

For me this works without the need of loading the w1-therm LKM for the DS1820 and DS18B20 by sudo modprobe w1-therm.

 

 

The module must be loaded otherwise the reading would not be translated into a temperature.

 

If it doesn't work for you I suggest loading it manually.

 

From here it should be hard to get OpenHAB to process its readings.

  • Sign in to reply
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