{"id":19624649,"url":"https://github.com/nature40/sensorboxes-bat-cave","last_synced_at":"2025-02-26T19:41:08.770Z","repository":{"id":97594542,"uuid":"166473105","full_name":"Nature40/Sensorboxes-Bat-Cave","owner":"Nature40","description":"A low-power sensor unit, designed to monitor the temperature inside of tree holes over a long period of time","archived":false,"fork":false,"pushed_at":"2019-01-28T14:36:22.000Z","size":11919,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-09T11:59:37.013Z","etag":null,"topics":["deepsleep","ds18b20","lora","low-power","nature40","pcf8523","sx1278","ttgo"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nature40.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-18T21:11:36.000Z","updated_at":"2019-12-08T21:25:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"e730468f-c195-429b-ba6a-ee94482f1588","html_url":"https://github.com/Nature40/Sensorboxes-Bat-Cave","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nature40%2FSensorboxes-Bat-Cave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nature40%2FSensorboxes-Bat-Cave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nature40%2FSensorboxes-Bat-Cave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nature40%2FSensorboxes-Bat-Cave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nature40","download_url":"https://codeload.github.com/Nature40/Sensorboxes-Bat-Cave/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240925829,"owners_count":19879733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deepsleep","ds18b20","lora","low-power","nature40","pcf8523","sx1278","ttgo"],"created_at":"2024-11-11T11:38:35.170Z","updated_at":"2025-02-26T19:41:08.763Z","avatar_url":"https://github.com/Nature40.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BatCave\n[![Build Status](https://travis-ci.org/Nature40/Satellite-BatCave.svg?branch=master)](https://travis-ci.org/Nature40/Satellite-BatCave)\n\nBatCave is a sattelite (low-power sensor) of the Nature 4.0 project. It is designed to monitor the temperature inside of tree holes in low frequencies (\u003e 1min) over a long period of time without changing the Battery.\n\n## Components\n\nThe chosen components are listed here, each with it's important features named.\n\n- ESP32 Board\n- SD Card Breakout Board (Adafruit)\n- PCF8523 Real-Time-Clock (exact measurements without further infrastructure)\n- DS18B20 Temperature Sensors\n  - no deviations with long cables (digital protocol)\n  - OneWire protocol (simply scaleable)\n \n![TTGO LoRa Pinout](TTGO-LoRa.jpg)\n\n### Connections\n\n```\n#define ONE_WIRE_BUS 15\n\n#define SD_CS 23\n#define SD_SCK 17\n#define SD_MOSI 12\n#define SD_MISO 13\n\n#define SDA 21\n#define SCL 22\n```\n\nThe TTGO LoRa provides 3x GND, 2x 5V and 2x 3.3V. Most SD card breakouts, the RTC and the temperature sensors can run on 5V and can therefore be chosen freely. However I'd recommend to use 5V for the temperature sensors, especially when using longer (\u003e 1m) cables. \n\n## Operation\n\nThe normal operation consists of:\n\n- **initialize** all the hardware\n- list and **read** all connected **temperature** sensors\n- log the readings to one **CSV** file per sensor\n- send the readings via **WiFi** to the next BaumBox\n- fall into **deep sleep**\n\nIf one step fails, this error needs to be logged, and the rest of the operation shall continue, for example:\n\n- If the SD is not available, the values shall still be send.\n- If the RTC is n/a, the values shall still be logged and send, since a less accurate timestamp can still be assigned at the receiver.\n\n## Implementation Details\n\nThe TTGO LoRa is kind of picky when using together with an SD breakout, the actual solution is to use multiple SPI busses, the rerouted Hardware-SPI for the SD and a Software-SPI for the SX1278. Details are explained here: [http://github.com/jonashoechst/ttgo-lora-sd](http://github.com/jonashoechst/ttgo-lora-sd).\n\n## Known bugs\n\nThe deep sleep function of the ESP boards is very low power, which can lead to a shutdown of powerbanks (a function useful, when a charging smartphones is filled).\n\n### TTGO LoRa Power Consumption\n\nThe TTGO LoRa v1 has trouble with power consumption. As discussed in [this forum](https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-1/10247), the CP2102 usb-serial chip is in an active state when turned on and only going to suspend after beeing disconnected from a USB host. Possible fixes are suggested [here](https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/issues/6#issuecomment-403254130).\n\nThe board will draw ~3 mAh with disabled CP2102 in contrast to ~10 mAh with a suspended CP2102.\n\n```\n     ms, shunt_mV,    bus_V, current_mA,  power_mW,     state\n  80305,   -0.290, 3.336000,  -3.100000, 10.000000, suspended\n 121786,   -1.020, 3.328000, -10.200000, 36.000000,    active\n```\n\nAlso, the SX1276 LoRa modem has a low power mode which ineffective when the TTGO is in deep sleep (resulting from a high pin in deep sleep). \n\nPossible alternatives:\n\n - Heltec Wireless Stick (~25€)\n - TTGO T-Fox (~25€)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnature40%2Fsensorboxes-bat-cave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnature40%2Fsensorboxes-bat-cave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnature40%2Fsensorboxes-bat-cave/lists"}