Shapeshifter Detector Proof of Concept

by HollowForest in Circuits > Arduino

324 Views, 1 Favorites, 0 Comments

Shapeshifter Detector Proof of Concept

Instructable Five.jpg

Every time I have a class project assigned by my professor, Thomas, it goes in a direction I never intended, and that’s a very good thing. In this case, I basically wanted to create a pop culture reference out of my Arduino project. While there’s nothing wrong with that, he encouraged me delve farther into the art of the basic concept, rather than a surface level examination of my favorite anime.

It didn’t take me long to decide what I wanted to do. The project is a basis for a game. In Joseph Cambell’s “The Hero of a Thousand Faces”, he discusses the eight character archetypes of the hero’s journey: hero, mentor, ally, herald, trickster, shapeshifter, guardian, and shadow. It just so happens that the anime character I was inspired by fits perfectly into the shapeshifter’s role. What’s unique about the shapeshifter is that they aren’t loyal to anyone. Their allegiance is always changing. They’re fighting for or against the hero, or even only for themselves. That’s what makes their shape shift! So, where do we go from there? How does one make a game centered around the shapeshifter?

Enter roleplaying! At the start of the game, each player receives a card and a task. When they complete the task, they scan their card and are assigned an archetype based on the image it displays. Everyone knows their designated archetype except the shapeshifter, who, instead of reading the word shapeshifter on an LCD like the others, simply sees a light flash. Everyone who was given an archetype receives a role-playing task to accomplish. Trick the trickster, betray the ally, trap the hero. The shapeshifter can do whatever they want. Naturally, the person who doesn’t know who they are will fall into the shapeshifter’s role without even knowing it. They will trick and fight, switch sides, and do whatever it is they want.

The game is simply an examination of shapeshifters in literature and what makes them what they are. But how does this fit into an Arduino project you may ask? Let me tell you!

I will be designing a little camera box which scans the cards, and either displays the archetype on an LCD, or will flash an addressable LED many colors when it recognizes the shapeshifter.

For now, however, let’s start small. I’m making a proof of concept for that project. I want to use the Pixy2 camera from Charmed Labs to recognize objects I have designated as a shapeshifter, and then light up a simple LED to indicate it has been detected. Sounds simple enough!

Materials

Instructable Zero.jpg

For this project we will need-

Arduino Uno microcontroller

Pixy2 camera from Charmed Labs

A breadboard

Two male to male jumper cables

A 220 ohm resistor

And any color LED you like

Hardware Setup

Let’s get our hardware working first. To keep this tutorial short and sweet I’ll link a couple of excellent guides to get started with both the Arduino Uno microcontroller and the Pixy2 camera.

Arduino

https://www.arduino.cc/en/Guide/ArduinoUno

Pixy2

https://dronebotworkshop.com/pixy2-camera/

Make sure to install your Pixy2 library, called “Pixy2.h” in the library manager.

Here is a link to getting the software used to interact with the camera, called Pixymon.

https://pixycam.com/downloads-pixy2/

Fritzing Diagram

Shapshifter Sketch_bb.png

This is the Fritzing diagram of the wiring setup using most of the hardware. I wasn't able to insert anything to take the place of the Pixy, but that's okay! Just remember that it connects to the six pin ICSP connector at the bottom of the Arduino board in the diagram using the cable provided with the camera.

Note that the power is on digital pin 12, and ground goes to digital ground.

LED

Instructable One.jpg

Place an LED color of your choice

220 Ohm Resistor

Instructable Two.jpg

Place the 220 ohm resister on the anode side of the LED

Cables

Instructable Three.jpg

Place the green wire on the positive power rail with the other side of the LED and connect it to digital pin 12 on the Arduino.

Place the blue wire on the cathode and connect it to digital ground on the Arduino.

Pin 12 and Ground

Instructable Four.jpg

Make sure power is on pin 12.

Connect Pixy

Instructable Five.jpg

Connect your Pixy to the sic pin ICSP connector on the bottom of the Arduino microcontroller, then connect the micro USB cable to the computer.

Setting Signatures

Capture one.PNG
Capture two.PNG

Open the Pixymon software. Make sure you are receiving video. Under action, select set signature 1. The camera will freeze, and you can click and drag to select a color to set as your first signature. For the sake of this tutorial, try and select a red object.

Under file, configure, navigate to your signatures. Label it “SigRed”. Now you’ve got your first signature! We’ll use that later in the project. Go ahead and do the same thing for “SigBlue”.

Try running the blink example sketch in the Arduino IDE to test the function of your LED.

Upload the Code

This is the code and the downloadable .ino file will be at the end of this tutorial. For the purposes of this tutorial, suppose that signature red is hero, and signature blue is the shapeshifter. Now we can detect our two archetypes and get a response form the LED.

Demonstration

Shapeshifter Prototype Demonstration