These are chat archives for nebrius/raspi-io

29th
Mar 2015
Brian Cooke
@fivdi
Mar 29 2015 09:04 UTC
@remybach as far as I can figure out, Johnny-Five supports IR proximity sensors that have an analog output, but the Raspberry Pi has no analog inputs. On the other hand, the code you're running sets an address to 0x68 indicating that you may be using an I2C proximity sensor. Can you post a link to the exact sensor that you're using?
Rémy Bach
@remybach
Mar 29 2015 09:12 UTC
I previously detailed all the parts here: http://www.raspberrypi.org/forums/viewtopic.php?p=727330#p727330
Rémy Bach
@remybach
Mar 29 2015 09:17 UTC
Johnny five specifically mentions the IR Sensor I'm using here: https://github.com/rwaldron/johnny-five/blob/master/docs/ir-proximity.md (search for 2Y0A21)... it's a pretty common component I think.
Brian Cooke
@fivdi
Mar 29 2015 10:05 UTC

Sorry, I missed those links. Yes, Johnny-Five can talk to the sensor that you're using, but only directly. Johnny-Five will need direct access to the the analog input pin wired to the sensor for everything to function correctly. In this case, the access is indirect through the ADP Pi board, and this is the issue. The ADC Pi has two I2C MCP3424 A/D converters, but currently Johnny-Five doesn't have code for talking to an IR proximity through an I2C MCP3424 A/D converter.

I guess there are number of possible solution here:

  • J5 could be extended to handle the use case.
  • The J5 Board class has a number of I2C methods that can be used to directly access I2C devices (i2cConfig, i2cWrite, i2cWriteReg, i2cRead, i2cReadOnce). These could be used to talk to the MCP3424 on the ADC Pi.
  • The raspi-i2c or the i2c-bus packages could be used to talk to the MCP3424 on the ADC Pi.
  • ...
Rémy Bach
@remybach
Mar 29 2015 17:45 UTC

I honestly couldn't say what the best course of action would be unfortunately :confused:

What do you reckon @bryan-m-hughes?