{"id":18325583,"url":"https://github.com/kulia/voltage-current-logger","last_synced_at":"2025-04-09T15:45:43.544Z","repository":{"id":84266500,"uuid":"43119488","full_name":"kulia/voltage-current-logger","owner":"kulia","description":"Realtime logger of voltage and current made for CST in Bhutan","archived":false,"fork":false,"pushed_at":"2015-11-17T06:22:12.000Z","size":326,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-15T09:37:03.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kulia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-25T08:14:03.000Z","updated_at":"2018-06-20T08:26:56.000Z","dependencies_parsed_at":"2023-03-09T14:30:12.853Z","dependency_job_id":null,"html_url":"https://github.com/kulia/voltage-current-logger","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/kulia%2Fvoltage-current-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulia%2Fvoltage-current-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulia%2Fvoltage-current-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulia%2Fvoltage-current-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kulia","download_url":"https://codeload.github.com/kulia/voltage-current-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248062104,"owners_count":21041487,"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-11-05T18:44:16.813Z","updated_at":"2025-04-09T15:45:43.527Z","avatar_url":"https://github.com/kulia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"It is possible to use the chrome plugin [markdown Preview](https://chrome.google.com/webstore/detail/markdown-preview/jmchmkecamhbiokiopfpnfgbidieafmd?hl=en) to read .md files offline.\n\nThe text here is mostly based on the paper ``Understanding the requirements for acquisition of\nreal-time data under distorted conditions in a Microgrid''.\n\n# Voltage and Current Logger\n\nAn description of a simple voltage and current logger that is deployed at CST - Royal University of Bhutan.\n\n# Hardware\n\nThis chapter will describe the hardware necessary for the realtime voltage and current logger to work properly.\n\n## Current measurements\n\nTo measure the current we used a current transformer as described in the figure below (thanks to Isabelle Florent for the figure). By using a magnetic core with with a coil, it was possible to measure the output voltage. \n\n![](doc/fig/current/main.png)\n\nTo make the output voltage from the current transformer match the input voltage range of the ADC better, it is possible to use an amplifier. A simple [inverting amplifier](https://en.wikipedia.org/wiki/Operational_amplifier_applications#Inverting_amplifier) was used. Remeber that the amplifier inverts the signal, so that the signal needs to be multiplied by -1. The figure below describe the setup of the amplifier.\n\n![](doc/fig/amplifier/main.png)\n\nIf you measure AC current it is important to change the scope of the input voltage, as described in the section \"Change Input Scope\" below.\n\n## Measure voltage\n\nWe used a transformer to lineary decrease the AC voltage on the grid to a value applicable for measurments. After the transformer, the voltage ranged between -6 and 6 volts. After the transformer we used a voltage devidor to decrease the maximum voltage down to 5 V. The circuit is described in the figure below.\n\n![](doc/fig/transformer/main.png)\n\nThe circuit in the next chapter was used to change the scope from [-5 V, 5 V] to [0, 5 V].\n\n## Change Input Scope\n\nThe Arduino's [ADC](https://en.wikipedia.org/wiki/Analog-to-digital_converter) can only read positive values, from 0 to 5 V. As the AC voltage and current has both positive and negative values it is necasarry to change the refrence. The circuit below can be used.\n\n![](doc/fig/referance-changer/main.png)\n\nTo find the new output voltage we can use the node voltage method. With an input voltage between -5 V to 5 V the corresponding output voltage would be 0 to 4.5 V.\n\n# Software\n\n## Dependencies\n\n__Python 2.7__\n\nDownload [python 2.7](https://www.python.org/downloads/).\n\n__Pip__\n[Install pip](https://pip.pypa.io/en/latest/installing/).\n\n__Pyserial__\n\nTo automate the communication between the arduino and the computer you need to install pyserial. Most system can install it by writing the following command in either the terminal or the command prompt:\n\n\t\u003e pip install pyserial\n\nAnother alternativ can be found [here](https://learn.adafruit.com/arduino-lesson-17-email-sending-movement-detector/installing-python-and-pyserial).\n\n__Arduino IDE__\n\nInstall [Arduino IDE](https://www.arduino.cc/en/Main/Software).\n\n## logger\n\nThe logger.py program takes the port as an input and starts to log.\n\n__Windows__\n\nGo to the _Device Manager_ to find the right port. If the port is, as an example, 6, you can start the program by typing the following command to the command prompt\n\n\t\u003e python logger.py COM6\n\n__Linux__\n\nFind the port connected to the arduino. Then type\n\n\t$ python logger.py /dev/ttyACM__N__\n\n__Where is the data stored__\n\nThe data is stored in _raw-data/_ as a .txt document. The number indicates microsenconds after Epoch, as a time refrence.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkulia%2Fvoltage-current-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkulia%2Fvoltage-current-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkulia%2Fvoltage-current-logger/lists"}