{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10983","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10983/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10983/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10983/events","html_url":"https://github.com/RIOT-OS/RIOT/pull/10983","id":408602268,"node_id":"MDExOlB1bGxSZXF1ZXN0MjUxNzc5MzA1","number":10983,"title":"drivers/ph_oem: support for Atlas Scientific pH OEM sensor","user":{"login":"skullbox305","id":16827095,"node_id":"MDQ6VXNlcjE2ODI3MDk1","avatar_url":"https://avatars3.githubusercontent.com/u/16827095?v=4","gravatar_id":"","url":"https://api.github.com/users/skullbox305","html_url":"https://github.com/skullbox305","followers_url":"https://api.github.com/users/skullbox305/followers","following_url":"https://api.github.com/users/skullbox305/following{/other_user}","gists_url":"https://api.github.com/users/skullbox305/gists{/gist_id}","starred_url":"https://api.github.com/users/skullbox305/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skullbox305/subscriptions","organizations_url":"https://api.github.com/users/skullbox305/orgs","repos_url":"https://api.github.com/users/skullbox305/repos","events_url":"https://api.github.com/users/skullbox305/events{/privacy}","received_events_url":"https://api.github.com/users/skullbox305/received_events","type":"User","site_admin":false},"labels":[{"id":135467271,"node_id":"MDU6TGFiZWwxMzU0NjcyNzE=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Area:%20drivers","name":"Area: drivers","color":"6600ff","default":false},{"id":214816571,"node_id":"MDU6TGFiZWwyMTQ4MTY1NzE=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/CI:%20ready%20for%20build","name":"CI: ready for build","color":"66ffcc","default":false},{"id":1075449391,"node_id":"MDU6TGFiZWwxMDc1NDQ5Mzkx","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Reviewed:%201-fundamentals","name":"Reviewed: 1-fundamentals","color":"00dd00","default":false},{"id":1075450172,"node_id":"MDU6TGFiZWwxMDc1NDUwMTcy","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Reviewed:%202-code-design","name":"Reviewed: 2-code-design","color":"00dd00","default":false},{"id":1075452068,"node_id":"MDU6TGFiZWwxMDc1NDUyMDY4","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Reviewed:%204-code-style","name":"Reviewed: 4-code-style","color":"00dd00","default":false},{"id":1075452917,"node_id":"MDU6TGFiZWwxMDc1NDUyOTE3","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Reviewed:%205-documentation","name":"Reviewed: 5-documentation","color":"00dd00","default":false},{"id":97458574,"node_id":"MDU6TGFiZWw5NzQ1ODU3NA==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Type:%20new%20feature","name":"Type: new feature","color":"ffff66","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2019-02-11T00:23:20Z","updated_at":"2019-09-13T15:14:51Z","closed_at":"2019-09-09T08:18:49Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/10983","html_url":"https://github.com/RIOT-OS/RIOT/pull/10983","diff_url":"https://github.com/RIOT-OS/RIOT/pull/10983.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/10983.patch"},"body":"This request adds support for the [Atlas Scientific pH OEM circuit](https://www.atlas-scientific.com/product_pages/oem/oem_ph.html). The sensor can accurately measure the pH level in a range of 0.001 - 14.000 with any commercially available pH electrode (with or without BNC, depending on the custom PCB). It doesn't integrate a temperature sensor, so an external sensor needs to provide the temperature in celcius. The device supports speeds of 10-100 kHz so the board I2C speed needs to be set I2C_SPEED_NORMAL\r\n\r\n**Driver features:**\r\n- Turning internal LED off/on for lower power consumption\r\n- Changing the I2C device address in the sensor as well as in the device descriptor at runtime\r\n- 1/2/3 point calibration of the electrode (including clearing and checking current calibration state)\r\n- Set the temperature compensation of the sensor for error compensation \r\n- Read the compensation to verify at which temperature a reading was taken\r\n- Device enable/disable functionality which turns the device on/off by setting a defined GPIO pin high/low. This is a custom PCB feature and not part of the sensor itself. The PCB needs some form of power switch for this feature. PH value is highly inaccurate after powering the device on, so unfortunately one needs to wait arround 2 minutes for it to stabilize. The enable pin is undefined by default.\r\n- Interrupt capability via a dedicated pin which fires when a reading was taken (can be set to rising, falling or both). Pin is undefined by default. The alternative approach when the interrupt pin is undefined is to poll the sensor every 20ms till a reading was taken (around 420ms)\r\n- Support for SAUL with reading the pH value and writing the temperature compensation.\r\n\r\n**TODO:**\r\n- Make the reading of the pH via SAUL possible when enable and/or interrupt pin are/is defined\r\n\r\n\r\nLog output with enable and interrupt pin defined (without calibration process, because that resets the previous calibrations):\r\n\r\n```\r\n2019-02-11 00:47:24,167 - INFO # main(): This is RIOT! (Version: 2019.04-devel-161-gd1412-driver_ph_oem)\r\n2019-02-11 00:47:24,168 - INFO # Atlas Scientific pH OEM sensor driver test application\r\n2019-02-11 00:47:24,168 - INFO # \r\n2019-02-11 00:47:24,169 - INFO # Initializing pH OEM sensor at I2C_0, address 0x65...[OK]\r\n2019-02-11 00:47:24,170 - INFO # Turning LED off... [OK]\r\n2019-02-11 00:47:25,723 - INFO # Turning LED on... [OK]\r\n2019-02-11 00:47:25,727 - INFO # Setting device address to 0x66... [OK]\r\n2019-02-11 00:47:25,742 - INFO # Setting device address back to the default address 0x65... [OK]\r\n2019-02-11 00:47:25,743 - INFO # Setting interrupt pin to option 8...[OK]\r\n2019-02-11 00:47:25,744 - INFO # Enabling interrupt pin... [OK]\r\n2019-02-11 00:47:25,744 - INFO # Enabling device... [OK]\r\n2019-02-11 00:47:27,196 - INFO # \r\n2019-02-11 00:47:27,197 - INFO # [IRQ - Reading done]\r\n2019-02-11 00:47:27,202 - INFO # pH value raw: 6972\r\n2019-02-11 00:47:27,202 - INFO # pH reading was taken at 2200 Celsius\r\n2019-02-11 00:47:33,200 - INFO # \r\n2019-02-11 00:47:33,200 - INFO # [IRQ - Reading done]\r\n2019-02-11 00:47:33,206 - INFO # pH value raw: 7148\r\n2019-02-11 00:47:33,206 - INFO # pH reading was taken at 2200 Celsius\r\n2019-02-11 00:47:39,203 - INFO # \r\n2019-02-11 00:47:39,204 - INFO # [IRQ - Reading done]\r\n2019-02-11 00:47:39,208 - INFO # pH value raw: 7213\r\n2019-02-11 00:47:39,209 - INFO # pH reading was taken at 2200 Celsius\r\n```\r\n\r\nLog output with SAUL example:\r\n\r\n```\r\n2019-02-11 00:57:51,382 - INFO # main(): This is RIOT! (Version: 2019.04-devel-161-gd1412-driver_ph_oem)\r\n2019-02-11 00:57:51,383 - INFO # Welcome to RIOT!\r\n2019-02-11 00:57:51,383 - INFO # \r\n2019-02-11 00:57:51,385 - INFO # Type `help` for help, type `saul` to see all SAUL devices\r\n2019-02-11 00:57:51,385 - INFO # \r\n> saul\r\n2019-02-11 00:57:56,076 - INFO #  saul\r\n2019-02-11 00:57:56,077 - INFO # ID\tClass\t\tName\r\n2019-02-11 00:57:56,077 - INFO # #0\tSENSE_ANALOG\tADC1\r\n2019-02-11 00:57:56,078 - INFO # #1\tSENSE_ANALOG\tADC2\r\n2019-02-11 00:57:56,078 - INFO # #2\tSENSE_ANALOG\tADC3\r\n2019-02-11 00:57:56,079 - INFO # #3\tACT_SWITCH\tLED(red)\r\n2019-02-11 00:57:56,079 - INFO # #4\tACT_SWITCH\tLED(green)\r\n2019-02-11 00:57:56,080 - INFO # #5\tACT_SWITCH\tLED(blue)\r\n2019-02-11 00:57:56,080 - INFO # #6\tSENSE_BTN\tButton(User)\r\n2019-02-11 00:57:56,081 - INFO # #7\tSENSE_PH\tpH OEM sensor\r\n> saul read 7\r\n2019-02-11 00:58:02,534 - INFO #  saul read 7\r\n2019-02-11 00:58:03,038 - INFO # Reading from #7 (pH OEM sensor|SENSE_PH)\r\n2019-02-11 00:58:03,038 - INFO # Data:\t       7082 mpH\r\n> saul write 7 2155\r\n2019-02-11 00:58:19,133 - INFO #  saul write 7 2155\r\n2019-02-11 00:58:19,133 - INFO # Writing to device #7 - pH OEM sensor\r\n2019-02-11 00:58:19,134 - INFO # Data:\t       2155\r\n2019-02-11 00:58:19,135 - INFO # data successfully written to device #7\r\n> \r\n```"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/531278092","html_url":"https://github.com/RIOT-OS/RIOT/pull/10983#issuecomment-531278092","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10983","id":531278092,"node_id":"MDEyOklzc3VlQ29tbWVudDUzMTI3ODA5Mg==","user":{"login":"skullbox305","id":16827095,"node_id":"MDQ6VXNlcjE2ODI3MDk1","avatar_url":"https://avatars3.githubusercontent.com/u/16827095?v=4","gravatar_id":"","url":"https://api.github.com/users/skullbox305","html_url":"https://github.com/skullbox305","followers_url":"https://api.github.com/users/skullbox305/followers","following_url":"https://api.github.com/users/skullbox305/following{/other_user}","gists_url":"https://api.github.com/users/skullbox305/gists{/gist_id}","starred_url":"https://api.github.com/users/skullbox305/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skullbox305/subscriptions","organizations_url":"https://api.github.com/users/skullbox305/orgs","repos_url":"https://api.github.com/users/skullbox305/repos","events_url":"https://api.github.com/users/skullbox305/events{/privacy}","received_events_url":"https://api.github.com/users/skullbox305/received_events","type":"User","site_admin":false},"created_at":"2019-09-13T15:14:51Z","updated_at":"2019-09-13T15:14:51Z","author_association":"CONTRIBUTOR","body":"@benpicco I think that is the best option. I will try that, when I find the time and create another pull request. Thank you! :)"}}
{"actor":{"display_login":"skullbox305"}}