Pixy 2 Machine Vision Camera Review with Arduino


Dear friends welcome to another video! This is Nick from educ8s.tv and today we are going to take a first look at
the Pixy2 Machine Vision camera module. It is an impressive little camera that we
can use with any microcontroller and build impressive projects! The best part, is that you don’t have to
be a Machine Vision expert to program this board. You can teach this board new objects with
a press of a button. A last, Machine Vision made easy! There are a lot of things to cover so let’s
get started! A few weeks ago, I reviewed the OpenMV camera
module, a really capable machine vision camera module. A viewer of the channel commented that I should
also give Pixy a try, so here it is, the Pixy2 camera module, the newest version of the board. The first version of the Pixy cam was released
in 2014 after a successful Kickstarter campaign. The designers of the board, describe it as
a vision sensor. We can’t program this board. This board is preprogrammed, it runs its own
firmware and it uses advanced machine vision algorithms to report back only what is interesting. For example, I have trained the board to recognize
this 3D printed Pikachu toy. Since this is a Vision Sensor we only care
to know if there is a Pikachu in front of the camera, and where is it. The Pixy camera can do just that. It reports that an object is detected and
some additional information about it, like the size and position in the frame using either
the SPI, UART or I2C interface. I think, this is a great idea and a great
implementation. We don’t have to be a Machine Vision expert
to build some Machine Vision applications! We can teach this camera in a few seconds,
and the camera will do the hard work for us automatically! Amazing stuff! Let’s take a look at the specs of the Pixy2
camera module. The board features the following:
• An image sensor with a resolution 1296×976 • 32Bit NXP LPC4330,
• 204 MHz, dual core • 264KB RAM memory
• 2MB RAM memory • UART, SPI, I2C, USB, Digital Analog output
• Embedded Light Source • Driver for 2 Servos
• Low Power consumption If we compare this board with the OpenMV M7
camera module we can see, that the Pixy2 uses a higher resolution camera module and a faster
processor. On the other hand the OpenMV M7 offers more
RAM and Flash memory, more IO pins and of course it is user programmable. I will prepare detailed comparison video between
the OpenMV cam and the Pixy2 cam if you are interested. Please let me know in the comments section
below. The Pixy2 board costs around 65$, and you
can find a link to it in the description of the video below. The specs of the Pixy2 Cam are great but what
can we do with it? The Pixy can be used for the following things
according to its designers: • Color Tracking
• Object Tracking • Color Code Detection
• Simple Barcode Detection • Line Detection
• Intersection Detection And much more. But enough with the specs. Let’s take a look at a real life example. Let’s start using the board with a simple
example. Let’s teach the board to recognize this
green Pikachu. There are two ways to teach Pixy a new object. We can use the computer, or we can use this
button on the Pixy board itself. Let’s first teach Pixy using the computer. In order to do so, we have to download the
PixyMon software which if provided by the creators of the board. If we connect the board to the computer and
fire up the PixyMon software we see live video from the PixyCam. Pixy uses a hue-based color filtering algorithm
to detect objects. Since Pixy uses color, the object needs to
have a distinct hue. The Pixy Cam can detect up to 7 different
objects. Each object has its unique signature which
is used by Pixy to detect an object. So, let’s use Signature 1 for the Green
Pikachu. We place the object close to the camera and
from the Menu we select Action ->Set Signature 1. Then using the mouse we can select the object
we want to detect. That’s it! Pixy can now detect the green Pikachu toy. How cool is that! Now, let’s go the menu again and select
File ->Configure and then the Signature Tab. Here we can set a label for each signature. I am going to use the label Green Pikachu
for the first Signature. If we now press apply we can see that now,
on the screen we can see that now, Pixy can recognize the object as a Green Pikachu. If we place another Green Pikachu next to
the first one, you can see that Pixy can detect him as well. Let’s teach Pixy to also detect this Red
Pikachu and this yellow lighter. We follow exactly the same procedure. We again set labels for the new object signatures
and we can see that Pixy has no problem recognizing 4 objects at the same time at 60 frames per
seconds! Amazing stuff! Let’s now connect Pixy to an Arduino Uno
board in order to provide vision to it. First of all we have to download install the
Pixy library for Arduino. Then we can use the provided cable like this. It makes things so easy. I have also connected 4 LEDs to the Arduino,
two Greens, one Red and one yellow. I have loaded a very simple sketch to it,
and now the slow and low cost Arduino Uno can detect objects. Let’s try the objects we trained Pixy to
recognize. First, let’s put a Green Pikachu in front
of it. A green LED lights up, meaning that the Arduino
successfully detected a Green Pikachu in front of the vision sensor. If we place a Red Pikachu in front of the
camera the Red LED lights up and so on. Let’s see, what kind of data the pixy reports
back, and how the Arduino handles them in this example. If we open the serial monitor we can see that
the Pixy cam reports back some data. It reports a block number. A block is a recognized object. It also reports the signature number of this
block and the X and Y coordinates of the block within the visible frame. It can also report the width and height of
the block and the index, a unique number assigned to each block so we can track multiple objects
of the same signature. Lastly it reports the age of the object, a
number from 0 to 255 in order to know how long this object is visible. With all this information we build interesting
behaviors. In this simple example, I only count how many
objects of each type are in front of the camera and I light up the appropriate LED. Check this out, with just 100 lines of Arduino
code we are able to detect objects! Our first Machine Vision Arduino sketch is
ready and we didn’t have to write any Machine Vision algorithm at all. You can find the code of this example in the
description of the video below. Let’s now see another example. As I said earlier, at the back of the Pixy
board we can connect two servo motors. I connected just one SG90 servo and I loaded
the PanTilt demo that comes with the Arduino Library. I have cleared all the signatures from the
Pixy memory so now the Pixy cam can not detect any objects at all. Let’s teach Pixy to detect this Red Pikachu
at once without using the computer. We press and hold the button of the Pixy board
until the RGB led flashes. Now it is ready to be taught. We place the object in front of it. The RGB led reflects the color of the object
the camera sees. We need to recognize a red object so, when
the LED turns red it means that Pixy can see our red object. When that happens we press the button once
more and now Pixy can recognize this object! It is as easy as this. If we now connect the Servo and power up the
Arduino we can see that the camera can follow the Red Pikachu! Cool! We can easily teach Pixy to follow the Green
Pikachu. Check this out, pressing the button once,
placing the Green Pikachu in front of the camera, pressing the button once more and
the camera can now follow the Green Pikachu. Amazing stuff! Pixy can do many more things, like line following,
detecting color codes and simple barcodes. Since I cannot cover all this stuff in details
in this video I will have to prepare a follow up video about the Pixy cam. I have already got some parts to build a line
following robot with it. It will be our first robot that will be able
to see. Until then, I would love to know your opinion
about the Pixy cam. In my opinion, Pixy is a great camera, and
it clearly demonstrates where Machine Vision is going to be in a few years. In a few of years we will be able to buy low
cost Vision Sensors, and they are going to be very common and easy to use, just like
this temperature sensor. Machine Vision is going to present everywhere
and it is going to change everything both in good and bad ways. If this is your first time here, I would love
to have you subscribed. In this channel, I post videos about DIY projects
twice a month. I love making things, and I believe that anyone
can make things, anyone can become a maker. That’s why I created this channel, to share
my knowledge with the community and learn from the community. I hope you will join us. I will see you in the next video!

