Wiki

Clone wiki

LetYourBodyMove / Home / GettingStarted_backup_before_split

Getting Started

This tutorial is divided into three sections. The first section describes some basics about EMS and how to get the resources for the following sections. Section two describes how you build your own EMS-Toolkit, which you can see in the following picture. Section three is about installing necessary software and using the EMS-Toolkit. So if you already have an EMS-Toolkit, the resources and you know enough about EMS you can skip the first two sections ( Jump to: Section 3 ).

ems_board.png

Content

Section two

Section 1 - Basics

If you are completley newbie with EMS read some facts about it and make you familar with the electrical characteristics and safety issues. The next two links give you a general overview about that, what EMS/TENS is normaly used (not for haptic feedback). The third link shows you further work, which have be done with EMS/TENS as method to generate haptic feedback. For safety issues read the manual of your EMS/TENS device. It should explain things like, when you should not use EMS/TENS, locations of the skin where electrodes should not be placed and electrical parameters of your EMS/TENS device.

Get the resources

Clone the repository or download the content and put the files into an arbitrary empty directory, here called <your created folder>.

If you already have a board, jump to the Get the Software to work section below.

Section 2 - Create your Board

View the circuit schematics

Download eagle from the link below:

download eagle

Go to "<your created folder>\ToolKit\Hardware\EagleSchematics" and open the file "EMS_WS_Module_Vertical_V01.sch".

You will see something like the following.

eagle_files.jpg

The left view shows the Board file, in which the layout of the circuit is defined. The right view shows the schematic, which defines the interconnection between the single components.

Build your board

Decide if you like to build your board on your own or if you like to use the service of an PCB manufactor. Below is an incomplete list of manufactors, which you can find in the web. We did not use a manufactor and built our Toolkit with a rapid PCB prototyping device. Buy your PCB with a stencil. It is useful for lining up the solder paste.

Board manufactors:

The manufactors need gerber files to produce your PCB. You can find the gerber files in "<your created folder>\ToolKit\Hardware\EagleSchematics". If you use another manufactor than elecrow, then you have to create new gerber files. For this read the tutorial about how to create gerber files of the specific manufactor and create the gerber files.

Buy parts

See quantities and hyperlinks in the partlist in "<your created folder>\ToolKit\Hardware\PartList.pdf". We choose Mouser because Mouser has all parts on stock, that we need for our prototyping Toolkit. Of course you can choose another supplier.

Placing and soldering

Place the parts on your PCB and mount them. Look at the eagle-".brd" file, it defines where which component has to be or use the pictures in this section. For mounting you have to options: solder the components manually, which might be hard, or use a reflow process.

The next link is about about SMD in general. If you never heard about it read a bit. It explains also the coded sizes (for eg. 0805) of the parts and the value of resistors (2201 = ? Ohm 220 * 10^1).

Manually Mounting

This link shows you a video which might help you if you like to manually mount the parts. It shows you how to solder the small resistors and parts with many connectors.

For manually mounting you will need the following:

  • a pair of fine tweezers
  • soldering iron
  • solder
  • flux
  • desoldering braid
  • something to fix the parts for a short time
  • endurance and time

See also the steps and pictures in the reflow section. They might help you, where which part belongs and how to begin.

Reflow

For mounting with a reflow process follow the subsequent instructions.

  1. Bottom side

We recommend to start with the bottom side. First start with lining up the PCB with solder paste. Read the following tutorial if you have never done this before. It explains the use and storage of solder paste, how you use the stencil and how you see if your work is done.

Put your stencil for the bottom side on the board and fix it. If you have more PCB Boards with the same thickness put them around the PCB you want to line up. This helps to get good results. Put some of the solder paste on the stencil and spread it using a spatula.

stencil_lining_up_solder_paste_text.png

If you are finished with lining up the pcb board, it should look like the following picture. You can see an small ammount of solder paste on all pads.

solder_paste_on_pcb_bottom.png

