Return to site

Curie Smart Hair Band

· tutorial,CurieNeurons kit,Smart Hair Band

In this tutorial, you will learn how to make a smart head band that shines differently depends on whether you are nodding or shaking your head. :)

First, let's watch a short tutorial video:

Below please find the complete step by step guide.

Feel free to shoot your questions in the comment area, we will try our best to help!



  • CurieNano development board
  • 3.7V lithium battery
  • 16-bit LED light panel * 2
  • 3D-printed shade * 2
  • Velcro
  • A hair band
  • Hot melt glue gun

2.Assembling the hardware

Welding the light panel

Weld DIN, VCC and GND on the first light panel to DOUT, VCC and ground on the second one. Then weld the wires to DIN, VCC and GND on the second light panel.

Printing the Shades (* optional)

3D printing files can be downloaded here:

Choose the right size and adjust the model height to adapt to the lamp plate.

Here I chose the diameter of the lamp as the width, and I adjusted the height by 2cm.

Assemble Everything

First, turn on the hot melt glue gun to warm it up.

Take out the CurieNano

Install the velcro on Curie(Be sure to expose the MicroUSB interface)

Then glue the hair band and LED light panels together with hot melt glue gun.

Install the 3D-printed shade

Reinforce on the edge of the shade with holt melt glue

Add velcro around the battery

Fix the battery onto the hair band with velcro

Connect the CurieNano development board on top. And connect the green cable on the LED to the D2 connector on the development board. The red VCC cable should be connected to the 5V and the black GND should be connected to the GND. The battery should be connected to the BAT and the battery should be connected to the GND.

All is done.

3.Upload the code

Download and install the library

First, let's download and install the corresponding library:

  • CurieNeurons Pro
    • You can find it in CurieNeurons Kit, or purchase it in MakerCollider.
  • Adafruit_NeoPixel
    • You can find it in the Arduino library folder

Upload the code:

The source code can be downloaded here:

Upload the code to CurieNano if you've already installed the libraries.

4.Curie learning

First we need to know how we want to light up the LED in different conditions.

In the program we defined the following by default:

When identified as action 1, the light flashes in all colors;

When identified as action 2, turn off all the lights;

When identified as action 3, the white disc turns on.

Further, we set:

Turn your head right as action 1;

Turn your head left as action 3;

The straight forward position as action 2;

Now, all is ready for curie to learn.

Start learning

First, Connect the computer to CurieNano and open the serial monitor in Arduino.

The following shows that the calibration is in progress. When the calibration is done, we can proceed to the next step

Note: At the bottom and on the left of the baud rate, select the newline:

Then, find a model. When she put her head straight forward, enter 2 and send.

Then let her head turn left. Enter 1 and send.

Ask her head turn right. Enter 3 and send.

Here we basically finished the first-round learning. Every time after the completion of learning, we'll immediately receive the feedback.

It is recommended to learn more than three times. Then you're done.

5.Test the results

Let the model wear the hair band and follow the music to do some actions ~

It seems really nice!

Technical Analysis

How could CurieNano recognize the actions?

CurieNano's Curie chip built-in accelerometer and gyroscope enable us to get and use these data to learn and do the identification.

About Accelerometer and Gyroscope

Accelerometers and gyroscopes are commonly referred to as "Motion Sensor". In Genuino101, accelerometers and gyroscopes are embedded in a unit of the Curie module and no additional connections are required. It has a special name called Inertia Measurement Unit (IMU) inertial measurement unit and it's also known as attitude sensor.

Curie's movement is three-dimensional, so three axes are needed to get the movement of Curie's three axes. Note that the base of the three axes here is Curie, that is, the three axes of the sensor are parallel to Curie.

The accelerometer measures the acceleration of the three axes, not just the acceleration of gravity, but also the acceleration of motion. But we often measure the acceleration at rest, and the acceleration of gravity is measured at this time. The acceleration here is not only a size of the amount, but also a direction of the amount, that is, the vector. By measuring this vector, it is possible to determine whether Curie is at a stationary or uniform linear motion. The condition is whether the size (modulus) is 9.8 m / s ^ 2 or the magnitude of the gravitational acceleration g. If its size is 9.8 m / s ^ 2, then Curie is in a static state or a uniform linear motion state. At this time, through the direction of its judgment, we can know Curie's attitude.

The three-axis gyroscope measures the angular velocity of the three axes of the Genuino 101, which is the speed at which the Genuino 101 changes about its three axes. The unit is typically dps (degrees per second) or rad / s (radians per second). If the phone is not moving, the angular speeds of the three axes are zero.

To put it simple, we can use the attitude sensor data in Genuino 101 to determine the current motion and posture of the current Genuino 101, triggering the corresponding program order for a particular movement and attitude.

In a more advanced way, we can also use the neural network in Curie to study and identify the data of the attitude sensor to start a specific program order, which can eliminate the cumbersome programming steps for gesture recognition.

Where can I modify the light effect?

In the following code, we define a function that is specifically used to evaluate the identified classifications. You can modify it if you want:


void OOLED()



theaterChase(strip.Color(127, 127, 127), 50); // White



for(int i=0; i<strip.numPixels(); i++) {

strip.setPixelColor(i, 0);







All Posts

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!

OKSubscriptions powered by Strikingly