El Wire T-shirt, Connected to a LightBlue Bean

Cody Matthieu
Octoblu Engineering
5 min readApr 24, 2017

How to create a custom IoT shirt, by using a LightBlue Bean, to light up the shirt’s El Wire graphics!

Hardware components:

  • Punch Through LightBlue Bean
  • C.H.I.P. Approved 3.7 V LiPo Battery
  • SparkFun Solder-able Breadboard: I used a Double-sides 4cmX6cm generic Solder-able breadboard Protoboard Circuit Fibre Glass PCB Board
  • Pocket Solder — 60/40 Rosin Core 0.031" diameter or any type of generic solder
  • 2 Male Header 40 Position 1 Row (0.1")
  • 5 Power MOSFETs (N-Channel)
  • 5 Resistors (10k ohm)
  • Jumper wires (generic)
  • AA Driver With Constant On & Blink Modes

Getting Started: Hardware

  1. Solder the headers to the board so that the pins plug straight into the Bean.
Step #1

2) Plug in and line up the Mosfets so that they line up straight down the middle of the bread board.

Step #2

3) Bridge the grounds of each “source” of each Mosfet together with solder and then wire that connection to the header pin that will plug into the ground pin on the Bean.

Step #3

4) Next you will want to solder the jumper wires that will be connected directly to your t-shirt or El wire panel.

Step #4

5) Use jumper wires (on the bottom of the board) to connect each of the Gains of each Mosfet to a different PWM output on the board. Because the Bean only has 4 total PWM outputs and my el wire panel requires 5 total inputs; I had to solder two of the orange jumper wires together to join the two different outputs. Thankfully, it works!!!

Step #5

6) Please refer to the picture (below) for further instructions to complete this step. If you get confused you can also refer to my last right up I did here on Hackster where I used my t-shirt to connect to Octoblu by using Redboard and Jonny-Five! Link: https://www.hackster.io/octobluintern/el-wire-t-shirt-connected-to-octoblu-47e283

Step #6

7) In this step we will be hacking a regular driver/ inverter used to power an el wire strip. The inverter I am using is provided above in the “Things” category of this right up. As before, the green wire I am using is for power and the black jumper cables will be the grounds. In this step you will want to soldered the ground wire to the GND connection on the board. The power will be plugged directly from the power on the shirt, straight to the power line of the shirt.

Step #7

8) Finally, those orange wires we wired before from the Mosfets, will be also plugged directly into the remaining ports on the strip of the shirt!

Getting Started: Software

Step #1

1) We will first begin by flashing the Bean with Firmata by importing a Firmata library. You can do this by going to Examples -> Firmata -> StandardFirmata to find it.

2) Flash the board

3) Now you will want to Create a new sketch by going to File, New (for new sketch)

4) Copy and paste my example provided below. In this example, the code is looped by turning on each pin of the shirt or section of the panel and then turning each one off.

void setup() { 
pinMode(2, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
}
void loop() {
Bean.setLedRed(30);
delay(2000);
Bean.setLedRed(0);
blink();
}
void blink() {
analogWrite(7, 255);
delay(300);
analogWrite(6, 255);
delay(300);
analogWrite(5, 255);
delay(300);
analogWrite(2, 255);
delay(300);
analogWrite(7, 0);
delay(300);
analogWrite(6, 0);
delay(300);
analogWrite(5, 0);
delay(300);
analogWrite(2, 0);
delay(1000);
}

Side note: Since, the LightBlue Bean is connected via Bluetooth you can also send your Bean post notifications to trigger certain events depending on how you set up your sketch! I will demonstrate this in another example I will provide below this note!

AncsNotification notifications[8]; 
void setup() {
// put your setup code here, to run once:
BeanAncs.enable();
pinMode(2, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int msgAvail = BeanAncs.notificationsAvailable();
if (msgAvail) {
BeanAncs.getNotificationHeaders(notifications, 8);
bool notify = false;
for (int i = 0; i < msgAvail; i++) {
if (notifications[i].catID == 1 || notifications[i].catID == 2) {
notify = true;
}
}
if (notify) {
Bean.setLedRed(30);
delay(2000);
Bean.setLedRed(0);
analogWrite(7, 255);
analogWrite(6, 255);
analogWrite(5, 255);
analogWrite(2, 255);
delay(5000);
analogWrite(7, 0);
delay(300);
analogWrite(6, 0);
delay(300);
analogWrite(5, 0);
delay(300);
analogWrite(2, 0);
delay(1000);
}
}

5) After you created your sketch save it and then upload it.

6) Nexly, you will want to download the “Bean Loader” application onto your machine. This is an important step because this is how you will upload your sketch directly to your bean!

If you get stuck please visit this link for help connecting your Bean to the “Bean Loader” application:

https://punchthrough.com/bean/docs/guides/getting-started/os-x/

7) Done! And there you have it, your El Wire shirt is now connected to the internet using a LightBlue Bean! Thank you for your time and have fun experimenting with your new light up t shirt!!!

Happy hacking everybody!!!

--

--

Cody Matthieu
Octoblu Engineering

Octoblu Intern, IoT is the future! Check out my fashion brand @ Navajomermaid.com