0

Using the Adafruit Color sensor (TCS36725) with Microbit
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Using the Adafruit Color sensor (TCS36725) with Microbit

by oanor on Wed Jan 16, 2019 9:05 am

Hello, world!
My first post here in this forum, and I'm quite new to the wholde coding scene.

I want to use the Adafruis TCS34725 to get rgb input data for use with micro-bit, but I'm stuck.

I've found this blogpost: https://blog.adafruit.com/2018/01/29/mi ... bitmonday/
but I can't seem to find an extension in microbit that let's me use the TCS34725.

I have found an extension for the Enviro:bit (which carries on it a TCS3472 sensor).
https://shop.pimoroni.com/products/enviro-bit

This extension lets you "Get red", Get green" and "Get blue" in the MakeBlock Microbit editor.


In short, my questions are as follows:
- Can I use the EnviroBit extension (will try this later this week)?
- Is it hard/possible to make a similar extension for the Adafruit TCS34725?
- Has someone in here made a Makeblock code/block for this they can publish and share with me?


Thank you in advance!

oanor
 
Posts: 2
Joined: Wed Jan 16, 2019 8:41 am

Re: Using the Adafruit Color sensor (TCS36725) with Microbit

by dastels on Wed Jan 16, 2019 10:08 am

I've not tried it, but the TCS34725 is an I2C device with a specific address, it should just work. Looking at the MakeCode extension code backs that up. The LED is set to be always on, but you can connect the LED pin on the breakout to the P8 digital pin to have the extension control it. You should be able to connect 5v, and, SDA, and SCL between the Micro:bit and the breakout.

Again, I've not tried this, but based my experience with I2C and what I see in the extension code, I'm quite confident that it will just work. The only problem might be not finding the other enviro:bit sensors, although I don't see anything in the code there may be something in the I2C support code that will cause a problem.

So give it a try. Pay attention to the wiring. Worst case: it won't work.

dastels
 
Posts: 180
Joined: Tue Oct 20, 2015 3:22 pm

Re: Using the Adafruit Color sensor (TCS36725) with Microbit

by oanor on Wed Jan 16, 2019 10:34 am

I got a reading using the Enviro:bit extension, making three variables and showing the readings when pushing the buttons on the Micro:bit (see picture).

The readings are a bit off (too low in general), which means that the calibration might be off.

Any tips?
Attachments
ColorSensor.JPG
ColorSensor.JPG (107.79 KiB) Viewed 1281 times

oanor
 
Posts: 2
Joined: Wed Jan 16, 2019 8:41 am

Re: Using the Adafruit Color sensor (TCS36725) with Microbit

by dastels on Wed Jan 16, 2019 11:42 am

The LED is on? The object it is reading is close enough?

dastels
 
Posts: 180
Joined: Tue Oct 20, 2015 3:22 pm

Re: Using the Adafruit Color sensor (TCS36725) with Microbit

by PeterOFre on Wed Jun 26, 2019 11:37 am

Great that I have found this posting and Thank you very much. Now the Adafruit board is working with Micro:Bit.
Here my mapping of RGB values to get the word Red, Green, Blue and Yellow based on the colors of Lego bricks.
It is a my first quick mapping and can be improved for sure.
ColorSensor3.png
ColorSensor3.png (211.98 KiB) Viewed 746 times

PeterOFre
 
Posts: 1
Joined: Wed Jun 26, 2019 11:22 am

Please be positive and constructive with your questions and comments.