First version of sleep monitor
[mirrors/Programs.git] / bash / sleepmonitor / sleepmon.sh
CommitLineData
d6643840
TM
1#!/bin/sh
2# Simple sleep monitor (Harvie 2012)
3#
4# You probably have soundcard with one output and input
5# Take PIR motion sensor from security system
6# Use PIR to switch connection between left channels of output and input (tips of 3.5mm jacks)
7# Connect grounds of these two together (maybe you will not need it - depending on your soundcard)
8# Power up PIR
9# Launch this script
10# Use alsamixer and some GUI recorder (like audacity) to tune volume to some usable level
11# Place PIR facing to your bed and go sleep
12# Wake up
13# Enjoy your data
14
15out=/tmp/sleepmon-"$(date +%F_%r)".wav
16speaker-test -t sine &>/dev/null &
17time arecord -r 4000 "$out"
18kill $!
19echo "Your file: $out"
This page took 0.116083 seconds and 4 git commands to generate.