{"id":19026423,"url":"https://github.com/conorpp/smart-shirt","last_synced_at":"2026-06-19T04:32:04.656Z","repository":{"id":74186152,"uuid":"81748914","full_name":"conorpp/smart-shirt","owner":"conorpp","description":"Smart shirt project","archived":false,"fork":false,"pushed_at":"2017-04-30T19:53:41.000Z","size":5907,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-21T19:21:52.382Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/conorpp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-12T18:56:33.000Z","updated_at":"2022-05-20T07:50:54.000Z","dependencies_parsed_at":"2023-04-26T03:02:52.519Z","dependency_job_id":null,"html_url":"https://github.com/conorpp/smart-shirt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/conorpp/smart-shirt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conorpp%2Fsmart-shirt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conorpp%2Fsmart-shirt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conorpp%2Fsmart-shirt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conorpp%2Fsmart-shirt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conorpp","download_url":"https://codeload.github.com/conorpp/smart-shirt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conorpp%2Fsmart-shirt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34517748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"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":[],"created_at":"2024-11-08T20:49:06.056Z","updated_at":"2026-06-19T04:32:04.635Z","avatar_url":"https://github.com/conorpp.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Smart Shirt\n\nThis is the development for class project on making a smart shirt.\n\nMCU:\n* Nordic Semiconductor NRF52, dev board PCA10040\n\nPotential IMUs:\n* Bosch BN055\n* InvenSens MPU-9250\n\n## Getting started with Nordic NRF52\n\nFirst install the tools.  These are pretty basic and are supported on most systems.\n\n* [GNU ARM Embedded Toolchain](https://launchpad.net/gcc-arm-embedded/+download)\n* [nRFx Toolset](http://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF52832) (nrfjprog)\n* [JLink tool](https://www.segger.com/downloads/jlink)\n\nNormally you would download the Nordic SDK too but this is include in git repo.\n\nIf you're on Linux or OS X, Change `GNU_INSTALL_ROOT` in `src/Makefile` to match the place you downloaded \n[GNU ARM Embedded Toolchain](https://launchpad.net/gcc-arm-embedded/+download) to.\n\n```make\n# Change these if needed\nGNU_INSTALL_ROOT := /home/pp/gcc-arm-none-eabi-5_4-2016q3\n```\n\nPlug in the NRF52 PCA10040 board and run:\n\n```bash\ncd src/\nmake\nmake flash_softdevice  # only need to do this once per NRF52\nmake flash\n```\nNow it's running the code.\n\n### See the output\n\nThe USB has a UART bridge.  Use a terminal emulator or other serial reader to see output.\n\nE.g.:\n\n```bash\n$ picocom -b115200 /dev/ttyACMO\n\naccel:\n    x:5540 y:2684 z:-15708\ngyro:\n    x:193 y:19 z:-73\nmagno:\n    x:-192 y:-124 z:-238\ntemperature:\n    t:144\n…\n```\n\n### Adding more code\n\nStart with `src/main.c` and edit `src/Makefile` somewhere to support more files.  For driver code, just look at `nrf_sdk/examples` and copy code from there.  Most things are separated into `pca*` folders because of different dev board revisions.  Use `pca10040`.\n\n# Installing Bluetooth Windows Dependencies\n\n### Prereqs\n\n* Install Nodejs\n* Install Visual Studio Community *2015*\n* Need a USB Bluetooth dongle to bypass windows b.s.\n\n### Steps\n\n* Follow directions [here](https://github.com/sandeepmistry/node-bluetooth-hci-socket#windows)\n\nThen run \n```bash\ncd scripts\nnpm i    # only do this once\nnode bluetooth.js\n```\n\nIt will connect to the sensor MCU.  Restart sensor MCU if it hangs.  \n\n### Interfacing with the data\n\nThe bluetooth.js will host a http server you can poll on port 3000.  Data is returned in json and flushed.\n\n```bash\n$ curl http://localhost:3000\n```\n\n#### Output units\n\nDefault unit scale:\n* Accelerometer: +/- 2g\n* Gyroscope:     +/- 250 deg/sec \n* Magnetometer:  0.6 uT/bit\n* Time:          miliseconds\n* Temperature: -40 to 80 degrees C, +/-4%.\n\nThe Accelerometer and Gyroscope units are the maximum ranges for the ADC output.  Since each one is signed 16 bit data,\nyou would calculate the real value as `2*\u003csigned-value\u003e/2^15 [g]`.  If you find that the ranges saturate easily, then let me know\nand I can easily update it to be like `+/- 4g` or `+/-16g`, etc.  Temperature is also a range.\n\nThe magnetometer is calculated simply as` \u003csigned-value\u003e * 0.6 [uT]`.\n\n### Notes\n\nThe `npm` installation of `bluetooth-hci-socket` didn't work for me at first.  See [this fix](http://stackoverflow.com/questions/38149603/npm-install-fails-with-error-c2373-with-vs2015-update-3/38149604#38149604) if it doesn't work.  Try the accepted answer and try just running `npm install npm -g` all in administer cmd lines.\n\n# Usage\n\n## Calibration\n\nYou need to calibrate the magnetometer for it to work properly.  Simply run the program and follow directions.\n```bash\npython visual.py   # or sensor.py\n```\n\nAll calibration is done python side for convenience.  Firmware/bluetooth just dumps the raw values.  See output units section.\n\nYou will have to move the board from left to right 180 degrees and then the same moving it up and down.\nThe program will save the configuration to a file called `calibration.json` so you don't need to do this\neach time you run the program.  Simply delete `calibration.json` to recalibrate next time  you run the program.\n\n## Visualization\n\nWe are doing the graphics manually with OpenGL.  The orange cubes represent joints and the blue cubes\nrepresent places inbetween the joints that the sensors are located.\n\n![](http://i.imgur.com/bubSQV7.png)\n\nRight now only one sensor is being used and that's on the upper arm location (between shoulder joint and elbow joint).\nNext we should add a sensor to the wrist (between elbow joint and hand joint).  This can be done by reading the main\nloop in visual.py and seeing lines 188,199.  Right now `arm.set_uparm` and `arm.set_wrist` sets the normalized XYZ point\non the imaginary unit sphere around the sholder and elbow joints, respectively.  `arm.set_wrist` needs real data input\nand not fake data.  Next, more joints and sensors should be added.\n\n### Sensor IDs\n\nThe sensor IDs are 22, 23, 24, 25.  They correspond to the \"chip select\" GPIO they are each plugged into.\nSee wiring section.\n\n\n# Wiring\n\nSee picture of bread board for reference.  SCA connects to MCU pin 30 and SCL connects to MCU pin 31.  Each AD0 pin needs to connect to a specific GPIO on the MCU as it acts like a chip select.  Connect each AD0 to MCU pins 22, 23, 24, 25.  By connecting a sensor to a pin, it is also assigning it an ID.  E.g. Sensor with AD0 connected to 23 will have ID 23.  Sensors can be removed or added if necessary.\n\n![](http://i.imgur.com/u7qW0R2.jpg)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconorpp%2Fsmart-shirt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconorpp%2Fsmart-shirt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconorpp%2Fsmart-shirt/lists"}