Dunce Cap




Introduction: Dunce Cap

About: I make projects, they have names. Some are obscure and some straightforward. Form or Function; I go either way. Battery powered or edible, I love making things.

21rst Century update of an old standard. Also serves as a quick Halloween costume for someone who forgot to bring one to your Halloween Party!


RBG color matrix
Minty Boost or other power
Poster board


Exacto knife
FTDI friend for programming Colorduino


I used my colorduino because all my arduinos are busy assisting other customers at the moment. Also I thought the "Plasma.PDE" would look real nice. I first thought about using a bunch of red LEDs and running a bloated blink sketch. This was alot easier. You could simply wire a bunch of LEDs to some batteries and skip the microcontroller altogether. I simply like the idea of a flashy Dunce Cap. Also I'm sorry about the junky photo's. Camera is all out of power and I am without a charger. Camera phone is all I got. ;)

Background & Fun Links:

Why do only Boys have to Wear these?
http://en.wikipedia.org/wiki/Dunce_hat_(topology) Why its not a Hat-this is too complex for this rube
http://www.youtube.com/watch?v=Q9Vzk4AbEus A random tech-poppy song calling for the return of ostracizing
http://www.urbandictionary.com/define.php?term=dunce%20cap Frosted and Margarita varieties

Step 1: Getting Started

Start here at Lincomatics's Blog  http://blog.lincomatic.com/?p=148.  He's got the Plasma.PDE that we want.   Upload it to the Colorduino.   Take the poster board and roll it into a cone.  Tape it all closed and secure.

Step 2: The Code

ColorduinoPlasma - Plasma demo using Colorduino Library for Arduino
Copyright (c) 2011 Sam C. Lin lincomatic@hotmail.com ALL RIGHTS RESERVED

based on Color cycling plasma
Version 0.1 - 8 July 2009
Copyright (c) 2009 Ben Combee. All right reserved.
Copyright (c) 2009 Ken Corey. All right reserved.
Copyright (c) 2008 Windell H. Oskay. All right reserved.
Copyright (c) 2011 Sam C. Lin All Rights Reserved

This demo is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This demo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


typedef struct
unsigned char r;
unsigned char g;
unsigned char b;
} ColorRGB;

//a color with 3 components: h, s and v
typedef struct
unsigned char h;
unsigned char s;
unsigned char v;
} ColorHSV;

unsigned char plasma[ColorduinoScreenWidth][ColorduinoScreenHeight];
long paletteShift;

//Converts an HSV color to RGB color
void HSVtoRGB(void *vRGB, void *vHSV)
float r, g, b, h, s, v; //this function works with floats between 0 and 1
float f, p, q, t;
int i;
ColorRGB *colorRGB=(ColorRGB *)vRGB;
ColorHSV *colorHSV=(ColorHSV *)vHSV;

h = (float)(colorHSV->h / 256.0);
s = (float)(colorHSV->s / 256.0);
v = (float)(colorHSV->v / 256.0);

