<commit_before># A Raspberry Pi :computer: power meter :zap::electric_plug: solution for your home :house_with_garden:

## Features
* Blazing fast :dizzy: C code :neckbeard::astonished: with low memory footprint :white_check_mark:
* Polls GPIO state through the sysfs interface :scream: that uses interrupts (edge detection) from the kernel :white_check_mark:
* Multi-threaded (consumer & producer) :thumbsup: makes sure that we don't miss GPIO states :white_check_mark:
* Run inside a Docker container :whale: so you don't need to manage the dependencies :raised_hands: :white_check_mark:

### How to build (cross-compile)
`mkdir -p build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/raspbian/toolchain/arm-linux-gnueabihf.cmake .. && make`

### How to start
`RASPOWMETER_GPIO_PIN=7 RASPOWMETER_GPIO_TRIGGER_MODE=falling ./raspowmeter `

### Build Docker container
`docker build -t registry.exec.sh/raspowmeter -f ./share/docker/Dockerfile .`

### Digital light pulse sensor
![alt text](https://raw.githubusercontent.com/hfreire/raspowmeter/master/share/fritzing/digital-light-pulse-sensor.png "Digital light pulse sensor in a breadboard")

Notes: A simple digital light pulse sensing circuitry made from a transistor behaving like a switch that is influenced by a photoresistor in a voltage divider.<commit_msg>Added the digital light pulse sensor schematic.<commit_after># A Raspberry Pi :computer: power meter :zap::electric_plug: solution for your home :house_with_garden:

## Features
* Blazing fast :dizzy: C code :neckbeard::astonished: with low memory footprint :white_check_mark:
* Polls GPIO state through the sysfs interface :scream: that uses interrupts (edge detection) from the kernel :white_check_mark:
* Multi-threaded (consumer & producer) :thumbsup: makes sure that we don't miss GPIO states :white_check_mark:
* Run inside a Docker container :whale: so you don't need to manage the dependencies :raised_hands: :white_check_mark:

### How to build (cross-compile)
`mkdir -p build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/raspbian/toolchain/arm-linux-gnueabihf.cmake .. && make`

### How to start
`RASPOWMETER_GPIO_PIN=7 RASPOWMETER_GPIO_TRIGGER_MODE=falling ./raspowmeter `

### Build Docker container
`docker build -t registry.exec.sh/raspowmeter -f ./share/docker/Dockerfile .`

### Digital light pulse sensor
A simple digital light pulse sensor that resembles an inverter (logic gate). The circuitry is made from a transistor behaving like a switch that is influenced by a photoresistor in a voltage divider.

![alt text](https://raw.githubusercontent.com/hfreire/raspowmeter/master/share/fritzing/digital-light-pulse-sensor.png "Digital light pulse sensor in a breadboard")

#### References
* https://en.wikipedia.org/wiki/Inverter_(logic_gate)
* https://en.wikipedia.org/wiki/Transistor#Transistor_as_a_switch
* https://en.wikipedia.org/wiki/Voltage_divider
{'fraction_non_alphanumeric': 0.09928106812735364, 'fraction_numerical': 0.0006846970215679561, 'mean_word_length': 5.5662921348314605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '36017', 'n_tokens_mistral': 945, 'n_tokens_neox': 876, 'n_words': 290}