48 Comments

  1. Fulvio Sangalli June 5, 2019 at 12:04 pm

    Welcome back my friend. What happened? I was worried… I hope everything is fine.

  2. Ole Baltzer June 5, 2019 at 12:12 pm

    Welcome back. You have been missed. 😀

  3. Facundo Rosito June 5, 2019 at 12:21 pm

    Welcome back and many thanks for this usefull video!

  4. Amisail3 June 5, 2019 at 12:26 pm

    Great video and very good sensor. Μπράβο ρε φίλε. Ακριβουτσικο βέβαια ακόμα. Περιμένω νέα σου βίντεο.

  5. Francesco Santini June 5, 2019 at 12:26 pm

    I played with both the pixy1 and pixy2 for a small robot project last year. They are indeed pretty cool, but it should be made more clear that they just recognize colors, not shapes. This can be a significant limitation in some cases. PS: love your videos!

  6. LJ Liberto June 5, 2019 at 12:28 pm

    Thanks for the review. I would love to see a comparison video of the 2 camera modules. Thanks!

  7. Krishnanshu Dey June 5, 2019 at 12:40 pm

    Want more videos about pixy with some project examples. Thanks

  8. Stephen Ludgate June 5, 2019 at 12:46 pm

    Was going to say "Welcome back", but everyone has beaten me to it! But, Welcome Back!!

  9. GREEN TECK GREECE June 5, 2019 at 1:20 pm

    Πλζ κανε ενα Βίντεο στα ελληνικά

  10. Rolf H. June 5, 2019 at 1:58 pm

    Hello Nick, Welcome back. It's a nice video again. Thanks.

  11. Adam Payne June 5, 2019 at 2:14 pm

    I like all the options of the camera but "not quite hd," resolution is disappointing. Wish they could up to at least 1080i spec. I'm no expert but I wonder if one could use this as motion data for stabilization or tracking? You'd probably have to translate the serial data into something that whatever program you are using could understand and establish an offset but it's a neat idea.

  12. Akang Hadi Batam June 5, 2019 at 2:36 pm

    Well come back, love your great videos..

  13. Random Creations June 5, 2019 at 2:39 pm

    Awesome

  14. Raghuraj Singh June 5, 2019 at 2:51 pm

    It's awesome please give me a link for india

  15. 2000jago June 5, 2019 at 3:58 pm

    I remember a time when this channel published a video per week!
    Now I don't even recognize the channel name when it appears in my feed since it's featured so infrequently. 🙁

  16. Edmorbus June 5, 2019 at 4:07 pm

    thanks for this usefull video

  17. Michael Sanders June 5, 2019 at 4:19 pm

    I would like a Pixy2 camera. I think it can make an excellent paintball auto-turret.

  18. alex lux June 5, 2019 at 4:51 pm

    interesting and amazing camera, i wait the next video

  19. TheAstronomyDude June 5, 2019 at 5:41 pm

    Great for schools, but much too expensive for individual hobbyists. For $99 you can buy an Nvidia Jetson Nano which is thousands of times more powerful and can use any camera.

  20. Elektronik Atölyem June 5, 2019 at 6:05 pm

    Excellent project 👍

  21. Upcycle Electronics June 5, 2019 at 6:38 pm

    It's nice to see an upload from you Nick. Nice new intro too 🙂

    I can think of two projects I would like to use machine vision for. The first: I'm currently using a doppler sensor, and working on an ultrasonic + passive infrared setup for use with a cat chasing (trolling) robot toy. Sixty five dollars is a bit much for a project my cat will actively plot to destroy, but if an option exists for a little less than half the Pixy's price I'd probably pounce 🙂
    The second use is one I'm nowhere near ready to build, but am very curious about. I would love to try and build my own component pick and place machine one day. The biggest unknown aspect of a project like this is the machine vision aspect. I believe I could build all the other mechanical parts of the device without issue, but I have no idea where to start with a machine vision system that involves 3D accuracy. I would really appreciate any information you can share about the accuracy, error margins, and/or an abstract overview of what kinds of systems exist for different applications. I'm completely ignorant about this subject.
    Thanks for the upload.
    -Jake

  22. bonnome2 June 5, 2019 at 7:00 pm

    I also have a maix go board. It is a way more powerful than this one but it is not as easy to program!

  23. BaronVonBiffo June 5, 2019 at 7:16 pm

    Great to see you back online.

  24. Andy Andy Frogy June 5, 2019 at 8:20 pm

    Welcome baaaack!

  25. Johann Wyss June 5, 2019 at 10:05 pm

    Hey Nick, It's good to see you're well.

  26. Dan Namo June 5, 2019 at 11:16 pm

    Welcome back friend . Very nice video .

  27. Robert Robert June 6, 2019 at 6:06 am

    Great video. Very interesting. Good to have you back Nick. Glad you are OK. 👍

  28. Jean Seb Astienback June 6, 2019 at 12:11 pm

    Your posts are amazingly awesome! This one is great! I'm going spend 50 euros to get one pixy 2. I've some great idea of use… Thank you very much!

  29. Stuart C Allen June 6, 2019 at 4:20 pm

    Welcome back, I've missed your videos.

  30. Browarus Pierogus June 6, 2019 at 10:05 pm

    a $60+ camera that cannot even do HD?

  31. thomas makucevich June 7, 2019 at 7:05 am

    Cool video. Thanks!

  32. electron1979 June 8, 2019 at 2:36 am

    Great to have you back!

  33. ali hasan June 10, 2019 at 3:54 pm

    can it recognize deck of cards or different currency notes?

  34. popo colocoi June 11, 2019 at 10:05 pm

    Thank you for this content. I hope this technology will solve all the security issues in the world, so there will be no more bad guys as well as good guys.

  35. The Arduino Guy June 12, 2019 at 5:52 am

    Hey dude where were you all those days. I missed you a lot. Please upload videos regularly.

  36. Dejan Petrović June 13, 2019 at 6:58 pm

    Damn, my southern brother, hang on. Hope all is ok. I was checking your channel on daily bases.

  37. MahnoTv June 14, 2019 at 7:49 pm

    Great! What about Sipeed Maix or other k210-board?

  38. Lucio Pintanel June 21, 2019 at 3:36 pm

    Onde posso adquiri um módulo pixy 2?

  39. Savita Yadv August 3, 2019 at 2:56 pm

    Plz make a multi purpose robot with pixy camera that can talk and make movement

  40. Dalal Aljouhar October 5, 2019 at 4:34 pm

    Hello
    Can i detect flame using pixy

  41. nadal ferra October 5, 2019 at 10:13 pm

    Englishpanish xD

  42. Raju Selvaraj October 31, 2019 at 12:19 pm

    Sir, please upload the line following pixy Robo, I am going to do the project in my company So I need your lecture before entering into the project

  43. Briac LOISON November 22, 2019 at 8:42 am

    hi i'm working on a robot project and i don't find the maximum distance
    with which the camera can still recognize colors, thank you in advance

  44. Glenmar Silva Olea November 22, 2019 at 8:47 am

    can it detect transparent object like PET bottles?

  45. Jerseylance1 November 30, 2019 at 9:50 pm

    I wish it had facial recognition.

  46. Norvin T Franklin December 1, 2019 at 5:00 pm

    Can you sent me the code for green picahu the green light Brun..

  47. CraftMojo December 4, 2019 at 1:37 am

    Is it compatible with mbot?

  48. Adarsh Madhusoodanan January 5, 2020 at 3:31 am

    What is the best machine vision camera.. Please make a comparison

Leave a Comment

Your email address will not be published. Required fields are marked *