element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sensors
  • Technologies
  • More
Sensors
Blog ROHM Colour Sensor BH1749NUC - part 2: Other Firmware Libraries
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 25 Nov 2018 3:06 PM Date Created
  • Views 2465 views
  • Likes 4 likes
  • Comments 6 comments
  • RoadTest
  • rohm
  • road_test
Related
Recommended

ROHM Colour Sensor BH1749NUC - part 2: Other Firmware Libraries

Jan Cumps
Jan Cumps
25 Nov 2018

I'm Road Testing the Rohm SensorShield-EVK-003 (Arduino Compatible) and the sensors that come with it.

In this post, alternative libraries for the Colour Sensor BH1749NUCBH1749NUC.

 

image

 

This is a follow up on ROHM Colour Sensor BH1749NUC. I was planning to extend the ROHM example with support for interrupt.

During my research I stumbled over two alternative libraries, one of which has dona the legwork already.

 

FaBo library

 

FaBo is an online shop that designs and sells sensor and other breakout boards (called Bricks).

They may do other things but the website is in (I think) Japanese.

The library provided has similar functionality as the ROHM one. The OO flavour is a little different but the same functionality is supported.

The example shows how to play with the gain for the IR and RGB range (the SparkFun library below does that too).

https://github.com/FaBoPlatform/FaBoColor-BH1749NUC-Library.

 

SparkFun Library

 

SparkFun made a library for their experimental and indeterminately out of stock RGB Sensor (Qwiic).

They have a concept called SparkX, where they try out new products, often with a rough edge.

 

Even though the module is experimental, their library and examples are the most advanced that I can find.

https://github.com/sparkfun/SparkFun_BH1749NUC_Arduino_Library/blob/master/examples/Example3_NewDataInterrupt/Example3_NewDataInterrupt.ino

 

I will not elaborate here, please check for yourself.

It's worth it: they have a data ready interrupt and a threshold interrupt (I talked about the latter in my previous post) example.

 

Heads-up: I haven't been able to run that threshold trigger example successfully yet. The normal polling one works right out of the box. Investigating ...

To make the example work, you have to help the interrupt pin a little.


In this explanation, I assume that you use the unchanged example from Adafruit. and that you dock the colour sensor evaluation board in i2c dock #1 as per instructions. The Adafruit code listens to D2 for Interrupt 0;

Also as per instructions, put a jumper on INTR1 on connector J3. This ties that pin to Arduino D2, so that the Arduino INT0 can be used.

But that pin - going to the volatge translator IC - needs a pull-up. To get that extra omph to help the signal pull up, you can jump INT1 on connector J16. That adds a pull-up resistor.

 

image

The Adafruit example works just fine then. When the red component of your light drops below the low threshold or jumps above the high threshold, the serial monitor show measurements. If the red component is between both thresholds, nothing happens.

 

  // Set high and low thresholds. If red value is >HIGH_THRESHOLD or <LOW_THRESHOLD, then an
  // interrupt will be triggered
  //rgb.setThresholdHigh(HIGH_THRESHOLD);
  //rgb.setThresholdLow(LOW_THRESHOLD);
  // Alternatively, setThresholds can be used to set high and low thresholds simultaneously
  rgb.setThresholds(LOW_THRESHOLD, HIGH_THRESHOLD);

 

image

 

It's easier to dock the board in i2c location #3 and put the jumper of J3 on INTR3, the jumper of J16 on INT3. That way the interrupt pin is not also connected to D0 on the Arduino (see this post to check how things are interconnected on this shield). You have a pure situation where only D2 is connected to the interrupt pin.

 

 

 

 

 

The interrup

 

Related blog
ROHM Temperature Sensor BD1020HFV
ROHM Magnetometer Sensor BM1422AGMV
ROHM Hall Sensor BD7411G
ROHM Colour Sensor BH1749NUC
ROHM Colour Sensor BH1749NUC - part 2: Other Firmware Libraries
ROHM Ambient Light and Proximity Sensor RPR-0521RS
  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 7 years ago in reply to Jan Cumps +3
    Until now no success with the SparkFun trigger. I'm checking on my scope to capture the falling edge of the interrupt pin when the red light goes below 50 or above 500. It does not happen ... I know that…
  • fmilburn
    fmilburn over 7 years ago +2
    Nice find on Sparkfun library
  • Jan Cumps
    Jan Cumps over 7 years ago in reply to fmilburn +2
    fmilburn wrote: Nice find on Sparkfun library I'm trying it out. I have the basic examples running. The ones with interrupts not yet. I'll put an oscilloscope on that interrupt pin.
  • fmilburn
    fmilburn over 7 years ago

    Nice find on Sparkfun library

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
<
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube