Introduction: ETextiles With the Intel Edison

About: Specializing in sewing, soldering, and snacking.


eTextiles are made using techniques and materials that make it so electrical components can be embedded and integrated into fabric. It's an essential part of wearable technology and a perfect way for crafty people to dive into electronics and vice versa. These projects can be made with any microcontroller that has WiFi capabilities and can be programmed with JavaScript.

This Instructable will go over how to setup up your Edison and gives you 3 projects to choose from. Three different eTextile mediums are introduced:

  • conductive thread
  • conductive paint
  • conductive yarn

All three projects use the Intel Edison and take advantage of it's capability for wireless communication. Before going off on a project adventure, take a look at the next step for setting up the Edison.

Choose from these three projects:

Step 1: Setting Up the Edison

Any web enabled microcontroller can be used for these projects. Here I am using the Edison, a linux embedded microcontroller with GPIOs created by Intel.

All the projects are written in JavaScript, with a little bit of HTML. I am a beginner myself in this language and found it easy to learn and manipulate. Being a beginner also makes for clunky code, so if you are a whiz and would like to improve and contribute, that would be fantastic and much appreciated.

The Edison Arduino breakout was used because it was accessible at the time. However, since these are smaller projects, the mini breakout may be a better choice.

There are overlapping steps for all three projects, so instead of reiterating I have put them all here in one step.

Getting Started

1) If you haven't already, head over to Intel's "Getting Started" page for the Edison. Go through all the steps to connect through serial, enable WiFi and download the Intel XDK IoT Edition.

2) Go through the Blink demo that is linked on the "Getting Started" page. Afterwards, click next and go through the "Creating and debugging projects using the Intel® XDK IoT Edition". I recommend going through the whole XDK guide, but these two will give you enough to move forward.

3) You will need to use a command-line interface to talk to, transfer and manipulate files on your Edison. For Windows, this will be PuTTY, Macs use Terminal. I use both, so I'm going to refer to this as a command-line interface, or CLI from now on.

Going Wireless

Going wireless is very cool and very easy. When you know the board is connected to the network, SSH in using it's IP address. PuTTY has text fields you fill in with your IP, root and password, otherwise type this in a CLI window.

ssh root@Your.Board.Address.here

Power the Edison with a 9 volt battery or plug in a power adapter that supplies 7.5, 9v or 12v, I've seen people use up to 1500 mA with the Arduino board, don't go any higher than that. Communicating with board? check. Powered? check. Now unplug the USB cables and your board is free.

Now that you are wireless, you can upload all your applications this way. Make sure that your computer is on the same network as the Edison before you try doing that.

Moving Files to the Edison

There are two ways to move your JS applications to the Edison.

1) Import or copy and paste your code to a blank template in the XDK, upload and run from there.

2) Use a FTP client to transfer files over to the boards root directory (you should be dropped there automatically after logging in). For Windows I use WinSCP, Cyberduck is good for Macs.

Step 2: Web Controlled LED Matrix

Learn how to hand sew an LED matrix and control it remotely from a webpage. It consists of 36 LEDs and uses the MAX7219 LED driver chip. The LED matrix makes up the screen of a retro T.V. embroidery design.

The Edison acts as a server which hosts a simple HTML page that has 36 buttons, corresponding to each LED. When a buttons is clicked, it's LED mate will turn on. Hit the Reset button on the page to turn all LEDs off. This allows you to draw whatever design you like. I didn't get to it, but I think a white noise button would be pretty cool.

This is a great project for getting started with socket.io and click events used to control hardware. As well as getting comfortable sewing with conductive thread and controlling LED matrices. This one may look a little tedious, but I promise it's quicker than it seems. If you really like meditative hand sewing and are decent at it, I encourage to go even bigger with the matrix.

Materials

[1] 7" Wooden embroidery hoop

[1] MAX7219 LED display driver

[1] Intel Edison : Mini or Arduino breakout

[12] Crimp pin pairs : male and female

[1] Bobbin of conductive thread

[5] Stranded jumper wires

[1] 9 volt battery

