The M5Stack Color Maker Can Mix Paint To Match Your Subject

An automatic color mixer, dispensing a mixture of red and yellow

We’ve all learned in primary school art classes that blue and yellow make green, and that adding a little black to a color will make it darker. But what if you want to paint with a color that exactly matches something else? Usually, that requires a lot of trial and error (and paint), and the end result may not look the way you wanted after all.

To help aspiring artists, [Airpocket] made the M5Stack Color Maker. This is a device that reads out a color sensor and automatically mixes watercolor paint in the right proportions to match what it sensed. It dispenses drops of cyan, magenta, yellow and black paint (CMYK) into a small bowl, from which you can then apply it with a paintbrush.

An automatic color mixer, with labels explaining each partThe color sensor is similar in use to the color picker (or “dropper”) tool present in most graphics programs: simply point it at something that has the right color, and it will generate the correct values for you. It is based on an AMS TCS34725 color sensor, which is housed in a 3D-printed shell that also includes a white LED. The sensor outputs Red, Green and Blue (RGB) values, which are converted into the corresponding CMYK values by a Raspberry Pi Pico. A touch-sensitive screen allows the user to make adjustments before activating the paint pumps.

Those pumps are tube pumps, which have been specifically designed (and also 3D printed) to allow them to move tiny amounts of liquid while minimizing the pulsing motion typical with this type of pump. They are driven by stepper motors which are controlled by the Pi Pico.

Although many artists might prefer to mix their colors manually, the M5Stack makes mixing that exact shade of blue just that little bit easier. We can also imagine it might help those who are color blind and unable to clearly tell different colors apart. We’ve seen simple paint mixers for larger quantities of paint, and even robots that can do the actual painting for you. If you need a refresher on color theory, we’ve got you covered too.

