{"id":20275084,"url":"https://github.com/luni64/teensyloadcell","last_synced_at":"2026-04-19T02:31:49.209Z","repository":{"id":97961080,"uuid":"213036422","full_name":"luni64/TeensyLoadcell","owner":"luni64","description":"Library to readout standard loadcells with the internal ADC/PGA of the Teensy 3.2","archived":false,"fork":false,"pushed_at":"2019-10-06T17:27:14.000Z","size":2307,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-06T22:34:07.185Z","etag":null,"topics":["adc","arduino","load-cell","loadcell","pga","pjrc","teensy32"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luni64.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-10-05T16:53:10.000Z","updated_at":"2021-02-13T23:23:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"0232c421-8344-4beb-9327-c6036c518703","html_url":"https://github.com/luni64/TeensyLoadcell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luni64/TeensyLoadcell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luni64%2FTeensyLoadcell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luni64%2FTeensyLoadcell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luni64%2FTeensyLoadcell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luni64%2FTeensyLoadcell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luni64","download_url":"https://codeload.github.com/luni64/TeensyLoadcell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luni64%2FTeensyLoadcell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31991963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["adc","arduino","load-cell","loadcell","pga","pjrc","teensy32"],"created_at":"2024-11-14T13:07:57.586Z","updated_at":"2026-04-19T02:31:49.204Z","avatar_url":"https://github.com/luni64.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TeensyLoadcell\nDirect load cell readout with a\n[Teensy3.2](https://www.pjrc.com/teensy/teensy31.html)\nArduino controller board.\n\n## Purpose of the Library\nThe MK20DX256 processor of the Teensy 3.2 includes an on chip differential ADC\nand a 1-64 PGA (programmable gain amplifier). This is pretty much all you need\nto directly connect a standard load cell without any other hardware and read it\nout. The image below shows the required wiring for the differential input pair\nA10/A11.\n\n![Overview](/media/overview.png?raw=true)\n\nThe drawn cable colors match the colors of most of the available, cheap load\ncells. The two capacitors C1 and C2 are not needed but help to reduce the readout noise.\n\nAnd here a small test setup:\n\n![Setup](/media/setup.png?raw=true)\n\n\nBasically TeensyLoadcell is just a shallow wrapper around Pedro Villanueva's ADC library\n([https://github.com/pedvide/ADC](https://github.com/pedvide/ADC)).\nIt sets up the ADC and PGA for differential readout and continuously\nreads out the load cell in the background using the PDB timer. For noise suppression TeensyLoadcell\napplies a simple exponential smoothing algorithm with adjustable time constant.\n\n## Usage\n\n### Minimal Example\nThe following code shows a minimal usage example. It sets up the load cell\nwith default settings, starts the readout and prints averaged values every 100ms.\n\n```c++\n#include \"ADC.h\"\n#include \"TeensyLoadcell.h\"\nusing namespace TeensyLoadcell;\n\nADC adc;\nLoadcell loadcell(adc.adc0);\n\nvoid setup(){\n   loadcell.start();\n}\n\nvoid loop(){\n   Serial.println(loadcell.getValue());\n   delay(100);\n}\n```\n### Simple Balance\n\nThis example shows how to implement a simple balance with TeensyLoadcell. It is\nnot super precise but works nicely.\n\nHere a quick video showing the balance in action: \n\n[![Watch the video](https://img.youtube.com/vi/ls3YLmw5UEo/0.jpg)](https://youtu.be/ls3YLmw5UEo)\n\n```c++\n#include \"Arduino.h\"\n#include \"TeensyLoadCell.h\"\n\nusing namespace TeensyLoadcell;\n\nADC adc;\nLoadcell loadcell(adc.adc0);\n\nvoid setup()\n{\n  while (!Serial);\n  Serial.println(\"Enter s to start/stop, t to tare\");\n\n  loadcell.setTau(0.2);  // Changes will require about 5tau = 1s to stabilize\n  loadcell.c1 = 5.4f;    // Manually calibrated scale factor, c0 will be set by zeroing later\n\n  loadcell.start();\n}\n\nbool isRunning = false;\nelapsedMillis stopwatch = 0;\n\nvoid loop()\n{\n  int c = Serial.read();\n  switch (c)\n  {\n    case 't': // zero the balance\n      loadcell.tare();\n      break;\n\n    case 's': // start / stop display\n      isRunning = !isRunning;\n      break;\n  }\n\n  if (stopwatch \u003e 250 \u0026\u0026 isRunning) // display value each 250ms\n  {\n    Serial.printf(\"%5.0f\\n\", loadcell.getValue());\n    stopwatch = 0;\n  }\n}\n```\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluni64%2Fteensyloadcell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluni64%2Fteensyloadcell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluni64%2Fteensyloadcell/lists"}