{"id":26241320,"url":"https://github.com/icmddev/nanotool","last_synced_at":"2025-04-23T04:38:12.522Z","repository":{"id":45712296,"uuid":"499022917","full_name":"iCMDdev/nanotool","owner":"iCMDdev","description":"A nano-sized weather station based on a Raspberry Pi with an API, iOS \u0026 Mac Catalyst app, and sensor-based automations.","archived":false,"fork":false,"pushed_at":"2022-09-03T10:13:00.000Z","size":30007,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T22:11:22.369Z","etag":null,"topics":["raspberry-pi","swiftui","weather","weather-station"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iCMDdev.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}},"created_at":"2022-06-02T06:45:38.000Z","updated_at":"2024-11-24T18:33:46.000Z","dependencies_parsed_at":"2023-01-17T19:47:16.611Z","dependency_job_id":null,"html_url":"https://github.com/iCMDdev/nanotool","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iCMDdev%2Fnanotool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iCMDdev%2Fnanotool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iCMDdev%2Fnanotool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iCMDdev%2Fnanotool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iCMDdev","download_url":"https://codeload.github.com/iCMDdev/nanotool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372691,"owners_count":21419720,"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":["raspberry-pi","swiftui","weather","weather-station"],"created_at":"2025-03-13T08:20:12.715Z","updated_at":"2025-04-23T04:38:12.503Z","avatar_url":"https://github.com/iCMDdev.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg align=\"left\" src=\"/repoAssets/nanotool.png\" width=\"100\" alt=\"Nanotool logo\"\u003e Nanotool\nA nano-sized weather station based on a Raspberry Pi with an API, iOS \u0026 Mac Catalyst app, and sensor-based automations.\n\nIf you'd like to read this in Romanian, check out the [romanian-description](https://github.com/iCMDgithub/nanotool/tree/romanian-description) branch. It was written for a national olympiad, InfoEducatie 2022.\n\n# \u003cimg src=\"/repoAssets/nanotoolAll.png\" alt=\"Nanotool App Banner\"\u003e\n# \u003cimg src=\"/repoAssets/nanotoolAppPosterImage.png\" alt=\"Nanotool App Banner\"\u003e\n# \u003cimg src=\"/nanotoolCircuitDiagram.png\" alt=\"Nanotool Circuit Diagram\"\u003e\n\n## Description\n\u003cimg align=\"left\" src=\"/repoAssets/nanotoolCentralUnitCloseUp.png\" width=\"300\" alt=\"Nanotool logo\"\u003e Weather is sometimes unpredictable. In addition, in many locations, there aren't weather stations nearby, so the forecast isn't actually accurate. Many of our actions depend on weather, from how we dress, to watering our flowers. What's sure is that we need to be informed about it. The Nanotool weather station solves these problems.\u003cbr/\u003e\n\nNanotool is a weather station based on a Raspberry Pi 4B. It uses many sensors to monitor the atmospheric conditions, and has an API that makes communication straightforward. By using the iPhone, iPad and Mac app, controlling the weather station is as easy and simple as possible.\u003cbr/\u003e\n\nTo understand it better in today's world, weather needs to be monitored. The station monitors weather daily (to be more precise, wind speed and direction, rainfall, temperature, air pressure and air humidity) and records the data. These data can be visualized as a chart, anytime, just by using the app.\u003cbr/\u003e\n\nSometimes, an instant response to weather's actions is necessary. However, when people are not home, they cannot do things such as turning on a garden hose, or controlling some mechanically-driven curtains. Nanotool can automatically control many external devices by using the 4 relays and the API, which makes configuring these automations easier.\u003cbr/\u003e\n\n## Tehnologies\nNanotool uses a Raspberry Pi 4B (4GB RAM) with Raspberry Pi OS Lite (Bullseye, 64-bit). After booting, it runs a Python script that saves the data recorded by the sensors daily. This script also contains the web API, used by the app to communicate with the weather station.\n\n###  Built-in API\n\u003cimg align=\"left\" src=\"/repoAssets/nanotoolAPI.png\" width=\"50\" alt=\"Nanotool logo\"\u003e Nanotool has a built-in API written using Flask (Python module).\u003cbr/\u003eIt facilitates communication with the station and creating acessories that use this API, such as the app itself. The API sends JSON responses to GET / POST requests, or CSV files when sensor data from previous days is downloaded.\u003c/br\u003e\n###### Find out more about software and API [here](/software/info.md).\n\n###  iOS \u0026 Mac Catalyst App\n\u003cimg align=\"left\" src=\"/repoAssets/nanotoolApp.png\" width=\"50\" alt=\"Nanotool logo\"\u003e Nanotool has an application made using SwiftUI, a powerful user interface framework. It uses the API to get data from the weather station, and makes it even easier to control it.\u003cbr/\u003eThe app shows live data, as well as a data from the past. Both of them can be shown using charts.\n###### Find out more about the app [here](/app/info.md).\n\n### Automated Tasks\n\u003cimg align=\"left\" src=\"/repoAssets/nanotoolAuto.png\" width=\"50\" alt=\"Nanotool Automated Tasks logo\"\u003e Automated Tasks offer an instant response to weather. When a certain condition is met for a specified amount of time, one of the 4 relays can be toggled by Nanotool. Automations can be managed within the app, or by using the API separately. Nanotool facilitates automating tasks such as watering flowers, moving curtains, turning lights on or off, or turning a heating / cooling system on or off.\n\nWith the 4 relays, 2 types of accessories can be created:\n   - \u003cb\u003eSimple acessories\u003c/b\u003e - the relays act as a switch in a simple electric circuit\n      \u003cimg src=\"/repoAssets/simpleAccessory.png\"  alt=\"Simple accessory example\"\u003e\n   - \u003cb\u003eInteligent acessories\u003c/b\u003e - the relays act as a switch connected to a microcontroller (for example, a Raspberry Pi Pico, Arduino, ESP or an ATTINY85). In general, these accessories can automate more complex actions.\n      \u003cimg src=\"/repoAssets/smartAccessory.png\" alt=\"Smart accessory example\"\u003e \n   \nRelays where chosen ofer transistors, since they offer more safety by separating the circuits.\nBesides these relay-controlled accessories, others that use the API by themselves to check the data can be created.\n\n###  Sensors\n\u003cimg align=\"left\" src=\"/repoAssets/nanotoolSensors.png\" width=\"50\" alt=\"Nanotool logo\"\u003eThe station includes many sensors that allows weather monitoring. Their data are registered daily in a CSV spreadsheet that can be accessed through the API as a JSON file, or simply downloaded.\u003cbr/\u003e\u003c/br\u003eThe used sensors are:\n   - \u003cb\u003eAnemometer\u003c/b\u003e - measures wind speed using a reed magnetic switch. At every rotation, a magnet travels above the switch, and toggles it, so that the rotation is registered by the Raspberry Pi.\n   - \u003cb\u003eWind direction sensor\u003c/b\u003e\n   - \u003cb\u003eSelf-tipping Rain Gauge\u003c/b\u003e - measures rainfall (liters / sq meter = mm) in a given time interval. This also uses a magnetic switch.\n   - \u003cb\u003eBMP280\u003c/b\u003e - measures temperature and barometric pressure\n   - \u003cb\u003eDHT11\u003c/B\u003e - measures air humidity\n   - \u003cb\u003eRaspberry Pi Camera Module v2\u003c/b\u003e - using OpenCV, the camera detects the presence of clouds, or absence of light (night)\n\nThe custom-made sensors (Anemometer, Wind Direction sensor and Rain Gauge), as well as the camera, need to be calibrated in order to give precise measurements.\n\n### Internet, Connectivity \u0026 Settings\n\u003cimg align=\"left\" src=\"/repoAssets/nanotoolConnect.png\" width=\"50\" alt=\"Nanotool Connectivity logo\"\u003e The Nanotool weather station can be controlled by connecting it to the same internet network (through WiFi / Ethernet) as the controlling devices.\u003c/br\u003e The API can be used to control the Python script's settings. Besides the API, there are other ways the OS settings can be modified:\n   - using Raspberry Pi Imager, when installing the OS\n   - controlling it directly, using a keyboard and a display (the board can be taken out of the central unit with ease)\n   - through SSH\n\n###  Product design \u0026 Sustainability - Recycled materials\nThe station is made using recycled materials, from sources such as lightbulbs, toys, food packaging, HDDs, electronic devices and electrical appliances. These could end up in a bin, but their fate was changed by Nanotool.\n\nNanotool's design is modern, simple, and modular, based on transparent elements that expose the custom-made sensors' mechanical components, and the electrical ones of the central unit. Even if itis made with recycled materials, Nanotools stands up to industrial standards, proving have increased rigidity and be resistant to environment factors, and also having an increased efficiency from a thermal point of view.\n\n### LCD Display \u0026 CharPi library\nAll important sensor values are displayed on the 80-character, Hitachi HD44780 LCD with an I²C backpack. This display has an adaptive refresh rate - the display is refreshed only when data changes. To communicate with the display, Nanotool uses the [CharPi](https://www.github.com/iCMDgithub/CharPi) library, also made by the Nanotool's creator.\n\n### I2C\nMany of the components used by  Nanotool use I2C to communicate with the microcontroller:\n   - \u003cb\u003eLCD 20x4 HD44780\u003c/b\u003e - 80-character display\n   - \u003cb\u003eBMP280\u003c/b\u003e - temperature \u0026 pressure sensor\n   - \u003cb\u003eADS1115\u003c/b\u003e - Analog-to-Digital Converter (ADC), used for the wind direction sensor\n\n## Dependencies\n### Software for Raspberry Pi\nThe software that runs on the Raspberry Pi was written in Python 3.\u003c/br\u003eThe following non-native Python modules were used for thesoftware:\n   - \u003cb\u003e[CharPi](https://www.github.com/iCMDgithub/CharPi)\u003c/b\u003e (library made by the Nanotool's creator) - used for communicating with the LCD through I2C\n   - \u003cb\u003eFlask\u003c/b\u003e - used for creating the web API server\n   - \u003cb\u003ewaitress\u003c/b\u003e - used for the web server, when the API needs to run with production settings (not development)\n   - \u003cb\u003eadafruit_dht\u003c/b\u003e - used for the DHT11 sensor\n   - \u003cb\u003eadafruit_ads1x15\u003c/b\u003e - used for the ADC (ADS1115)\n   - \u003cb\u003eadafruit_bmp280\u003c/b\u003e - used for the BMP280 sensor\n   - \u003cb\u003eboard, busio\u003c/b\u003e - dependencies for certain sensors that use the Adafruit CircuitPython libraries\n   - \u003cb\u003eOpenCV\u003c/b\u003e - used for analysing images taken by the camera\n   - \u003cb\u003epicamera2\u003c/b\u003e - used for communicating with the Raspberry Pi Camera Module v2\n   - \u003cb\u003eRPi.GPIO\u003c/b\u003e - used for controlling the GPIO pins\n   - \u003cb\u003egpiozero\u003c/b\u003e - used for reading the CPU temperature (or the OS module could be used like this: os.popen(\"vcgencmd measure_temp\").read())\n   \n### iOS \u0026 Mac Catalyst App\nThe app was entirely made using the Swift programming language.\nThe following \u003ci\u003enative\u003c/i\u003e iOS SDK frameworks were used:\n   - \u003cb\u003eSwiftUI\u003c/b\u003e - used for the user interface\n   - \u003cb\u003eWidgetKit\u003c/b\u003e - used for creating Home Screen \u0026 Today View widgets for iOS devices\n   - \u003cb\u003eIntents \u0026 IntentsUI\u003c/b\u003e - used for managing the widgets' settings from the iOS Home Screen\n\n## License\nThe assets (images) provided in this repo and Xcode project are not subject to the code open-source license. Usage of these assets in any way, without the creator's consent is prohibited, unless the law permits it.\n\nThe license can be accessed [here](/LICENSE).\n\n## Legal\niPhone, iPad, iPadOS, Mac and Mac Catalyst are trademarks of Apple Inc., registered in USA and other countries and regions.\u003cbr/\u003e IOS is a trademark or a registered trademark of Cisco, in USA and other countries.\u003cbr/\u003eRaspberry Pi is a trademark of Raspberry Pi Ltd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficmddev%2Fnanotool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficmddev%2Fnanotool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficmddev%2Fnanotool/lists"}