27 thoughts on “The M5Stack Color Maker Can Mix Paint To Match Your Subject

  1. I think they mean, “peristaltic pumps” don’t they? They have rollers that squeeze liquids through flexible tubes in a way similar to the action the intestines use to move food. “Peristalsis.” Cool project.

    1. That’s if you can calibrate your color reader to the paint store’s. Which is not quite trivial, since the paint store’s machine doesn’t use CYMK, but a set of measured values for the pigments they have available to them. But of course, you can still mix just enough color to paint a sample, and take THAT to the paint store.

    2. You can buy a off the shelf device to do this right now. Sat next to me is a datacolor colorreader, its a wifi device about the size of a old film cannister and cost under $100 off amazon, and you install a smartphone app which samples using this reader device, and spits out a RAL or whatever pantone system you have in use code, which the paint shop can mix.
      I take the RAL color code, and buy the paint mail order from a bulk supplier, saving time & money.
      If your use case doesn’t justify $100 on a device, a chip nuancer booklet will get you really close, and should cost considerably less (I bought a RAL book for $20 to compare reliability of the datacolor when I first got it).

      For the original project, this is great, its a diy version of the datacolor combined with a on-prem mixer. I predict that some company will make the next step and do the same commercially at a commodity price soon.
      Do that for plain (ie no candy/metallic coverage) auto paint at less than $1000 and you have my undivided attention :)

  2. It’s cool project, making watercolor paints on demand. It’s similar to the machines paint stores have.

    Unfortunately the colors are noticeably not quite right, but the paint store machines have the same problem. Accurately scanning the color and metering very small amounts of the pigments is just really difficult.

    It’s very difficult to have the color sensor match what your eyes perceive a color to be, especially going from color produced by one type of color technology to reproducing it with another (here, watercolor paint.) Compounding this, the base pigment metering can be thrown off by the drop at the end of the tube. A very small amount of base pigment may not drop off the tube or you can get excess paint in the partial drop left over from the previous metering.

    That said, this project is well done–except I’d put color sensor in some kind of case and replace the individuals wires with a multiconductor cable.

    1. I am very happy that you have accurately evaluated the good and bad points of this project.

      I will be very happy if this device will increase the number of people who are interested in the mysterious and fun world of colors.

      You are right about the sensor cable. XD

    2. I’ve used an digital color analiser called Pico. There is a quite large library of paint manufacturers and ral colors. Of course no pantone because of the out of gamut errors involved. Also glossy paint is more difficult to analize.

    3. So interestingly your success may depend on the exact tools available at the paint store. Some paint stores have the equipment to do a direct custom mix. They measure whatever sample you bring in spectrally and software calculates a custom mix.

      Other paint stores use a color picker type system. An instrument is used, sometimes colorimetric rather than spectral (lower cost), and the software tries to match the measured reading with the closest known color from a fixed library of colors. Accuracy with this method, even with a big fixed library, will typically be much worse than real custom mixing.

      Interestingly, in the United States custom mixing is more common. Paint stores in other parts of the world including Europe generally favor the color matching method. Of coarse, it depends on the individual paint store.

    1. Finally, a Hackaday article I feel like I know enough about to comment on.

      Sadly, you’re not going to be able to achieve much of the Pantone standard library with CMYK watercolors. Even if you had perfect software and professional measument instruments. Even CMYK professional printing inks might get you to about 70% of them if you were lucky. I’d be stunned if you’d get to over 15-20% with watercolors. The colors will all be out of gamut and unprintable.
      Why? Simply not enough pigment load, chromacity, or density. The cyan isn’t cyan enough… etc.

      Fun project, but it’s not going to be anything close to accurate. Ink and paint mixing systems are a non trivial problem. Their is a lot to know about illumination etc. Both CMYK and RGB are device dependent color spaces. You’d need to characterize the CMYK space you’d get from the watercolors. The sensor is only returning colorimetric data, spectral data is so much more useful for this kind of task.

      On the other hand, it’s an awesome looking build, so kudos. But the problem domain is more complicated than you might realize at first.

      1. As a homeowner who had to select some good color for custom made paint – it is all pain in the ass. Resin manufacturers use other color templates than paint manufacturers, translation between them is often not existing, when you try to match them somehow, you often get different enough color to be noticeable/ugly. And of course none of templates are possible to be represented by any of standard consumer equipment.

        1. Even knowing enough about pigments, spectrum responses and color mixing is not enough to get good effects without someone going to your house with proper color template. When I borrowed one template from paint shop, colors were perfect, really matching to rooms. But from what I’ve seen in that template, just a little off color selection (slightly change one digit in color number) could ruin your desired effect.

      2. I understand the difficulty with color matching using a limited set of pigments. My point is that if you have a clent whose logo is in specified Pantone colors and you’re producing a piece of artwork for them, let’s say with watercolors, whether by brush or airbrush, this should get you as close as the medium allows.

        1. Something like this, with a much more sophisticated implementation could get you as close as the medium allows. As is, this might get you in the ball park of what the medium allows.

          But my real point is the medium physically won’t allow a good match for most Pantone colors. As long as your expectations are set right, it seems like a great project.

  3. At a previous workplace we built a lot of one-of devices that saw a lot of hands before getting out the door. Sometimes they got scuffed or scratched, so we had a guy we would call in to patch them up.

    The guy was an absolute wizard at nailing the color. No instruments. He’d eyeball it, mix a bit on a card with a drop of this color, a dab of that texture stuff, a glob of some other. Dry with a hair dryer to check. He rarely had to do more than one iteration, and he’d get the color and texture and sheen exactly, indistinguishable from the area surrounding the patch. An artist.

    Like [Jeffrey Piestrak] says: it’s a heck of a lot more than mixing some CYMK. The guy had on tap dozens of materials to mix on his rolling cart.

    1. DON”T BELIEVE THE LIE!!!! As anyone who ever went to kindergarten knows, mixing yellow and blue paint gives you something you would never want to call ‘green’. I’m serious. I know this because when they told me mixing yellow and blue would give me green, I wanted to see the magic. The magic did not work. At all. The teacher gave me some BS reason, and kept on saying that yellow plus blue make green, even though she couldn’t make it work, either. It wasn’t until fourth grade, when I stumbled onto a decent set of transparent watercolors, that I was able to make green, and THAT was only by mixing yellow and cyan. CYAN. Which isn not blue. Why does everybody lie to children? Why do they lie about things the children can SEE are wrong? What am I missing here?

  4. Cool idea! I’m curious why it uses two micros, I’d think the M5 stack core 2 (an esp32) should have more than enough power, but I guess decoupling them maybe gets you simpler code and more consistent drive of the pumps. (I also highly doubt that some advance to the design of the peristaltic pump was made, unless the maker is also a fluid engineer in the field, since those pumps are used everywhere, including medical devices where I’d think they’d like to avoid pulsation. But that’s more just my “everything is somebody’s research field” experience combined with a general anti-patent bias, even though this is probably one of the more acceptable areas to have a patent and this would work if replicated with another pump, an example of which is even provided).

    Naturally the weakness is in color space conversions, but that’s to be expected, even in the commercial devices. I wonder if a “closed loop” system would help – essentially sensing the produced color and using a “gradient descent” type algorithm to approach a match. I would think this would allow much closer matching with less fiddling with conversion factors, up to the limits of the sensor used. You’ve also got the change in color that occurs as the paint dries, but if you wanted to really go overboard, nothing is stopping you from having a “mix-dry-measure” cycle after some initial approximation, so that it is “closed loop” on the actual dried color. This could just be a UI change (manually measure the output of a stage to improve approximation) or could be fully automated given some roll-feed media or something like that to let it repeatedly paint and let dry.

    Really neat project! Makes me wonder about doing one myself, I think my Adafruit Clue has a color sensor built in, as well as a screen and buttons…

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.