Can the TCS230 color sensor module be mounted on I2C?

The color senzor module will play two functions in my Robocat: a) detect food (it is going to be brownish) b) detect green leafs (to hide in the forest :-).

Now, it looks easy to mount it on Arduino and use it. But it is going to eat 4 pins. I need pins, since the Robocat has to do many other things.

I searched the net. There are indeed I2C dedicated color sensors. But they are more expensive and mostely work on 3.3 V. I want to keep all in 5V, the cat is already complicated, I do not want 2 voltages.

So I procured this TCS230 module: https://www.optimusdigital.ro/senzori-senzori-optici/1854-modul-senzor-de-culoare-tcs230-albastru.html

I also have a "multiplexor module"(TCA9548A) - brought just to be on my desk in any case. This one: https://www.optimusdigital.ro/electronica-de-putere-multiplexoare-de-alimentare/1423-modul-cu-multiplexor-i2c-adafruit-tca9548a.html?search_query=Modul+cu+Multiplexor+I2C+Adafruit+TCA9548A&results=1

And an expansion module. This one: https://www.optimusdigital.ro/interfaa/902-modul-de-expansiune-io-pcf8574.html?search_query=Modul+de+Expansiune+IO+PCF8574&results=2

So, question is: Can I mount the sensor on I2C? Perhaps using the devices above? And code it by myself (using Wire.h library only)?

There is no real info on the net on this issue, except using the color sensor as such, on Arduino pins, which is very straightforward and the example code is clear.

It always helps to link to the data sheet instead of a sales ad.

From the data sheet it appears there are two digital inputs (which in principle could be routed via a port expander) and two outputs of which you have to read a frequency. Those are going to be a lot harder to do via a port expander or I2C.

If you're running out of ports in your design, why not go for e.g. an Arduino Mega? That gives you 54 digital I/O and 16 analog input pins, while the board is barely larger than the Uno.

Thanks for the tip with datasheets!

Well, sometimes there is no datasheet (so called "generic"- but perhaps looking for the most similar item will do the job).

++++

Yes, it sounds logical to go for a larger board. But what if I will go out of pins on that one as well?

In fact I plan to down-grade from Uno to Nano.

The more minimalistic, the better. :-). I struggle to keep all on 5 V and I2C.

I also experienced awful logic and wiring when mixing pins (D and A), I2C, power sources. Using more pins is only apparently easier, it is just ending up in more and more terms to met. From my (of course - very limited) experience, UNO and more pins are ok for one or two functions, maybe three. It might be a matter of personal style, I do not know.

falexandru: The more minimalistic, the better. :-). I struggle to keep all on 5 V and I2C.

Then get an ATmega2560 microprocessor and stick it on a PCB or protoboard. You don't need to get a complete Arduino - that just makes the development part a lot easier!

ATmega2560 m

wvmarle: Then get an ATmega2560 microprocessor and stick it on a PCB or protoboard. You don't need to get a complete Arduino - that just makes the development part a lot easier!

I am a newbie. Honestly, I would LOVE working on ATMEGA2560 directly, that would be very very elegant. But I am afraid to proceed that way. :-( . Do you think I can manage to use it instead of a complete Arduino Board? I am not afraid of learning. But I just do not know how much effort is in learning ATMega instead of Arduino.

Actually I got the feeling that the Arduino is just the first step.

I haven't done the AT chips but I've gone the same way with the ESP8266 chip. Started with the NodeMCU development board (still using that for convenience when testing/developing stuff), got some ESP-12F modules with breakout boards for prototyping, designing the final circuit diagrams with those modules on board. Same for the pressure sensors, light brightness sensors, and others: developing using the breakout boards, final designs with just the (tiny, tiny) chip and components as needed.

It's not that hard - but a lot of learning involved, including reading data sheets on how to deal with the chip. You lose the on-board regulator, the on-board USB to TTL converter, and maybe some on-board safety circuits. Programming it is going to be a bit harder - so do your development on the Arduino, final step(s) on the bare board. Mistakes are much harder to correct. You can't just start hanging patch wires to the pins, they'd bend and break in the blink of an eye.

This will also be the moment that you want a real PCB for it, not an ugly protoboard with patch wires all around. So make sure you can draw a circuit diagram, and that you know the basics about that. KiCAD is great free software that helped me a lot along the way, from creating the circuit diagrams to (much later) the PCB design.

Do look for an ATmega that operates on 3.3V, makes interfacing with all those sensor chips a lot easier as most nowadays can't handle 5V. Many are designed to use 2.5-3.5V, some go as low as 1.7V lower limit even.