//if saturation is 0, the color is a shade of grey
if(s == 0.0) {
b = v;
g = b;
r = g;
//if saturation > 0, more complex calculations are needed
h *= 6.0; //to bring hue to a number between 0 and 6, better for the calculations
i = (int)(floor(h)); //e.g. 2.7 becomes 2 and 3.01 becomes 3 or 4.9999 becomes 4
f = h - i;//the fractional part of h

p = (float)(v * (1.0 - s));
q = (float)(v * (1.0 - (s * f)));
t = (float)(v * (1.0 - (s * (1.0 - f))));

case 0: r=v; g=t; b=p; break;
case 1: r=q; g=v; b=p; break;
case 2: r=p; g=v; b=t; break;
case 3: r=p; g=q; b=v; break;
case 4: r=t; g=p; b=v; break;
case 5: r=v; g=p; b=q; break;
default: r = g = b = 0; break;
colorRGB->r = (int)(r * 255.0);
colorRGB->g = (int)(g * 255.0);
colorRGB->b = (int)(b * 255.0);

dist(float a, float b, float c, float d)
return sqrt((c-a)*(c-a)+(d-b)*(d-b));

unsigned char x,y;
float value;
ColorRGB colorRGB;
ColorHSV colorHSV;

for(y = 0; y < ColorduinoScreenHeight; y++)
for(x = 0; x < ColorduinoScreenWidth; x++) {
value = sin(dist(x + paletteShift, y, 128.0, 128.0) / 8.0)
+ sin(dist(x, y, 64.0, 64.0) / 8.0)
+ sin(dist(x, y + paletteShift / 7, 192.0, 64) / 7.0)
+ sin(dist(x, y, 192.0, 100.0) / 8.0);
colorHSV.h=(unsigned char)((value) * 128)&0xff;
HSVtoRGB(&colorRGB, &colorHSV);

Colorduino.SetPixel(x, y, colorRGB.r, colorRGB.g, colorRGB.b);

Colorduino.FlipPage(); // swap screen buffers to show it

Name: ColorFill
Function: Fill the frame with a color
Parameter:R: the value of RED. Range:RED 0~255
G: the value of GREEN. Range:RED 0~255
B: the value of BLUE. Range:RED 0~255
void ColorFill(unsigned char R,unsigned char G,unsigned char B)
PixelRGB *p = Colorduino.GetPixel(0,0);
for (unsigned char y=0;y for(unsigned char x=0;x p->r = R;
p->g = G;
p->b = B;


void setup()
Colorduino.Init(); // initialize the board

// compensate for relative intensity differences in R/G/B brightness
// array of 6-bit base values for RGB (0~63)
// whiteBalVal[0]=red
// whiteBalVal[1]=green
// whiteBalVal[2]=blue
unsigned char whiteBalVal[3] = {36,63,63}; // for LEDSEE 6x6cm round matrix

// start with morphing plasma, but allow going to color cycling if desired.
unsigned char bcolor;

//generate the plasma once
for(unsigned char y = 0; y < ColorduinoScreenHeight; y++)
for(unsigned char x = 0; x < ColorduinoScreenWidth; x++)
//the plasma buffer is a sum of sines
bcolor = (unsigned char)
128.0 + (128.0 * sin(x*8.0 / 16.0))
+ 128.0 + (128.0 * sin(y*8.0 / 16.0))
) / 2;
plasma[x][y] = bcolor;

// to adjust white balance you can uncomment this line
// and comment out the plasma_morph() in loop()
// and then experiment with whiteBalVal above
// ColorFill(255,255,255);

void loop()

Step 3: Time to Cut

Firstly, Be careful. Don't slice into your hand with the exacto. That'd be a real Dunce move. I roughly wrote out DUNCE with a shapie on a scrap grocery bag. Tape it firmly to the cone to act as a stencil. Then, using the Exacto, cut though the letters. Gently peel off the stencil and tape a plastic bag on the inside behind the letters.

Step 4: Taping It Up

Pre tape all the electronic pieces(Minty, LED matrix, USB cable) and place them inside the cone. Place the MintyBoost all the way at the top and position the LED matrix so that you get the most light shining through the cut-out. Be careful of the FTDI friend, it's still connected via some flimsy headers.

Halloween Props Challenge

Participated in the
Halloween Props Challenge

Make It Glow Challenge

Participated in the
Make It Glow Challenge

4th Epilog Challenge

Participated in the
4th Epilog Challenge

Be the First to Share


    • Stick It Challenge

      Stick It Challenge
    • Tinkercad to Fusion 360 Challenge

      Tinkercad to Fusion 360 Challenge
    • Make It Modular: Student Design Challenge

      Make It Modular: Student Design Challenge



    8 years ago on Introduction

    Great project!! I want to try something like this, but I am curious of the power consumption of the colorduino + RGB board (I am trying to figure out what is the battery life, since I am looking to get at least 8 hrs).


    10 years ago on Introduction

    fun electronics project, and the 'dunce' application is hilarious.


    Reply 10 years ago on Introduction

    thx mike. The electronics are real easy too. A great starter project and I'm glad I have one laying around. Just today, I failed a written driving exam at the DMV. I think it'll find a permanent place in the corner of my new workshop. It could also be souped up into a lamp. Conical Head Lamps are all the rage these days. Kids go crazy in the clubs for em.