Backpack #1: OpenMV Camera

Introduction: Backpack #1: OpenMV Camera

SPIKE Prime Backpacks are extensions for LEGO Education SPIKE Prime.

The Open MV camera is the brain for the Camera Backpack that allows you to integrate image processing and machine vision capabilities of the Open MV camera to LEGO SPIKE Prime.

We also have a Grove Sensor Backpack that allows you to connect cool sensors, a Pyboard Backpack that lets you connect to the WiFi, a Micro:bit Backpack that enables radio communication, and a Breadboard Backpack that you can use to prototype circuits.

Supplies

OpenMV camera (link)

OpenMV connector PCB (link)

Headers

2 - 1x8 Female header pins (long pins) (link)

2 - 1x4 Female header pins (comes in the same box as above)

1 - 1x8 Male 1.27 header pins (from Mouser) (link)

Lego pieces

4 - 1x3 beams

1 - 1x7 beam

10 - pegs

1- Distance Sensor connector

Case design (link)

Paper case design (link)

Step 1: Printing the Connector PCB

The Connector PCB will connect the OpenMV camera to the SPIKE Prime.


Go to the Google Drive folder and download "OpenMV v3 Manutacturing.fzz" file. There are many companies that can manufacture PCBs for you. Find the one that is nearby.

OR,

If you have access to a makerspace and you can use Desktop PCB Milling Machine by Bantam Tool download "OpenMV v2 Othermill.fzz" file and print them.

OR,

You can do it at your home. Follow the instructions here. https://www.instructables.com/id/DIY-PCB-Etching.... If you want to open the file go to and download/install Fritzing on your computer and open the design on your computer.

Step 2: 3D Printing the Case

3D Print "backpack OpenMV lid v1.0.stl" and "backpack OpenMV v1.0.stl".

Our prints were made using Form 2 Printer. You may need to adjust the dimension based on your printer and you may need to sand down the sides to press fit.

Step 3: Soldering Header Pins

Solder 2 - 1x8 Female header pins (long pins) to the OpenMV camera.

Also, solder 1x4 Female header pins and 1x8 Male 1.27 header pins to the Connector PCB.

Step 4: Inserting Connector PCB Inside the Case

Secure the PCB inside the 3D printed case using M2 nuts and bolts.

Step 5: Placing the OpenMV Inside the 3D Printed Case

Place the OpenMV camera over the connector PCB inside the case.

Close the 3D printed case with the 3D printed lid.

Note: Clip the long pins of the top four legs if they hit the bolt.

Step 6: Connecting the Backpack to Distance Sensor Connector

Unscrew and take out the connector from the LEGO SPIKE Prime Distance Sensor and plug it to the backpack. The headers are small, so be careful while plugging it in.

Step 7: Encasing the Backpack in Paper Cover

Download the paper cover design from our Google Drive Folder. Print it in color if have access to color printer. B/W printer will work as well.

If you have access to a laser cutter then use laser cutter to cut the design. If not, use scissors to cut them or use X-acto knives.


Fold them and wrap them around the 3D printed case. Use beams and pegs to secure the paper on the case.

Be the First to Share

    Recommendations

    • Anything Goes Contest

      Anything Goes Contest

    6 Comments

    0
    mhelfman
    mhelfman

    4 months ago

    I just figured out how to increase the data transfer rate from the OpenMV to the Spike Prime. I deleted a couple of delays in the OpenMV and Spike code and now everything is working perfectly. I've been experimenting with using a camera on a LEGO robot for many years (mainly for homing in on colored balls) all the way back to the original CMUcam and later the Pixy camera, and had almost given up hope of getting the OpenMV to work. So glad it finally does!

    0
    mhelfman
    mhelfman

    4 months ago

    A few years ago I bought an OpenMV camera which I hoped to use for color tracking with a LEGO Spike Prime robot. Unfortunately, I could never figure out how to send the tracking data from the OpenMV to the Spike HUB. At that time, I posted a comment to that effect on this page and got a response saying they would eventually post the code that would allow me to do this. Fast forward to a few days ago, when almost by accident I returned to this page and discovered that the code I needed had been posted several months ago. I had a little trouble getting the code to work, but once I deleted this line in the Spike code: (I was getting an "object has no attribute 'mode'" error)...

    hub.port.B.device.mode(0)

    ...it worked ok.

    I noticed that on Anton's Mindstorms Hacks website, he used the same Spike code in a project of his and didn't include this line of code, so you may already be aware of this.

    So now that I've gotten everything working, I was wondering if there is anyway to increase the data transfer rate from the OpenMV to the Spike Hub. WIth the current setup, I could only get about five 8 bit values per second into the Spike Hub.

    Thanks for posting the code for this project and hope others are benefiting from it as well.

    Marc Helfman
    Kenwood, CA





    0
    mhelfman
    mhelfman

    Question 2 years ago on Step 2

    It would be great to be able to use an OpenMV camera with Spike Prime.The Instructable does a good job of showing how to connect the camera to the distance sensor port, but how do you use the camera data in your Scratch program? Do you just read a value (x centroid?) as though you were getting a value from the distance sensor, or is there some additional software required?

    0
    mhelfman
    mhelfman

    Reply 4 months ago

    A few years ago I bought an OpenMV camera which I hoped to use for color tracking with a LEGO Spike Prime robot. Unfortunately, I could never figure out how to send the tracking data from the OpenMV to the Spike HUB. At that time, I posted a comment to that effect on this page and got a response saying they would eventually post the code that would allow me to do this. Fast forward to a few days ago, when almost by accident I returned to this page and discovered that the code I needed had been posted several months ago. I had a little trouble getting the code to work, but once I deleted this line in the Spike code: (I was getting an "object has no attribute 'mode'" error)...

    hub.port.B.device.mode(0)

    ...it worked ok.

    I noticed that on Anton's Mindstorms Hacks website, he used the same Spike code in a project of his and didn't include this line of code, so you may already be aware of this.

    So now that I've gotten everything working, I was wondering if there is anyway to increase the data transfer rate from the OpenMV to the Spike Hub. WIth the current setup, I could only get about five 8 bit values per second into the Spike Hub.

    Thanks for posting the code for this project and hope others are benefiting from it as well.

    Marc Helfman
    Kenwood, CA








    0
    CEEOInnovations
    CEEOInnovations

    Answer 2 years ago

    Thank you for your comment and for your great question. You will need to program the OpenMV camera such that the SPIKE Prime can read the camera data and it could be anything : color data, image detection data, etc. Connecting on the distance sensor port is just an easy way of connecting our backpack to the SPIKE Prime, it does not automatically detect the camera. We will let you know when it is possible to share the sample camera codes with you.