structure7 / fridgeTemps

Monitoring of a refrigerator and freezer's temperature to an OLED display.
1 stars 0 forks source link

All things door monitoring #23

Closed structure7 closed 8 years ago

structure7 commented 8 years ago

Idea for open door alarm buzzer: https://www.sparkfun.com/products/7950?_ga=1.43265765.1383511344.1455541994

Optical sensor (one is in the mail).

Reed switch might work, but I won't be able to control the distance-to-trigger as well as with an opto.

structure7 commented 8 years ago

Opto sensors works great: 20160531_152838-1

with:

#define OPTO1  16 // WeMos pin D0

void fridgeDoorStatus()
{
  if (digitalRead(OPTO1) == HIGH)
  {
    Blynk.virtualWrite(25, "OPEN");
  }
  else if (digitalRead(OPTO1) == LOW)
  {
    Blynk.virtualWrite(25, "CLSD");
  }
}

1 = OPEN 0 = CLOSED

structure7 commented 8 years ago

I might want to learn about and add a TI LM393 comparator. This is the same gizmo on my analog to digital moisture sensors (I think a pot dialing Vcc in is how this works) and might help with a surefire digital signal (although it seems to be working okay now).

http://www.dx.com/p/lm393-beam-photoelectric-sensor-black-217202#.V05d7vkrLCM

Ah! So it "compares" the value I set with the pot to the value from the analog sensor and that's the "threshold" for my digital signal. Cool: https://arduino-info.wikispaces.com/Brick-LightSensor-Analog-Digital

Side note: the TI LM358 is that I've seen on some of the opto boards: http://www.elecfreaks.com/store/octopus-photo-interrupter-sensor-p-640.html

structure7 commented 8 years ago

Maybe tweak resistors and see if my readings are any "cleaner:"

2016-06-02_10-10-14

To use this sensor simply connect the LED Anode to 5VDC and the Cathode to ground through a ~180 Ohm resistor. On the receiver side connect the Collector to 5VDC and the Emitter to a ~1K Ohm resistor (going to ground) as well as your Arduino or other microcontroller digital input.

structure7 commented 8 years ago

Or: kio3d

structure7 commented 8 years ago

Bah... temp sensing only. However, maybe a local alarm/buzzer for high temp isn't a bad idea.