Ignition switch AND i2c brightness - opencardev/crankshaft GitHub Wiki

Having a brightness sensor as well as an ignition switch is possible by bitbanging i2c on other gpios (in this case GPIO22 and 23) with the following steps:

Materials: 2 x 1.8k resistors (1k also seems to work) soldering iron

  1. open /boot/config.txt
  2. add the following on its own line anywhere in the file dtoverlay=i2c-gpio,i2c_gpio_sda=22,i2c_gpio_scl=23 Replace the 22 and 23 with whichever pins you want to use
  3. reboot. Upon reboot you should see /dev/i2c-3
  4. Turn off and solder pull up resistors on the pins you chose to 3.3v
  5. Plug in light sensor using your newly defined sda and scl
  6. check that your i2c device shows up by running i2cdetect -y 3
  7. open /opt/crankshaft/service_lightsensor.py and change BUS=1 to BUS=3
  8. Follow normal i2c light sensor install instructions

You may have to enable the regular i2c in raspi-config to get rid of warnings during crankshaft start still