Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for INA219 High Side DC Current Sensor Breakout #1500

Closed
msi-matthew opened this issue Sep 4, 2018 · 5 comments
Closed

Support for INA219 High Side DC Current Sensor Breakout #1500

msi-matthew opened this issue Sep 4, 2018 · 5 comments

Comments

@msi-matthew
Copy link

It would be nice to have support for a current sensor, which could be used to trigger other devices. There is an Arduino library made by Adafruit (https://github.com/adafruit/Adafruit_INA219) and a Python library by Chris Borrill (https://github.com/chrisb2/pi_ina219) as well as a few others an Github repos.

What would it take to port one of these into the Johnny Five environment?

@dtex
Copy link
Collaborator

dtex commented Sep 4, 2018

This device uses I2C so it is totally doable. The first thing to solve is whether it should be its own, new class, a plug-in, or if an existing class should be expanded to include current sensors (i.e. Relay becomes Power).

I lean toward its own new class. but would be interested to hear what others think.

@msi-matthew
Copy link
Author

msi-matthew commented Sep 4, 2018

I also found this repo, which seems capable of interfacing with Johnny Five, but perhaps not in a standardized way. (https://www.npmjs.com/package/ina219)

I'm not sure how J5 classes/plugins are defined, what features are required to make an appropriately defined plug-in?

@dtex
Copy link
Collaborator

dtex commented Sep 9, 2018

@msi-matthew I don't know enough about the raspi-io to know if Johnny-Five and the ina219 code can both have access to different GPIO pins on the Pi, but I bet @nebrius can advise on this. I seem to recall that there is a way to tell raspi-io to not use certain pins, leaving them available for other code.

Apart from sharing access to the GPIO pins on the Pi there is no reason that Johnny-Five can't work with that code. Johnny-Five plays nice with others.

@nebrius
Copy link
Contributor

nebrius commented Sep 13, 2018

I followed up in the Raspi IO issue thread, but tl;dr yes the ina219 module and raspi-io should work together without modification or the need to use the excludePins property that @dtex was referring to.

@dtex
Copy link
Collaborator

dtex commented Sep 13, 2018

Closing. This is being handled over in the raspi-io issue linked above.

@dtex dtex closed this as completed Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants