{"id":13396914,"url":"https://github.com/tchapi/Arduino-Energy-Monitor","last_synced_at":"2025-03-13T23:31:57.590Z","repository":{"id":21008785,"uuid":"24299447","full_name":"tchapi/Arduino-Energy-Monitor","owner":"tchapi","description":"A simple Arduino-based current and temperature monitor","archived":false,"fork":false,"pushed_at":"2015-05-26T18:17:17.000Z","size":23128,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T10:46:33.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Arduino","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tchapi.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":"2014-09-21T18:26:27.000Z","updated_at":"2024-07-25T21:41:19.000Z","dependencies_parsed_at":"2022-07-26T15:02:09.225Z","dependency_job_id":null,"html_url":"https://github.com/tchapi/Arduino-Energy-Monitor","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/tchapi%2FArduino-Energy-Monitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchapi%2FArduino-Energy-Monitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchapi%2FArduino-Energy-Monitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchapi%2FArduino-Energy-Monitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tchapi","download_url":"https://codeload.github.com/tchapi/Arduino-Energy-Monitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243500224,"owners_count":20300759,"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":[],"created_at":"2024-07-30T18:01:07.565Z","updated_at":"2025-03-13T23:31:54.265Z","avatar_url":"https://github.com/tchapi.png","language":"Arduino","funding_links":[],"categories":["Arduino"],"sub_categories":[],"readme":"Arduino and Node.js Energy Monitor\n======================\n\nA little box that monitors the mains current and average room temperature and sends the data through WiFi to a server for storage, display and analysis.\n\nUses a **TMP36 temperature sensor** (like [this](https://www.sparkfun.com/products/10988)) and a **non-invasive current sensor** (like [this one](https://www.sparkfun.com/products/11005)), coupled with a **Wifi Shield** (this [one here](https://learn.adafruit.com/adafruit-cc3000-wifi)).\n\n![](https://raw.githubusercontent.com/tchapi/Arduino-Energy-Monitor/master/Pictures/insitu.jpg)\n\nThe box is the same size as a conventional NF EN 60898-1, and NFC 61-410 compliant circuit breaker, so it fits in your electrical panel.\n\n![](https://raw.githubusercontent.com/tchapi/Arduino-Energy-Monitor/master/Pictures/lights.jpg)\n\n## Code\n\nThe repo contains : \n\n  - the Arduino UNO code\n  - A little Node.js server to receive the data\n\n### Arduino code\n\nThe Arduino code is separated in different files, for ease of comprehension.\n\n  - `CentralCurrentAndTempLogger.ino` is just here so the Arduino IDE is happy\n  - `helpers.ino` define a general set of helper functions, like `readVcc()`\n  - `display.ino` contains all the initialization processes for the 7-segment and the led strip\n  - `wifi.ino` contains all the functions to work with WiFi\n  - `current.ino` has all we need to compute current and temperature sensors\n  - `main.ino` and `setup.ino` are self-explanatory.\n\n\u003e NB : these files are prefixed so that the compiler knows in which order to process them. This is required because in the Arduino IDE, there is no general file that imports every single file, so in order to define the compilation order, we need to rely on the filenames.\n\nThe configuration is stored in `config.h`. You need to copy `config.h.dist` to `config.h` and put your own settings (wifi, key) in there.\n\nIf you want to change the payload, you might want to look at lines `66`to `72` in `wifi.ino` :\n\n```C\n    client.print(encodedLength(str_temp) + encodedLength(str_power) + encodedLength(private_key) + 10);\n    client.fastrprint(F(\"\\r\\n\\r\\nt=\"));\n    urlEncode(client, str_temp, false, false);\n    client.fastrprint(F(\"\u0026w=\"));\n    urlEncode(client, str_power, false, false);\n    client.fastrprint(F(\"\u0026key=\"));\n    urlEncode(client, private_key, false, false);\n```\n\n\u003e NB : it is advised to compile and upload the code with the Arduino IDE 1.0.5 version that can be found [here](http://www.arduino.cc/en/Main/OldSoftwareReleases#1.0.x) because the CC3000 shield is not really a big fan of the newer IDE releases.\n\n### Server code\n\nOf course, the server can be any application that can accept and process requests such as :\n\n    POST 1.0 /data  key=123456789ABCD\u0026w=346\u0026t=23.5\n\nThe [Node.js](http://nodejs.org/) server provided is a very simple logger that stores the values in a file.\n\nTo launch the server, you first need to copy `config.json.dist` to `config.json` and put your own settings (log name, api path, key) in there.\n\nThen, as for every standard Node.js app :\n\n    node index.js\n\n### About the `key` parameter\n\nIt's a very simple authentication system to prevent unwanted request to the server. Change for something only you know. The key must obviously be the same on the Arduino and on the server.\n\n## Electronics\n\nI created a custom PCB to hold the electronics (apart from the Arduino shield). It's designed on [Fritzing](http://fritzing.org/download/) which is a very practical tool.\n\n![](https://raw.githubusercontent.com/tchapi/Arduino-Energy-Monitor/master/Pictures/fritzing.png)\n\nThe custom shield holds the connectors and some basic electronics. It is very simple to solder on your own.\n\nBOM for the custom shield :\n\n  - 1x 1000µF capacitor\n  - 1x 10µF capacitor\n  - 2x 10kΩ\n  - 2x 200Ω\n  - 1x 47Ω\n  - 1x Stereo TRS connector (jack 3.5mm)\n  - Some pin headers\n  - 1x jst connector 3pin and x jst connector 4pin\n\nTo create the PCB, I use [Fritzing Fab](http://fab.fritzing.org/pricing) as well.\n\n\nOther parts needed :\n\n  - some wires\n  - 1x Arduino UNO\n  - 1x Adafruit CC3000 WiFi Shield\n  - 1x antenna\n  - 1x TMP36 temperature sensor\n  - 1x non-invasive 30A current sensor\n  - 1x Quad Alphanumeric Display - 0.54\" Digits w/ I2C Backpack\n  - 1x NeoPixel Stick - 8 x WS2812 5050 RGB LED with Integrated Drivers\n\n## Casing\n\nThe casing consists of 3 _3D-printable_ parts :\n\n  - the box in itself\n  - the closing lid\n  - the lid inset \n\n![](https://raw.githubusercontent.com/tchapi/Arduino-Energy-Monitor/master/Pictures/3D.png)\n\nAll these parts are 3D printable on a regular **Rep Rap** or **Makerbot Replicator 2** for instance. The STL files (watertight, ready for print) are available in [the Design/Boîtier folder](https://github.com/tchapi/Arduino-Energy-Monitor/tree/master/Design/Bo%C3%AEtier%20principal/Exports%20STL).\n\n![](https://raw.githubusercontent.com/tchapi/Arduino-Energy-Monitor/master/Pictures/proto1.jpg)\n_A first prototype_\n\nThe CATIA files (.catpart and .catproduct) are available as well if you want to refactor them for your need.\n\nTo dim the displays and add a somehow nice touch to the objet, the fourth part is a little 3mm-thick plexiglass slap that can be cutted on a conventional laser cutter.\n\nYou can find the Illustrator file [here](https://github.com/tchapi/Arduino-Energy-Monitor/tree/master/Design/Bo%C3%AEtier%20principal/Plaque%20de%20protection%20plexiglas).\n\n\n## Licence\n\nEverything is released under the GNU GPL v2. Basically, you can reuse everything as long as you credit me somehow :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftchapi%2FArduino-Energy-Monitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftchapi%2FArduino-Energy-Monitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftchapi%2FArduino-Energy-Monitor/lists"}