[1] 9 volt battery snap

[1] Skein of embroidery floss (color A) : screen, antenna and legs.

[1] Skein of embroidery floss (color B) : T.V. body and dials.

[18" x 18"] Cotton muslin or other medium-weight fabric to embroider on. It should be a med-high thread count, not the cheap, mesh-like variety.

[5" x 5"] White cotton fabric

[5" x 5"] Batting

[7" x 7"] Carbon tracing for fabric

[7"] White sticky-back velcro

[4" x 4"] Craft felt

[18"] small diameter heat shrink tube

[40] 3mm LEDs : 36 for matrix + 4 extra

[1] Flex Perma-Proto board (or any perforated board with printed traces)

[12"] 10+ conductor ribbon cable

Fabric glue

Masking Tape


Tools

Pencil

Embroidery needle

Scissors

Ruler

Needle nose pliers : preferably round

Printer

Soldering Iron

Multimeter

Step 3: Print, Trace and Stretch

Print out the attached file, it contains the T.V. design mirrored, so you can choose which way you like best.

Cut a square of muslin big enough to fit in the hoop with some extra around the edges. A 15" x 15" square should be more than enough for a 7" hoop.

Place the carbon paper chalk side down with the printed image on top and tape down. Start tracing with a blunt tip pencil. Use a ruler if it becomes difficult to trace the lines straight.

Lift up the paper to check to see how well the image is transferring, the lines will be covered up with fabric and thread, so make it as dark as you need. Put the print aside, it will be used later.

Once done, load the fabric in an embroidery hoop image side up.

Step 4: Prep LEDs

In order to sew the LEDs down, the legs need to be curled up to make holes to sew through. Don't worry, this part goes faster than it seems. When I was in my groove it took 20 mins to curl the legs on all 36 LEDs.

Take an LED and split the legs straight apart from one another. Take the needle nose pliers and start curling from end to base, making the holes about 1/8" in diameter.

The negative and positive side of the LED needs to be identified before sewing down. On the 3mm LEDs the negative side of the LED can not be identified once the legs are curled, but there is another way to tell. If you look into the LED lens you can see the posts extend up, there is a thick and thin side. The thick side is called the anvil, this is attached to the negative lead. If this gets to be hard on the eyes, mark the negative side before curling it with a permanent marker or some tape on the lens. Another way is to test the LED with a 3 volt battery when you get to the sewing step. I looked in to the lens to find out and felt that it was easy and painless for me.

Step 5: Sew Columns

Before the sewing starts, let's go over three important things to keep in mind. The photos illustrate where and how to stitch the matrix, so check those out and use them as the main reference.

1) The LED leads should be placed in the middle of the line segment for each grid square. They are a little tight, so placing them correctly will help ensure there are no shorts while sewing.

2) Where the sewn columns and rows intersect, the conductive thread can not touch. This is accomplished by sewing the thread for the columns on top of the fabric and the thread for the rows on the bottom. The fabric acts as a barrier between the two paths.

3) The LED matrix is connected to the MAX7219 chip by crimp pins to each row and column. When sewing each make sure to leave a tail long enough for the pin to be crimped on, this only needs to be done on one side.

Sewing Columns

Cut about an 18" piece of conductive thread and make a knot 4" from the end. This length will used for the crimp pins.

Start at the top of one column and make a small stitch. Turn the hoop around and tape the long end so it's out of the way.

Next, push the needle through (from bottom to top and under the intersection) at the halfway mark of the next line segment and thread one side of an LED on. Make sure that the column leads are either all negative (cathode) or all positive (anode). It doesn't matter which one, either orientation can be worked with in the software. Once the LED is threaded on, make a small and tight stitch over the curled lead to secure it down. Stitch around the lead, making at least 3 stitches and keeping the stitches tight. The connection needs to be secure and not wobbly.

After the lead has been secured, bring the needle back up halfway through the next line segment and thread on the next LED. Keep going until you reach the end of the column and finish it with another small stitch. Knot on the backside. Knotting can be tricky, in the next step I will show an easy way to get close to the fabric and secure the thread.

