Skip to content

Commit

Permalink
add ina219 power sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
skyleilani committed Sep 7, 2023
1 parent 61bf2ab commit 2b7b77c
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 15 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/components/power-sensor/fake.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Configure a Fake Power Sensor"
title: "Configure a fake power sensor"
linkTitle: "fake"
weight: 10
type: "docs"
description: "Configure a fake power sensor to test software without the physical hardware."
tags: ["sensor", "components"]
tags: ["sensor", "power sensor"]
icon: "/icons/components/sensor.svg"
images: ["/icons/components/sensor.svg"]
# SME: #team-bucket
Expand Down
17 changes: 7 additions & 10 deletions docs/components/power-sensor/ina219.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Configure an INA219 sensor"
title: "Configure an INA219 power sensor"
linkTitle: "ina219"
weight: 70
draft: false
Expand All @@ -8,21 +8,18 @@ description: "Configure an INA219 model sensor."
tags: ["sensor", "components"]
icon: "/icons/components/sensor.svg"
images: ["/icons/components/sensor.svg"]
# SME: #team-bucket
# SME:
---

Configure a `INA219` sensor to integrate a [INA219 current sensor](https://www.amazon.com/dp/B07QJW6L4C) into your robot:
Configure an `INA219` power sensor to integrate into your robot:

{{< tabs >}}
{{< tabs name="Configure an INA219 Power Sensor" >}}
{{% tab name="Config Builder" %}}

Navigate to the **Config** tab of your robot's page in [the Viam app](https://app.viam.com).
Click on the **Components** subtab and navigate to the **Create component** menu.
Enter a name for your sensor, select the type `sensor`, and select the `INA219` model.
Click on the **Components** subtab and navigate to the **Create component** menu. Select the type `power_sensor`, then select the `ina219` model. Name your sensor, and click **Create**.

Click **Create component**.

![Creation of a INA219 sensor in the Viam app config builder.](/components/sensor/power-ina219-sensor-ui-config.png)
{{<imgproc src="/components/power-sensor/ina219-config-builder.png" resize="850x" declaredimensions=true alt="ina219 power sensor configuration tab">}}

Edit and fill in the attributes as applicable.

Expand All @@ -34,7 +31,7 @@ Edit and fill in the attributes as applicable.
"components": [
{
"name": "<your-INA219-sensor-name>",
"type": "sensor",
"type": "power_sensor",
"model": "INA219",
"attributes": {
"board": "<your-board-name>",
Expand Down
52 changes: 49 additions & 3 deletions docs/components/power-sensor/ina226.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,55 @@
---
title: "Configure an INA226 Power Sensor"
title: "Configure an INA226 power sensor"
linkTitle: "ina226"
weight: 10
type: "docs"
description: "Configure an INA226 power sensor to test software."
images: ["/icons/components/imu.svg"]
# SMEs: Rand
---
# SME:
---

Configure a `INA226` sensor to integrate a [INA226 current sensor](https://www.amazon.com/INA226-Voltage-Current-Module-Monitoring/dp/B08MKSQSL9) into your robot:

{{< tabs >}}
{{% tab name="Config Builder" %}}

Navigate to the **Config** tab of your robot's page in [the Viam app](https://app.viam.com).
Click on the **Components** subtab and navigate to the **Create component** menu.
Enter a name for your sensor, select the type `sensor`, and select the `INA219` model.

Click **Create component**.

![Creation of a INA219 sensor in the Viam app config builder.](/components/sensor/power-ina219-sensor-ui-config.png)

Edit and fill in the attributes as applicable.

{{% /tab %}}
{{% tab name="JSON Template" %}}

```json {class="line-numbers linkable-line-numbers"}
{
"components": [
{
"name": "<your-INA219-sensor-name>",
"type": "power_sensor",
"model": "INA226",
"attributes": {
"board": "<your-board-name>",
"i2c_bus": "<your-i2c-bus-name-on-board>"
},
"depends_on": []
}
]
}
```

{{% /tab %}}
{{% /tabs %}}

The following attributes are available for `INA219` sensors:

| Attribute | Type | Inclusion | Description |
| --------- | -----| --------- | ----------- |
| `board` | string | **Required** | The `name` of the [board](/components/board/) the sensor is wired to. |
| `i2c_bus` | string | **Required** | The `name` of the [I<sup>2</sup>C bus](/components/board/#i2cs) on the board that the sensor is wired to. |
| `i2c_address` | string | Optional | Default: `0x40`. The [I2C device address](https://learn.adafruit.com/i2c-addresses/overview) of the sensor. |

0 comments on commit 2b7b77c

Please sign in to comment.