issues with light lux sensor and trinket pro

  • Here is a question
    The sketch for the BH1750 lux sensor wire up indicates using pin A4 for SDA and pin A5 for SCL
    The sketch has lines #define child_id_light 0
    and #define light_sensor_analog_pin 0

    Is this right? should we not be defining the pins 4 and 5?

    Maybe this is why my Trinket pro 5v does not compile.

    I did use the FTDI to upload and it seems to do just that however there is no node created upon pressing the inclusion button on plugin. ver1.4 lib 1.4
    All other sensors seen OK

    Maybe the Trinket is not compatable.
    Guess I could take other pro mini sensor apart and try it to see.
    Have swaped out the usb cable suppling the FTDI unit, and the radio and rewired the project .


  • Hero Member

    My LightLuxSensor sketch has:

    #define CHILD_ID_LIGHT 0

    The CHILD_ID_LIGHT is used for gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL); indicating that the node should request an address/use the address in EEPROM.

    The LIGHT_SENSOR_ANALOG_PIN is used in the LightSensor but not in the LightLuxSensor so can be ignored.

    First time I see a Trinket Pro 5V, but I see no reason things should not be working.
    How about the radio, is that connected fine?

  • yes it is connected ok as other sensors do report to gw
    what happens to A4 A5 they seem not to be given as a input or output
    the trinket pro has available usb power but no pin D 2 or D 7.

    But it is reacting as though the trinket does not send info to gw

    not quite sure how to debug this yet and still reading up and looking through forums

  • Hero Member

    If the Trinklet has no D7 how did you connect the NRF24L01+ transceiver CSN/CS pin?

  • my understanding is CSN is connected to pin D10

    I use pins D9 to D13 on boards

  • Hero Member

    In my schematic of an Arduino Nano D7 is connected to pin 10 and is written with the Arduino Nano in mind:


  • I think I am right, the port pins(? ) used for D9 toD13( the points where the DuPont wires are attached) are PB1 toPB5 which are the acual pins 13 to 17 on the ATmega (32 pin MLF) 328 chip on the Nano and Mini Pro which are the same chip pins on the Adafruit Trinket Pro.

    The pins not available for use on the trinket pro are chip pins PD2 (INTO) and PD7 (AIN1)

    so I think the wiring is ok .

  • Hero Member

    From the same schematics I have of the same PB1 to PB5 mapping:


    The pins not available for use on the trinket pro are chip pins PD2 (INTO) and PD7 (AIN1)

    Above you mentioned D 2 and D 7 but indeed it looks like PD2 (INTO) and PD7 (AIN1) and these are also not connected on the Arduino Nano.

    Did you have a look at the serial output of the sketch?

  • I see now what you meant on your drawing d7 goes to chip J1-10

    but doesn't CSN connect to D10 which is pin J1-13?

  • so I found a Nano and programed it for lux reading and it all is ok
    wonder what is the issue with trinket?

  • Hero Member

    Did you have a look at the serial output of the Light Lux Sensor sketch on the Trinket?

  • I have the same question too... Pin A4 & A5 is not define in the sketch, but pin A0 is. How does the node know which pins to grab the values from? Are we not using Pin A4 & A5? and What happens to pin A0?


Suggested Topics