Step 6: Knot and Glue

To make a knot close to the fabric all that is needed is a sewing needle. Make the knot and place the point of the needle in the middle of it. Pull on the thread to tighten it and it will slide down to where the point hits the fabric.

The stainless steel conductive thread is great because it doesn't tarnish, but it's also very springy and doesn't like to hold a knot. That's where glue comes in. Test some on the fabric you are working with to make sure that it won't seep to the other side and create a dark spot.

Step 7: Sew Rows

Time to finish sewing the matrix! The LEDs will already be in place, so this half goes quicker.

Like the columns, start with a small stitch. Come up through the LED lead and stitch it down. End with the thread coming from above the stitched lead and continue towards the next LED. Going over the intersection.

Pierce the needle down close to the lead and come back up through the loop and secure with small stitches. Continue down the row, going over the lead of one LED and under the lead on the next. Use the pictures as your guide.

Knot at the end of each row and glue to secure.

Step 8: Test

Take the multimeter and flip it to the continuity setting. Hold one lead to a row and go up all the columns, checking for any shorts.

If your multimeter gives a beep look for any stray hairs that may be touching it's neighbor.

Step 9: Time for T.V.

Screen

The screen of the T.V. is made of a small square of white cotton and some batting. Cut both using the printed screen image.

Take fabric glue and run it over the raw edge of the white cotton fabric to prevent it from fraying. Let dry.

Place batting and then the cotton over the matrix and pin.

Thread about 18" of color A embroidery floss to start sewing the outline of the screen.

Sew the first row 1/16" - 1/8" from the white cotton fabric's edge using a backstitch. Use color B to sew a second row outside of the screen, covering up more of the fabric's edge as you go.


T.V.

Continue using the backstitch to embroidery over the T.V. design. Embroider each outline as illustrated in the photos.

Step 10: Build Circuit

The flex proto-board is a little too large for the project.The awesome thing about these is that you can easily cut them down. Fit the IC on the board and trim it down to size.

Solder up the power, ground, caps, Data, Clock and CS pins as shown in the diagram. I used the Edison Arduino breakout, so I soldered on jumper cables with headers to plug into the headers on the board. Make these connections from the MAX7219 chip to the Edison:

GND Pin 9 and 4 --> Edison Ground

DIN Pin 1 --> Edison D12

CS Pin 12 --> Edison D10

CLK Pin 13 --> Edison D11

V+ Pin 19 --> Edison 5V

Why Use Crimp Pins?

Modularity is a huge plus when working with eTextiles, it makes it easier to troubleshoot and back up to steps. They are also a good solution for connecting conductive thread to wire, while there is conductive thread you can solder to, it's not readily available... yet (working on helping that along).

There are lots of different kinds, the ones pictured here are my favorite.

To properly attache them it's best to invest in a crimper. Get one that is as thin as they come so you can get into small spaces. If you do not have a crimper around or want to wait, needle nose pliers can be used, but they won't make as good as a connection.

Attaching Crimp Pins

As shown in the photos, slip the thread down the center of the crimp and hold in place. With the other hand take the pliers and clamp one side of the metal wings down, then do the other side. It can be a bit tricky at times, another reason to use a crimp tool. The ultimate goal is to squeeze down hard to trap the thread so it can't slide out.

If using a crimp tool, put the pin in, wings up towards the pointed side of the crimper and clamp down.

Attach female crimp pins to all 12 thread ends, 6 rows and 6 columns. After crimping, give the connections a good coating of glue to secure.

Strip down your ribbon cable to 6 conductors and attach 6 male crimp pins to one end. Connect that end to the columns and eyeball the length you need to solder to the board, leave room for stripping for soldering! Cut and wire it as shown in the diagram.

Crimp male pins on one end of the remaining ribbon cable and do the same for the rows.

Lastly take some heat shrink tubing and cover up the connections and length of the female pins. So, if they end up crossing each other, they won't short.

Step 11: Upload Application

