Introduction: Pimp Your Style

Intro:

Hello!

We are three CS students from IDC Herzliya, and as students, you know Gucci and Dolce clothes are not so available to us. By then, we have the passion to upgrade our fashion style to at least feel cool with what we have. Fortunately, we take an IoT course led by Zvika Markfeld from the ForReal Team, and we gained the necessary tools in order to "pimp our style". We will guide you through the construction of our "pimping kit".

Supplies

  • 2 x Adafruit Circuit Playground Express Boards
  • 2 x ESP8266 Board
  • 3 x Micro Servo
  • 1 x Laundry Folder
  • 14 x Alligator cables
  • 9 x Jumper cables
  • 1x External power supply

Step 1: The General Flow

The kit is designed to :

1. Help you fit your clothes' colors

2. Help you choose the clothes according to the future weather

3. Fold the clothes you decide not to wear!

The first Circuit Playground Express board is connected using the alligator cables to "buttons" drawn by pencil (to make the drawing enable capacitance). It runs a sketch that enables to scan your clothes' colors and decide for you whether those colors fit or not.

The second Circuit Playground Express board is connected to the 3 servos that are connected using chop-sticks and glue.

Both of the CPX boards are connected to ESP8266 boards, that enable wifi communication with a Blynk app that enables to control all the scenarios, and integromat scenarios.

Step 2: Setting the Environment

Arduino IDE

Install Arduino IDE.

Install relevant "drivers" for the ESP8266 boards to your Arduino IDE.

Install Blynk, BlynkESP8266 and Circuit Playground Express libraries

Integromat

Sign up to Integromat.

Blynk

Download the Blynk App from Google Play.

Sign up to Blynk via the App.

Step 3: Setting the Integromat Scenarios

For the color fitting scenario:

  • Go to scenarios -> Create new scenario
  • Choose Webhooks, and Android services
  • Choose the newly created module, and choose webhooks -> custom webhook
  • Click add and choose a name for your webhook
  • Click save
  • You can copy the address created by the webhook and post a request / get a request in order for the webhook to determine the data structure
  • Click tools -> switch and add a switch statement.
  • Add the input data as input for the switch statement and add conditions that will make an output as an informative string
  • Add Android module, by clicking Android -> send push notification. In order to connect android to integromat you have to enter the integromat app in your android phone and connect the phone from the app
  • Choose the output of the switch as body for the notification

For the weather scenario:

  • Create a new scenario as described above
  • Choose Webhooks, Weather and Android services
  • Create a webhook module as described above. Determine the data structure for the scenario using the supplied URL - it should consist of longtitude and latitude parameters
  • Create a weather module. Choose to enter location by coordinates and add add the longtitude and latitude as parameters
  • Add a switch statement. Make sure that for each pattern an appropriate message is shown (e.g for 20-29 Celsius - wear a T shirt!
  • Output a push notification to android as described above

Step 4: The Blynk Dashboard

In the Blynk app:

  • Create new project
  • Name it as you like
  • Choose ESP8266 as device
  • This project will serve as the dashboard for clothes fitting sketch
  • Add the following widgets:
    • Webhook
    • 2x Button
  • Tap the webhook widget and insert the webhook URL that you got from integromat
  • Connect the buttons to Virtual pins according to BlynkConfig header
  • Create a second project
  • Name it as you like
  • This project will serve as the dashboard for the clothes folding + weather sketch
  • Add the following widgets:
    • webhook
    • GPS
    • Button (for Fold)
    • Value Gauge
  • Tap the webhook and insert the webhook URL that you got from integromat (for weather scenario)
  • connect the button, value display and GPS according to BlynkConfig header (uploaded later)

Note that Blynk has limited energy units, that serve as the currency for "purchasing" widgets for blynk apps. You start with 2,000 energy units and you might have to buy more in order to insert the full amount of widgets and if you want to add extra widgets.

Step 5: The Clothes Folder

  • Check that you are able to connect the 3 servos together to the CPX. You might need a powerful power supply \ external power supply. We connected the servos using jumper cables connected to alligator cables. Make sure the brown cable is connected in this way to ground, the red cable is connected to voltage (3.3v port) and orange cable is connected to A1 \ A2 A3
  • Attach each stick (in our case - chop sticks from a local Asian restaurant) to a servo arm
  • Make sure you run a sketch that calibrates each servo to 0 degrees (and the right servo to 180 degrees) before attaching the sticks to the servos
  • Attach the sticks to the clothes folder. You may do this using a glue, a powerful tape or whatever solution you see fit
  • Place the servos in a elevated place. You may use cardboard boxes as used in the picture. Make sure the servos are firmly attached to it, and are in correct places according to the laundry folder
  • Connect the servos to the servo arms

Step 6: The Clothes Fitting System

1. Draw the clothes by hand with a pencil (important!). Make sure the lines are drawn toward a certain point that will be connected to the board

2. Connect the connection points with alligators to the CPX board.

3. Upload the sketch to the CPX

Step 7: The Code

The full sketches are down below. Dresser.ino + Dresser.h are the sketches that belong to the clothes folding and weather scenarios. ColorFitter.ino is the sketch that belongs to the Color fitting scenario. BlynkConfig.h is just a set of macros that name the pins for both of the sketches.

How to run the sketches properly:

  • Make sure all the relevant libraries are installed, including Adafruit Circuit Playground, Blynk, BlynkESP8266, Servo and SPI
  • Fill the Blynk authorization key, WIFI SSID and password
  • Make sure left, right and top servo are connected to specified ports, and if not change them accordingly (either physically or adjust the macros)

Step 8: Enjoy!

You are ready to go out and know exactly what to wear! And fold the clothes you don't wear!