Now place the parts on the pcb board. You need the following amount of SMD parts:

  • 1 x AD5252 (start placing with this part)
  • 4 x LH1546ADF
  • 2 x VOM1271
  • 4 x STD25NF20
  • 2 x Resistor 1kOhm
  • 2 x Resistor 1.5MOhm
  • 2 x Capacitor 10nf

Start in the middle and go to the outside while placing the components. This will help to avoid slipping of the components. Use a pair of fine tweezers to place the parts. Start initially with the digital Potentiometer (AD5252). The next picture shows the placing of parts.

placing_parts_bottom.png

Look at the following picture. It shows the placed components. The first Pin of each component is labeled with a red circle. The orientation of the resistors and capacitors is equal. The MOSFETs can only be placed in one direction.

placed_parts_bottom.png

Reflow the PCBs. Read the instructions of your reflow oven and on your solder paste. See the following for a fast introduction how to reflow:

This guy buyed a reflow oven from beta layout and shows, what you get and how to use it. He explains the temperature curve and some other facts. In the end he reflows a small board. The second link is a sequel of the first video. * Reflow parts with beta Layout Reflow Kit - Youtube * More SMD Oven Reflow - Youtube

The next picture shows how we reflowed the bottom side. We put the boards on an surface and placed the temperature sensor in the middle. Be careful and monitor the process. One time our temp sensor falls down and we got burned boards.

reflow_bottom.png

Let the parts cool down, then start with the top side.

  1. Top

Take your stencil for the top side of your bord and do the same as above. Then place the components. You need:

  • 1 x RN4020 Bluetoothl LE Chip
  • 1 x blue LED
  • 1 x red LED
  • 1 x green LED
  • 4 x 220Ohm Resistor
  • 1 x 470Ohm Resistor
  • 2 x 1kOhm Resistor
  • 2 x 2.2kOhm Resistor
  • 2 x 4.7kOhm Resistor
  • 2 x female 15 Position SMD Header 2.54mm

Start placing with the Bluetooth chip. Then place the small part (resistors and LEDs). Mind the polarity of the LEDs otherwise you have no cool status light. See the following figure:

placed_parts_top_text.png

After placing the parts put the board on a surface in your reflow oven and start the reflow process. See the following figure.

reflow_top.JPG

  1. Last steps

At last solder the remaining parts (the right angled 6 position shrouded header, battery clip) manually. The next figure shows the bottom side, where the schrouded headers and the power source are connected. It shows you additionaly the channel input and output pins and the polarity of the connection to the power source. These Power pins (Vin and GND) are directly connected to the corresponding pins on the Arduino. Therefore the recommended voltage has to be between 7V and 12V.

placed_parts_bottom_2.png

Your toolkit

It should look like this:

  • Top

Toolkit_top_resized.png

  • Bottom

Toolkit_back_resized.png

Build connectors

Now its time to build the connectors to your EMS-Device and to your electrodes. Below you can see pictures from our connectors.

  1. Connectors to EMS-Device

We used the provided cable from our EMS/TENS Device and put them into header with 6 Positions. Note that the two positions in the middle are not connected. The polarity is equal, because the device generates a positive and a negative square wave.

ems_input_cable.JPG ems_input_cable_wiring.png

  1. Connectors to Electrodes

We used ribbon cable for the connection and header with 2mm diameter, which are fitting our electrodes. Note that the two positions in the middle are not connected.

ems_output_cable.JPG ems_output_cable_wiring.png

Get the Software to work

Now you need to burn the Toolkit Arduino Software to your Arduino. You can use the Arduino IDE or any other IDE. We will show you how to do it with the Arduino IDE and how to get the Software to the Arduino with a special Eclipse version.

link to eclipse

Install Arduino Software

Please read Getting started with Arduino if you are new to Arduino.

Connect your Arduino Nano with your PC, start the Arduino IDE and test your Installation with the "Blink" Sketch from Arduino ("File/Examples/01.Basics/Blink").

Upload the program to your Arduino