A Node.js application is what allows you to control the matrix from a webpage. Before using Node, you need to install some dependencies. SSH into your board (if you forget how, check the Setting

To install Node connect to your board and type in PuTTY.

opkg install nodejs

To control the matrix specifically, the framework Johnny Five is used, which needs to be used in conjunction with the edison-io library.

npm install johnny-five edison-io

Then install the express framework and socket.io library.

npm install express socket.io

Download the attached files and open them in a text editor, change the following lines accordingly.

In index.html put your board's IP here with port number.

var socket = io.connect('http://192.555.1.0:3000');

In matrixFinal.js, change the very last line to match the chosen port.

server.listen(3000); 

Save and upload to Edison. Do this by either downloading Intel's XDK and creating a new project using blank template. Or SSH into the Edison and transfer the files using an application like WinSCP. Upload them to the root directory, which you should be automatically dropped into once in.

With these methods, you only need to connect your Edison to a network once and find out it's IP address through a serial connection. Afterwards, power the Edison with a 12 volt wall adapter and SSH in from now on to keep it wireless.

Go to a PuTTY window and run the application.

node matrixFinal.js

Go to your board's address in a browser followed by the port. Example : https://192.555.1.0:3000

If the webpage does not open, check for any errors in PuTTY's console. A good place to troubleshoot is on Intel's forum, or feel free to comment below with any issues.

Click a square on the webpage, it will turn orange and the corresponding LED will light up in the matrix. Click the reset button to turn all of them off. You can now control the whole matrix wirelessly using a webpage!

Step 12: Texting Textile

Gather Materials

[1] Edison or any other web-enabled microcontroller

[1] Adafruit monochrome 128 x 32 OLED display I2C

[1] Adafruit MPR121 12-key capacitive touch breakout

[1] Adafruit flex proto-board

[1] 9 volt battery

[1] 9 volt battery snap

[12] crimp pin pairs

[1] 3mm green LED

[1] 3mm red LED

[1] Mini slide switch for on/off

[1] 50 ml jar of Bare Conductive paint

[1] sponge

[1/2 yard] broad cloth

[2] 3mm eyelets with eyelet setter

[6] inches of sew-on velcro.

[1] Bobbin of conductive thread

[12] Sew-on snaps size 1/0 (3/8")

[1/4] Yard fusible interfacing

[1/2"] Thick foam : at least 4.5" x 6"

[several] Felt squares in fun colors : Main color + two accent colors

Matching thread

Masking Tape : the wider the better


Tools

Sewing Machine

Silhouette CNC cutter

Adhesive Vinyl

Awl

Multimeter

Step 13: Cut Keyboard Design

Time to get out the Silhouette cutter and sticky back vinyl. Use the designs attached, or create your own. If you do want to make a custom one, choose simple designs, this will save you a headache while transferring them to fabric. Need some inspiration? Check out the lists of emoticons that I came across when doing research. There are SO many good ones. ( ‘-’)人(゚_゚ )

////////////////////////////////////////////////

Emoticon References

(ノ゚0゚)ノ~
(・.◤)
(づ。◕‿‿◕。)づ

/////////////////////////////////////////////////

If you are new to using a Silhouette, there are plenty of tutorials on the website. Check out the "blade adjustment", "cutting mat" and "vinyl" ones to learn the basics and how to work with the material used in this instructable.


Load

Cut a piece of vinyl larger than the keyboard design, mine is 5" x 9", and smooth in down onto the cutting mat. Load the mat, choose the preset vinyl cut settings and adjust the blade to length 2. Hit test cut and see if the vinyl peels off easily. If it does, hit cut for your final cut!

Transfer

Take an awl or some tweezers and take out all the large inside pieces of the stencil. Go slowly, sometimes the smaller pieces stick to the piece being removed and need to be held down.

Cut two 9" x 5" pieces of broadcloth and set aside.

The sticky vinyl stencil needs to be moved from the paper backing onto the fabric. To do this, take some masking tape and smooth it over the top of the vinyl. Flip the vinyl over so the paper backing is on top and start slowly peeling it back. All the vinyl pieces should stick to the tape, sometimes they need coaxing, so going slow is a good idea.

Phew! This part is the most tedious, which is why simple symbols are the best. The emoticon designs are fairly complicated designs, but worth it in the end.

When all of the designs are transferred to the tape, it's time to transfer them to the fabric. This is the same method, except the tape will be peeled off like the paper was.

Smooth the fabric over the vinyl and give it a good rub. Start peeling back the tape and hold down any designs that want to go with it with your fingertips or a flat edge, like the short end of a ruler. If any small bits give you trouble, they can be taken off and applied to the fabric by hand.

Step 14: Paint on Fabric

**Cu Pro-Cote is used in the photos, however it later ended up tarnishing too much over time. This is why Bare Conductive was chosen as the final paint to use.

Cut a 6" length of conductive thread and make two small stitches in the lower left corner of the each key character. The paint will be sponged over the stitches, making the connection between the conductive paint and the thread.

Pour a bit of conductive paint in a cup. Mix it with a little of fabric medium if you like, it works well on it's own too.

Use a small piece of a sponge to sponge on the conductive paint. Sponge on until there are no empty spaces on the fabric, this will take a few passes.

Remove the outside of the stencil before it dries completely, the paint likes to dry into a skin, so when you peel the stencil off the paint may come with it. Wait until it has dried completely to take the smaller inside piece off. Using tweezers or an awl will help remove them without scratching or damaging the paint around them.

Step 15: Quilt and Cut Keyboard

Instead of hard and smooth buttons, I wanted soft, springy ones. Which created a perfect opportunity to quilt the keyboard.


Quilt

Put a thin piece of batting between the two pieces of broadcloth.

Trace the keyboard pattern piece on the top, printed piece.

All the conductive thread lengths coming from the keys need to be threaded through the batting and bottom fabric. Do this by placing the top piece on the bottom and using chalk to mark where the stitches hit. Thread each length and pierce through the batting and through each of the markings until all 12 are done. You will be left with a batting and broadcloth sandwich.

Pin all three pieces together.

Start sewing along the horizontal lines between the rows of keys, keep the thread tails long (about 5") when taking it out of the machine. Next, sew the smaller vertical lines between each keys. Backstitch at the end of each stitch line. Stitch the traced outline last.

You will be left with single threads on the top of the quilted keyboard. To secure these, thread them to the bottom and knot off with the bottom thread.

Take your fabric scissors and cut 1/8" from stitch line and use fabric glue to seal the edges.


Sew Snaps

This keyboard is not only soft and squishy, but also removable! It can be snapped on and off from the body. Use the conductive threads coming from the bottom to sew on the male half of a snap to each key.

Step 16: Cut Pattern for Body

Cut

Download and print the attached pattern.

Main Color
1 x FRONT
1 x BACK
1 x CLOSURE FACING

Accent 1
1 x SCREEN

Accent 2
2 x LED

Fusible Interfacing
1 x FRONT
2 X BACK

Iron the fusible to the front and two backs.

Attach OLED

Except for the screen, I wanted all the hardware to be modular, meaning I wanted it to be able to detach from the soft body and be taken apart. If you want that too, solder some male headers on the screen, if you haven't sone so already. A cable will be made for it later.

Take the OLED display and draw out where you want the screen to be. It helps to trace the SCREEN piece for reference. The screen dimension to cut is 3/8" x 1".

Pin the LED pieces to the screen and sew, then pin the SCREEN down and sew that to the body.

The OLED board conveniently has 4 holes on each corner. These are for screw mounting, but they are great for sewing through.

Double up some regular thread, or grab a thicker thread and sew through each of these holes 3 times.

Add Eyelets

Decide where the 3mm LEDs want to go and use the awl to punch a hole through the felt. Push the eyelet through from front to back, flip over and use the setter to hammer it in place.

Step 17: Attach Snaps + LEDs

Snaps

Back to hand sewing. Flip on favorite show or put on an audio book and thread the needle. The time will pass by faster than you think.

First the position of the snaps need to be marked. Cut a piece of paper, flip your keyboard upside down and press the paper on top until there are little indentations. Puncture each indentation with the awl and you have a stencil for where the snaps should be! If your snap placement is asymmetrical, check to see if the paper is the right way around before marking.

The markings are the center of each snaps. Sew the remaining 12 female snap halves. Leave a 2" tail after knotting!

LEDs

Solder two wire leads to each LED.

Cut small squares from some scrap felt and use the awl to puncture a hole big enough for the 3mm to push through. Glue the back of the LED to the felt piece. Now you can put glue on the felt piece all around the LED and use it to attach the LED to the back of each eyelet.

Step 18: Build Circuit

Crimp pins are one of my favorite things to use when making eTextile projects. They solve the problem of thread to wire connection and make things modular!

Crimp Pins and MPR121

They are used to connect the MPR121 breakout to the body of our device. This is what the 2" tails are for, each of these tails get the female socket side of a crimp pin. Pliers can be used, but are trickier and do not make a correct connection. However, you can crimp tight enough to make them work and glue will be used to strengthen the connection later. If you have a crimp tool, great! Use that.

Crimp the females to the snaps and the male halves to the ends of some ribbon cable. Afterwards apply glue and heat shrink tubing to secure and insulate. The other end gets soldered to the MPR121 breakout board.

OLED Cable

To stay with the modular theme, I made a cable with female headers that will attach to the screen. You are welcome to solder straight to it. To make the cable, solder female headers (right angle if you have them) to the end of 3", five conductor ribbon cable. Gently bend the metal pins to make a right angle if you don't have any.

Following the diagram, wire up the rest of the hardware. I gave the MPR121 it's own felt raft, this way it can be easily sewn or glued to any part of the body.


Step 19: Sew Body

The 1/4" seam allowances are marked on the patterns.

Sew the two SIDE pieces together, the seam becomes your top center marking. Starting from the top center, pin the sides around the FRONT piece, there will be an overlap at the bottom. Sew all around with a 1/4" seam allowance.

Turn inside-out and cut a piece of foam using the pattern piece of the same name.

Plug in the MPR121 and OLED boards. Throw in some fluff and add the foam, pulling the hardware through the middle. Now is the time to place the ON/OFF switch. Make a small incision on the top to the right for the toggle lever to slip through. Glue from the back to secure, it will be between the foam the the felt, the foam gives some structure making it easier to switch on.

Cut and sew the BATTERY HOLDER pattern piece and hand sew it to the inside right side of the body. A part of the foam frame will need to be cut into to make room.

Sew the CLOSURE FACING on, clip the curves so they are nice and smooth when turned inside-out. Leave an opening where marked for access to the USB ports on the Edison. If using another board you will probably need to move this opening to match what you have.

Next, sew the BACK on, the seam allowance of the BACK will meet the seam allowance of the CLOSURE FACING. Clip the curves and turn inside out.

Stuff the circuit inside, use the fabric rafts to sew any of parts of the circuit down. Hand sew some velcro to the facing and the back on the bottom. This makes the closure and the body complete! Snap on a 9 volt battery and slip it in the pocket. Close the back and switch it on. The red LED should go on, peak inside to see if the board turns on and wait a minute for the board to boot up.

Once it does it should automatically connect to the network if you have already done so. If it does not, plug it in and connect through serial, then SSH in and unplug. This is gone over in the Setting up the Edison step.

Snap on a keyboard and you are ready to upload some code.

Step 20: Enable I2C Pins

The I2C pins should work out of the box with the Edison, however I've had them disable while prototyping other projects and have had to enable them again. If the MPR121 board is not working, download the Edison hardware guide and follow the instructions on how to enable the I2C pins.

Step 21: Upload Application

Test Cap Keyboard

Intel has a MPR121 example you can find on their Github page. This is perfect for a testing the connections and circuit of the keyboard before uploading the final code. To use it, copy the example code, go into the XDK and click on Start A New Project in the lower left hand side and choose the Blank template. Name and create the project and Paste the code in main.js. Upload and Run. The console will print out "Buttons Pressed:__", filling in which number of button is pressed.


Upload Final Code

To send texts, Twilio, a cloud based application is used. So, if the board is connected to a network, you can send texts. It's free to get a trial account and you can send many texts with the trial. Head over to their website, sign up and get a Twilio phone number. Once signed up you get API credentials. Go to your account page and write down your AccountSID and AuthToken.

Download and open textingTextileEmo.js. Open up Intel's XDK, click on "start a new project", choose blank template and paste the code from textingTextileEmo.js. Build, upload and run. Plug in your AccountSID, AuthToken, phone number you want to send texts to and your Twilio number, following this format "+11235557766".

var TWILIO_ACCOUNT_SID = 'TWILIO_ACCOUNT_SID'
var TWILIO_AUTH_TOKEN = 'TWILIO_AUTH_TOKEN' <br>
var OUTGOING_NUMBER = 'RECEIVING NUMBER' 
var TWILIO_NUMBER = 'TWILIO NUMBER'

Connect the board to your computer, open PuTTY and install twilio and Node.js on the Edison.

npm install twilio nodejs

To text unicode emoticons, install the unicode 8.0 library

npm install unicode-8.0.0

Each emoticon is printed using it's unicode hex code. It's put into a variable, then pushed to an array called messageString.

var aString;
var bString; var cString; var dString; var eString; var fString; var gString; var hString; var iString; var jString; var kString; var lString; var joinedMessage; var messageString = new Array()

Read all 11 cap keys

for (var i = 0; i < 11; i++) {
if (touchSensor.m_buttonStates & (1 << i)) { outputStr += (i + " "); buttonPressed = true; //read the buttons to see if any are pressed

If a key pressed, print in console, push to messageString and display on OLED.

if (i == 0) {
jString = "\u0298\u203f\u0298"; //smiling open eyes messageString.push(jString); console.log(jString); led.write(1); }

The code above prints the smiling emoticon when the 0 key is pressed.

When you look at other emoticons you will find the unicode hex code formatted like U+1F601. This needs to be changed to \u1F601 for it to work in the JavaScript code.

if (i == 8) {
joinedMessage = messageString.join(""); //join all the emoticons pressed into one string console.log(joinedMessage); led.write(1); client.sms.messages.create({ to: OUTGOING_NUMBER, from: TWILIO_NUMBER, body: joinedMessage },

If key 8 is pressed, join all the strings, print in console, create an sms and send.

Step 22: Send a SMS!

Press the keys, the green LED will flash on with each one and the emoticon will be displayed on the OLED screen.

When the SEND button is pressed (key 8 in the example code), the SMS is created and sent. It sometimes takes a couple minutes for it to arrive.

Step 23: Musical Textile

Gather Materials

[1] Package of 14 ct. 15" x 18" cross stitch fabric

[1] Bobbin of conductive thread

[1] Sewing needle

[1] 7" Wooden embroidery hoop

[1] Spool of conductive yarn

[1] Skein of medium weight yarn in favorite color

[1] Intel Edison Arduino Breakout

[1] USB external sound card : There are shorter ones you can buy if the cord bothers you.

[1] Quarter sizePerma-Proto board (or any perforated board with printed traces)

[1] 9 volt battery

[1] 9 volt battery snap

[1] Sheet of craft felt

[10"] Ribbon cable : 7 conductors are needed

Fabric Glue

Tools

Pencil

Ruler

Scissors

Iron

Sewing machine

Step 24: Cross-stitch Switches

There are four twisted pleats that act like switches. The twist gives just enough tension for the switches to spring open after then have been pushed closed. A switch consists of two contacts made of conductive thread. One contact is sewn on the side of the pleat and the other is right next to it on the flat part. The cross stitches need to be made before the pleats are made, to know where to stitch use a pencil or some chalk to create guidelines.

Iron out the fabric and grab a ruler and pencil. If there is a right side to your fabric, flip it so the markings are on the back.

Mark the top of the fabric 1" parallel from the raw edge. Print the cross stitch pattern out and use it as a guide. Each square of 10 squares equal 1".

Cross-stitch each contact until all 8 are done. Keep the thread tails long, at least 6". These will be sewn to the perf board later. If you have never seen a cross-stitch pattern before, here is a nice description of how to read one. Notice that the cross-stitches for this project are larger than one square, they are 2 x 2 to make the contacts larger.

Step 25: Setup Sound Card

Go ahead and plug the sound card into the standard size USB port. Flip the mini slide switch towards the standard port and away from the micro ports. This puts the Edison in host mode and you can now access your sound card.

When the Edison is in host mode the Edison's serial connection and power through the micro USB is disabled. Instead, you will need to communicate with your board by SSHing in and power it by the barrel plug or a battery.

It's very easy and feels pretty awesome when you are able to load applications and communicate with the board without wires. Go back to the Setting up the Edison step for more on how to go wireless..

Head over to Alex_T's webpage and follow the instructions on how to set up ALSA and your sound card. When going through his steps, if you have trouble downloading the alsa-utils package, use these commands instead.

wget  ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.0.29.tar.bz2 && tar xvf alsa-utils-1.0.29.tar.bz2 && cd nano-2.2.6 && ./configure && make && make install</p>

The sound card I used had a long tail, to make the tail blend in with the piece I wrapped it with some left over yarn. The knotting technique is the same as a hair wrap, anyone remember those?

Step 26: Pleat Embroidery Fabric

Fold each pleat on the appropriate line and iron to set. Make sure any markings are towards the back of the piece. Pin and sew, keeping the conductive thread ends from getting trapped as you sew.

Twist the pleats and pin like in the photo. Sew the pleats down on both ends about 3" from center line. Use matching thread so it blends in.

Step 27: Make the Pom-pom

This pom-pom isn't just cute, it's functional! The conductive yarn creates two rows in the pom-pom, when squished, stroked and tousled those two rows touch, closing the switch.

Cut a 6" length of neutral yarn and set aside. Download and print out the pom-pom making template. Trace and cut it out of card stock.

Pick up your yarn and wrap as directed below:

30 neutral

30 conductive

30 neutral

30 conductive

30 neutral

Thread some conductive yarn onto a needle and thread some around one bunch of wraps. Knot and cut one side, leaving the other about 6" long. Do to the other side.

Take some glue and slather it on the underside of the wraps, on the inside of the template. This will help ensure that the two conductive yarn chunks will not touch in the middle. So, make sure that the two sides do not touch when gluing.

After the glue is dry, slip the point of your scissors between the two pieces of card stock and snip the tops of all of the loops. Grab the 6" length of yarn previously cut, slip it in between the two templates and tie it around the middle of the wraps. Keep track of the two different sides of conductive yarn, it's easy to loose them once the yarns start mingling.

Sew it down in the place indicated on the printed pattern. Thread the two conductive yarn pieces through the fabric and to the back.

Step 28: Build Circuit

The circuit simply consists of 5 switches (4 pleats and 1 pom-pom). They all get pull-down resistors, alternatively internal pull-up resistors can be activated through command line. Those instructions can be found in the hardware guide for the Edison board.

Solder the pulldown resistors onto a perf prototype board, 5 jumper wires to plug into the digital pins of the Arduino bb and 2 more for ground and power.

Use the tails of the conductive thread left over to sew through the traces on the perf board.

Use crimp pins to attach wire to the two yarn leads of the pom-pom. Solder the wire to the perf board.

Step 29: Upload Application

Download and open the sineTextile.js file. The JavaScript app uses the library Timbre.js, which is capable of many synthesized sounds. In this app, sine waves are being triggered. Change the frequency of the wave like this.

var sine1 = T("sin", {freq:440});

To use Timbre.js, you need to first install it on the Edison.

npm install timbre

Next install Johnny Five, the app uses it's button class, it also requires the edison-io library

npm install johnny-five edison-io

Use Intel's XDK to upload the application, or transfer it to your board. Run and plug in an external speaker or some headphones and play some music!