Light intensity sensor for Nano 33 ioT / BH1750?

I am exploring the use of Nano 33 iOT and publication on Arduino iOT cloud.
I tried to connect a BH 1750 sensor that works fine on Arduino legacy boards.
However I could not have my sketch work for 33 ioT, after the compilation, I got a message : BH1750 may not work on SAMD21 architecture..
I had to swith to a 8266 board to have the sketch work..
For continued use of Nano 33 iOT I would have two questions.

  • does someone know a sensor and library that reports light intensity (lux) on Nano 33 ioT ?
  • is there any hope that a library for BH1750 and 33ioT may be published ?

Many thanks for any comment.

csierra67

Can you provide a link to the library e.g., on GitHub?

Hi Klaus,

Attached a link to the library on Github

Best regards

csierra67

I had a quick look into the source code. There are only two source files. Did you have a look at them? The look simple enough to run on any Arduino. Most of the code is serial print.

Was that a warning or an error? Did you try to run the code anyway?

If there are any modification necessary, I suspect they are minor. The library description file says sam architecture is supported. The code for the Arduino Nano 33 IoT is samd. Try changing the architecture line in the following file on your PC.

https://github.com/claws/BH1750/blob/master/library.properties

from

architectures=avr,sam,esp8266,esp32,stm32

to

architectures=avr,sam,samd,esp8266,esp32,stm32

Just in case, do you have any tools to look at the signals e.g., oscilloscope or logic analyzer?