Start the Arduino IDE and open "<your created folder>\ToolKit\ArduinoSoftware_Arduino_IDE\ArduinoSoftware_Arduino_IDE.ino". Connect your Arduino Nano over USB to your PC.

        void setup() {
        ...
        bluetoothModule.init("<your-device-name>"); //Change <your-device-name> to a name you like. Use only [A-Z0-9] and a maximum of 20 characters.
        ...
        }

Load the Software up to your Arduino. Do not interrupt the process.

Test the Toolkit

Listen to the COM Port of your Arduino. Open the Serial Monitor in your Arduino IDE ("Tools/Serial Monitor") or any other Program you like to use. Use 19200 bauds.

    You will see something like this:

        SETUP
        START
        RESET DONE
        Set Baudrate:  <- is ok
        Reboot?:       <- is ok
        Version: ERR   <- is ok
        Set Name: AOK  <- Bluetooth name is set. This and all following should show AOK. If not check the connection between the RN4020 and the Arduino.
        Set peripheral mode: AOK  
        Enable private services: AOK
        Clear private services:AOK
        Set new private service: AOK
        Set new private service value: AOK
        Set Baudrate: AOK 
        Reboot?: Reboot
        INIT DONE
        Setup DONE

After this initialization the orange LED on the Arduino should glow. If all command except the first are AOK the Module is ready to listen to your commands.

Now you can test the Toolkit over your Keyboard. Set the line ending in your Serial monitor to "No line ending". Key '1' activates channel 1. The green LED should glow. Key '2' activates channel 2, the red LED should glow.

To Test the digital potentiometer, which controls the intensity of the signal, do the following. The key 'w' decreases the Poti Value for channel 1, 'q' increases the value. You should see something like this:

        Poti value on channel 1: 129
        Poti value on channel 1: 130

The same is implemented for channel 2 with 'r' and 'e'. If the value does not change, check the connections between the digital potentiometer and the Arduino.

Serialmon.JPG

Section 3 - Use the Toolkit

Android software Installation

Install Android Studio. Follow the instructions bellow.

Install Android Studio

Test the Android Studio installation

Open Android Studio and load the Wizard-of-OzPrototyping App located in "<your created folder>\PrototypingSamples\AndroidApps\Wizard-of-OzPrototyping". Develop the application onto your mobile.

It should look like the following:

app_study_software_gestures_not_connected_resized.png

The left button activates channel 1 and the right button activates channel 2 of the toolkit. This means, that the EMS-Signals of the activated channel are directed to the electrodes. With the sliders below the buttons you can adjust the strength of the EMS-signal.

The radio buttons under the sliders are used to send predefined patterns to the EMS-Toolkit or a text command. The first signal form is the standard. It is only "on" if you press the button and "off" if you release the button. The next four buttons allow patterns (sawtooth, sqarewave, sine and slowly increasing the EMS intensity). For the syntax of the text commands see the following table and read the "Protocol of the Toolkit" paragraph in our paper.

ecp.JPG

Test your Toolkit

  1. Enable Bluetooth on your mobile. Start the Wizard-of-OzPrototyping App, which you transfered on your device in the previous step.

  2. Connect your Toolkit to a power source (7-12V Battery) or plug the USB cable in. Wait until the orange LED on the Arduino glows. This is the sign, that the initiliziation is down (should take up to 20 seconds).

  3. Tap on settings in the app on your mobile. Tap on Current Device. Enter your <your-device-name> that you defined in your Arduino code. Tap on connect. The two Buttons should become green and the blue LED on the Toolkit should glow.

    app_study_software_gestures_connected_resized.png

  4. Tap on the Buttons, the green and red LED on the Toolkit should glow.

  5. Connect your toolkit to your arm

    1. Connect your EMS/TENS device with the toolkit. Use the connectors you built above or you already have. Place the electrodes on your arm and connect them to the Toolkit.

      ems_board.png

    2. Turn your EMS/TENS Device on. We use the following values for intensity, pulse width and frequency:

    • intensity: depends on the user. Start with low values. Increase slowly
    • frequency: 80Hz
    • pulse width: 50µs

      EMS_Device.JPG

  6. Try and have fun!

Updated