Skip to content
/ Metron Public

Arduino measuring tape with HCSR04 and 128x32 I2C OLED display

Notifications You must be signed in to change notification settings

jscrane/Metron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metron

Digital "measuring tape" with OLED display and HCSR04 ultrasonic distance sensor.

Hardware

  • ATtiny84
  • Push-button
  • 10k resistor
  • 22k resistor
  • 2x 100nF ceramic capacitor
  • 128x32 I2C OLED display
  • HCSR-04 ultrasonic distance sensor module
  • 10k NTC thermistor (B = 3435, see below)
  • 1k resistor
  • 2N3904 transistor
  • 5v boost converter module
  • AAA battery and holder

Software

Thermistor

Assuming operating temperature is in the range [0, 50) degrees C, we generate an array of resistances as follows:

(defn steinhart-hart [R0 B]
  (let [T0 298.15
        rinf (/ R0 (Math/exp (/ B T0)))]
    (fn [T] (Math/round (* rinf (Math/exp (/ B (+ T 273.15)))))))

(map (steinhart-hart 10000 3435) (range 0 50))

This is for an NTC part with R0=10k and B=3435, see the description of the Steinhart-Hart equation.

(Conveniently all of the values in this range fit in 16-bits so the entire array takes up only 100 bytes of flash.)

About

Arduino measuring tape with HCSR04 and 128x32 I2C OLED display

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published