From d66438402d9f5240612f5fe411c12371d81d367e Mon Sep 17 00:00:00 2001 From: Tomas Mudrunka Date: Mon, 30 Jul 2012 02:24:24 +0200 Subject: [PATCH] First version of sleep monitor --- bash/sleepmonitor/sleepmon.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bash/sleepmonitor/sleepmon.sh diff --git a/bash/sleepmonitor/sleepmon.sh b/bash/sleepmonitor/sleepmon.sh new file mode 100755 index 0000000..8674e95 --- /dev/null +++ b/bash/sleepmonitor/sleepmon.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Simple sleep monitor (Harvie 2012) +# +# You probably have soundcard with one output and input +# Take PIR motion sensor from security system +# Use PIR to switch connection between left channels of output and input (tips of 3.5mm jacks) +# Connect grounds of these two together (maybe you will not need it - depending on your soundcard) +# Power up PIR +# Launch this script +# Use alsamixer and some GUI recorder (like audacity) to tune volume to some usable level +# Place PIR facing to your bed and go sleep +# Wake up +# Enjoy your data + +out=/tmp/sleepmon-"$(date +%F_%r)".wav +speaker-test -t sine &>/dev/null & +time arecord -r 4000 "$out" +kill $! +echo "Your file: $out" -- 2.30.2