Protogen Cosplay Mask Electronics
by Fishyelectrition in Circuits > Arduino
1037 Views, 3 Favorites, 0 Comments
Protogen Cosplay Mask Electronics
I am a 15 year old with a passion for electronics and cosplay and i created a Protogen mask's electronics with money i got from yard work from my Neibors and parents now for anyone attempting to build this or learn from my code heres a few warnings:
Because this is a Arduino project the circuit board is severely underpowered for this type of project if you want a fade look that blinks or has any tracking whatsoever your going to have to find alot of workarrounds like i did.
If you intend to upload a video file for animations or an image file for the face remember this electronic cannot handle that.
If you intend to learn electronics or programing this is a fantastic place to start as i have more than enough coments in my code and list the documentation used bellow
if you want to expand on this project or have any questions or concerns feel free to message me on twitter
this is incredibly cheap for the electronics that most people would use for a fursuit with a large matrix so if you wish for expansion in the future its absolutely possible as the rgb matrix in the supply's can handle anything you throw at it i would suggest as an improvement already a raspberry pi however these cost far more and need entirely different programing
Supplies
First things first you need a circuit board any Arduino mega will work however alternatives that use the same hardware as the Mega will do with far less cost for example:
https://www.amazon.com/dp/B01H4ZDYCE?ref_=cm_sw_r_apan_dp_EEXDP726V94EPZ1YGZAZ_1&th=1
RGB matrix to display the face (a regular Led will do but it will require code changes and be cheaper but like.... why?)
https://www.amazon.com/dp/B09MB426K5?ref_=cm_sw_r_apan_dp_0124W7NN2SRK3QCNP6K9&th=1
Wires are always needed
https://www.amazon.com/dp/B08151TQHG?ref_=cm_sw_r_apan_dp_2W83R25R53K5NH8EWY0T
Any computer that can run the arduino ide (Windows 7+)
arduino Ide (duuhhh)
https://www.arduino.cc/en/software
Power supply for matrix
https://www.amazon.com/Adapter-100-240V-Converter-Cameras-Security/dp/B0B2RH7DSR/ref=sr_1_11?keywords=5+volt+power+supply&qid=1688048802&sr=8-11
and 76 dollars on hand to buy all the things listed above minus the computer
IDE and Conections
The arduino mega and display need to be hooked up correctly following this schematic above you can connect everything correctly and when you do connect it up you will notice that the ribben chord is useless if you want to use it, and the chord that came with the RGB matrix is kinda useless as well, that 8$ pack of wires you bought is the replacement for the FtF useless chord and u can now use the shortest FtM chord in the pack to make the connections
when you do so make the changes in your ide software immediately so we can get them out of the way, this will most likely be your problem in the future
The Most Difficult Step
assuming you have all the supplies hooked up and connected time to deal with the power supply the prongs that came with the power supply need to be cut off; they look like a V and a C combined to make a weird power outlit they need to be cut off and wirestripped to be put into the power bank looking thing
watch a toutorial or ask some help if you are having trouble this is by far the hardest step
Powering the Matrix
Plug the Power supply into a wall oulit, and then the power bank thing into the power supply end, then the wire that goes to the power bank goes into the led matrix back as depicted in image 2 after this is completed the RGB matrix shouldent really have any indication that it was powered so dont worry
Plug the Circut Into Your Computer
the blue cable that came with the circuit board plug that into the circuit board and plug it into your pc the wire should be blue
Install the Correct Library's
Download 2 library's
https://github.com/adafruit/RGB-matrix-Panel
https://github.com/adafruit/Adafruit-GFX-Library
RGBmatrixPanel.h
Adafruit_GFX.h
after downloading go into your ide and follow this short tutorial on those librarys you just downloaded
https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries
a library is a bunch of code that will give Your code context on some functions and it makes your code easier to read
Code
//copy and paste this code into your ide:
/* version - 1.2
* Thank you for For using my code as you problebly understand this code is under a Atribution-NonComercial- *Sharealike copyright
* meaning don't sell my code but you can absolutely use it for personally use
*
* If you have any questions or concerns msg me on twitter
* where i can only asume that i will post updates to this code or make new projects like this
*
* twitter:Enigma
* @Enigma67205483
*
* i hope you learn somthing and have fun
*/
//library declarations
#include <Adafruit_GFX.h>
#include <RGBmatrixPanel.h>
//permenent values getting declared
#define CLK 11
#define OE 9
#define LAT 10
#define A A0
#define B A1
#define C A2
#define D A3
RGBmatrixPanel matrix (A, B, C, D, CLK, LAT, OE, false, 64); //bypass declare function and just declare anyway (its more efficiant)
//change these if you want your color to change (make sure to change the fade look below as well
//red value
int Rv=30;
//green value
int Gv=0;
//blue value
int Bv=90;
//line count
int Lc=0;
//second line count
int SLc=27;
//Teitiery line count
int TLc=30;
//Cycles count
int Cc=0;
//*******************************************************************actuall code**************************************************************
void setup()
{
//these pins tell the circut board what signalls do what
pinMode(24, OUTPUT); //R1
pinMode(25, OUTPUT); //G1
pinMode(26, OUTPUT); //B1
pinMode(27, OUTPUT); //R2
pinMode(28, OUTPUT); //G2
pinMode(29, OUTPUT); //B2
pinMode(CLK, OUTPUT);
pinMode(OE, OUTPUT);
pinMode(LAT, OUTPUT);
digitalWrite(OE, HIGH);
digitalWrite(LAT, LOW);
digitalWrite(CLK, LOW);
matrix.begin(); //this turns on the matrix it doesent call a function
}
//if you would like to make new expressions change HappyEx() far below because thats the actuall face as we dont have any imputs setup to make more expressions
void loop()
{
HappyEx(); //this calls the happy expression function
delay(10000); //makes it so its energy efficiant and not constantly refreshing the screen
}
//honestly just dont touch these they make it so the thing uses less ram
void NewLineUp(){
SLc--;
TLc--;
Cc++;
}
void NewLineDown()
{
SLc++;
TLc++;
Cc++;
}
//this makes the face actually display
void HappyEx(){
//*******************************************MOUTH*****************************
//i know this looks forien but all of these are be defined at the top of the code
while(Cc<61)
{
if (Cc==60){//indent 17
SLc--;
Cc++;
} else if (Cc==57){//indent 16
NewLineUp();
} else if (Cc==53){//indent 15
NewLineUp();
} else if (Cc==50){//indent 14
NewLineUp();
} else if (Cc==47){//indent 13
NewLineUp();
} else if (Cc==44){//indent 12
NewLineUp();
} else if (Cc==41){//indent 11
NewLineDown();
} else if (Cc==38){//indent 10
NewLineDown();
} else if (Cc==34){//indent 9
NewLineUp();
} else if (Cc==29){//indent 8
NewLineUp();
} else if (Cc==26){//indent 7
NewLineUp();
} else if (Cc==22){//indent 6
NewLineUp();
} else if (Cc==18){//indent 5
NewLineDown();
} else if (Cc==15){//indent 4
NewLineDown();
} else if (Cc==11){//indent 3
NewLineUp();
} else if (Cc==8){ //indent 2
NewLineUp();
} else if (Cc==3){ //indent 1
NewLineUp();
} else {
matrix.drawLine(Lc, SLc, Lc, TLc, matrix.Color888(Rv, Gv, Bv));
Cc++;
Math(Lc, Rv, Gv, Bv);
}
}
//*****************************************************************NOSE********************************************************
//change these values so the color can be whatever you wish
//i just wanted the nose and eyes to be slightly different shades
//red value
int Rv=30;
//green value
int Gv=0;
//blue value
int Bv=90;
//Line count
int Lc=0;
//*******************************************************************Nose chaos below
matrix.drawLine(Lc, 4, Lc, 8, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 2, Lc, 9, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 2, Lc, 5, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 2, Lc, 4, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 1, Lc, 4, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 1, Lc, 3, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 2, Lc, 3, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 2, Lc, 3, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawPixel(Lc, 2, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawPixel(Lc, 2, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
//***************************************************************EYE stuff
//Line count
Lc=37;
matrix.drawLine(Lc, 4, Lc, 7, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 3, Lc, 8, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
while (Lc>38 and Lc<44){
matrix.drawLine(Lc, 2, Lc, 8, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
}
matrix.drawLine(Lc, 1, Lc, 7, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 1, Lc, 7, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
while (Lc>45 and Lc<50){
matrix.drawLine(Lc, 1, Lc, 6, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
}
matrix.drawLine(Lc, 2, Lc, 6, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 2, Lc, 6, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 2, Lc, 5, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 3, Lc, 5, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 3, Lc, 4, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
matrix.drawLine(Lc, 3, Lc, 4, matrix.Color888(Rv, Gv, Bv));
Math(Lc, Rv, Gv, Bv);
}
void Math(int& Lc, int& Rv, int& Gv, int& Bv) { //this is the fade look function everything calls
Lc++;
if (Rv==29 || Rv<29){ //Red value
Rv = 30 + Lc;
}else if (Rv>129){
Rv = 130;
}else {
Rv=Rv+Lc;
}
if (Bv==89 || Bv<89){ //blue value
Bv = 90 + Lc;
}else if (Bv==255|| Bv>220){
Bv = 255;
Rv = 130;
}else {
Bv=Bv+Lc;
/* if (Gv==0 || Gv<0){ //green value this is not used in our functions because pink doesent need green use if u want
Rv = 1 + Lc;
}else if (Gv>129){
Gv = 130;
}else {
Gv=Gv+Lc;
} */
}
}
Finishing Steps
Assuming all the connections have been made correctly the code can be compiled in the top left and then uploaded (slightly to the right) to the board, givin arround 4 seconds the matrix should now display correctly.
Bugfixing
Hopefully you don't have to even read into this so skip if you aren't having troubles
if you receive error code 1 its most likely a library step please go back to this step and try again however this could also mean a code issue attempt to repaste it in again but if these don't work you should absolutely look up your error code
if the screen does not display anything at all and the code has been successfully uploaded, its a power supply issue please reattempt to put the power supply into the power bank thingie by going back to that step
if you see it saying error uploading to ______ it might be a port issue or ide settings issue please refer to this step and make sure your uploading to the correct port also be sure to use the right bootloader as shown in the image above
all in all if you followed this tutorial you should get the correct outcome, when some small issue happens it causes a cascade of failures that seem larger than it actually is, please try your hardest and if you still cannot proceed you can message me on twitter with your problem and i will help you sort through it.
The Next Steps?
this tutorial is only on the electronics of the protogen, i will follow up with more steps in the future however im too poor to afford the rest of the parts, if you want your entire mask quickly before i give an update there is plenty of tutorials online on fursuits such as this however this is the only one with a screen this large for such a small cost, adapt their tutorials but again i should be giving an update sooner than that