Smart IoT Stroller

Smart IoT Stroller
HIGHLIGHTS

This article will discuss the Smart IoT Stroller developed at the 2014 PDX-Transportation Hackathon hosted by Intel, and show you how to make a Smart IoT Stroller on your own. The stroller features an Intel® Edison board, automatic braking system, turn signals, data synchronization to the cloud, and an Android* app for pulling data from the cloud.

SMART IOT STROLLER

Motivation for the Smart IoT stroller came from a YouTube* video of a baby stroller falling off the edge of a train  loading platform onto the tracks below. This spurred research into how technology can help prevent these events from  occurring in the future. The main intent of this project was to prevent runaway strollers; however, given the simplicity  of the design, additional features were added throughout the development process to enrich a parent’s strolling  experience.

Whenever the parent lets go of the stroller’s handlebar the front wheel locks preventing it from rolling away. Once the  parent touches the handlebar the lock on the front wheel disengages and the stroller is free to move. The turn signals on  the Smart IoT Stroller are LED strips that toggle while active. However, when both are activated at the same time, both  LED strips remain illuminated and do not toggle to indicate braking. Data is uploaded to the cloud via the Intel Edison  board’s onboard Wi-Fi* and allows parents to access the strolling trip information stored in the cloud at a later time  from their smartphones.

What You Will Need

Intel® Edison board mounted on the Intel® Arduino expansion board with the latest firmware version.
For the latest firmware see: http://communities.intel.com/docs/DOC-23242
Intel® XDK IoT Edition
https://software.intel.com/en-us/articles/getting-started-with-intel-xdk-iot-edition-on-intel-iot-platforms
3 x Grove* – Smart Relays (v 1.1)
http://www.seeedstudio.com/depot/Grove-Relay-p-769.html
4 x Grove* – Touch Sensors (v1.0)
http://www.amazon.com/Seeed-Studio-Grove-Touch-Sensor/dp/B00SIRIM7K/ref=sr_1_4?ie=UTF8&qid=1422300559&sr=8-

4&keywords=Grove+%E2%80%93+touch+sensor
7 x Grove* – Connectors (minimum)
http://www.seeedstudio.com/depot/Grove-Universal-4-Pin-20cm-Unbuckled-Cable-5-PCs-Pack-p-749.html
1 x Base Shield v2
http://www.seeedstudio.com/depot/Base-Shield-V2-p-1378.html
2 x LED strips (12V)
http://www.amazon.com/Autolizer-Lighting-Waterproof-Flexible-Outdoor/dp/B00F043DCS/ref=sr_1_1?ie=UTF8&qid=1422301887&sr=8

-1&keywords=led+yellow+strip&pebp=1422301890391&peasin=B00F043DCS
1 x Pull type solenoid (12V)
http://www.amazon.com/Pull-Type-Linear-Solenoid-Electromagnet/dp/B008LTHY6K/ref=sr_1_4?ie=UTF8&qid=1422301957&sr=8-

4&keywords=12v+pull+type+solenoid
1 x RadioShack 276-159B Board
http://www.radioshack.com/dual-general-purpose-ic-pc-board/2760159.html#.VMabo_7F8UM
1 x 12V battery
1 x Jogging baby stroller
5 to 10 ft. of 22AWG wire as needed for extending connections

How It Works Smart Brake

The automatic braking system consists of two capacitive touch sensors (Grove* – Touch Sensors), a relay (Grove* – Smart  Relay), and a 12V pull-type solenoid. The capacitive touch sensors are mounted to the handlebar of the stroller, and the  sensor outputs are connected to input pins on the Intel® Arduino expansion board. When either the left or right touch  sensors are high (parent is touching the handlebar) an output pin is asserted (driven high) to activate the relay that  controls the pull-type solenoid, and the brake disengages. Conversely, when both touch sensors are low (parent is not  touching the handlebar) the output pin is deasserted (driven low) to deactivate the relay and the front wheel brake  engages. The metallic rod that is pulled in or pushed out by the solenoid acts as a brake by obstructing the path of the  front wheel spokes on the stroller. For a graphical representation of the braking mechanics and control circuit details  see Figure 2.

Smart Brake

Figure 2 – Smart Brake Mechanics and Control Circuit

Turn Signals

The turn signal system consists of two 12V LED strips, two relays, and two additional capacitive touch sensors mounted to  the stroller handlebar. Like the braking system, the capacitive touch sensor outputs are connected to input pins on the  Intel Arduino expansion board. Each turn signal consists of a capacitive touch sensor, a relay, and an LED strip. When the  parent touches only the left capacitive touch sensor turn signal, an output pin that controls the left LED turn signal is  toggled, and the left LED turn signal begins to blink. When the parent is touching only the right capacitive touch sensor  turn signal, a different output pin that controls a separate relay is toggled and the right LED turn signal begins to  blink. If the parent is touching both the left and right capacitive touch sensor turn signals, both LED strips will  illuminate and do not toggle to imply that they are braking. For circuit details see Figure 3.

Turn Signal

Figure 3 – Turn Signal Circuit

Cloud Storage and Android* App

The data that is logged to the cloud consists of sensor data, braking events, left turns, and right turns. The Android app  consisted of three rectangles for left turn, right turn, braking events, and a text display area for showing each logged  event. HTTP posts were used for writing JSON-encoded data structures to the cloud. This article will not cover the  development of the Android app or the setup of cloud storage. Figure 4 is a picture of the Android app developed for the  Smart IoT Stroller.

Stroller App

Figure 4 – Smart IoT Stroller Android* App

Hardware Overview Smart IoT Schematic

Figure 5 is the complete schematic of the Smart IoT Stroller. Note that in the figure, the pin connections between the  Intel Arduino expansion board and the peripheral hardware components (Smart Relay, Touch Sensor) do not display the use of  the Base Shield v2, which the Grove connectors need. The Base Shield v2 is a hardware module that plugs directly into the  Arduino headers on the expansion board and routes some of the digital/analog pins to Grove connectors.

Hardware Schematic

Figure 5 – Smart IoT Stroller Complete Hardware Schematic

Power Distribution

The relays, LED strips, solenoid, and Intel Arduino expansion board (via DC barrel jack) all need access to the 12V  battery. Therefore, a custom power distribution board is needed. Figure 6 shows an unmodified RadioShack 276-159B board  with the connections needed for powering all of the hardware components used in the Smart IoT Stroller design. A 12V rail  is created by soldering a connection from the positive battery terminal to node A, and then soldering jumper wires between  nodes A, B, C, D, and E as shown in Figure 6. Similarly, a ground (GND) rail is created by soldering a connection from the  negative battery terminal to node F and then soldering jumper wires between nodes F, G, H, I, and J. Each hardware  peripheral obtains its power via the 12V rail and all share a common ground via the GND rail. This example utilizes 8 “AA”  batteries in series via a RadioShack battery holder with a snap connector to supply the needed 12V power.

Power Board

Figure 6 – Power Distribution Board

Grove* – Smart Relay

Figure 7 is a picture of the Grove – Smart Relay with the reference designators used in the Smart IoT Stroller Complete  Schematic (Figure 5). The SIG, NC, Vcc, and GND pins are part of the Grove female header shown in Figure 7. The voltage  used to power peripherals controlled by the relay is input to the wire terminal block on the Grove – Smart Relay. Figure 7  shows the Vin pin located on the left side of the wire terminal block and the Vout pin located on the right side of the  wire terminal block.

Smart Relay

Figure 7 – Grove* – Smart Relay

1 – Mount the Intel® Edison board and Base Shield v2

To get started, mount both the Intel Edison board and Base Shield v2 to the Intel Arduino expansion board. The Intel  Edison board should plug into reference designator J7 on the Intel Arduino expansion board. Next, secure the Intel Edison  board via the small nuts and bolts provided with your expansion board. Mount the Base Shield v2 by plugging it into the  Arduino headers on the expansion board and make sure that the voltage selector switch on the Base Shield v2 is set to 5V.  See Figure 8 for details on mounting locations and what your hardware setup should look like after mounting the  components.

Base Shield

Figure 8 – Intel® Edison and Base Shield v2 mounting before and after

2 – Smart Brake

Connect the positive lead of the solenoid to Vout on the relay used for controlling the solenoid. Use a Grove connector to  connect the Smart Relay to Grove connector D2 on the mounted Base Shield v2.

3 – Left Turn Signal

Connect the 12V input wire on the left turn LED strip to Vout on the relay used for switching the left turn signal. Use a  Grove connector to connect the Smart Relay to Grove connector D3 on the mounted Base Shield v2.

4 – Right Turn Signal

Connect the 12V input wire on the right turn LED strip to Vout on the relay used for switching the right turn signal. Use  a Grove connector to connect the Smart Relay to Grove connector D4 on the mounted Base Shield v2.

5 – Touch Sensors

Use Grove connectors to connect the capacitive touch sensors to the mounted Base Shield v2 as outlined in Table 1.

Table 1. Capacitive Touch Sensor to Base Shield V2 Mapping
Signal Base Shield V2 Grove* Connector
Left Touch D7
Left Turn D8
Right Touch D6
Right Turn D5

6 – Connecting the Power Distribution Board

  • Use jumper wires to connect Vin on the Smart Relays to the 12V power rail on the power distribution board (see Figure 6).
  • Similarly, the negative wires (ground wires) on the solenoid, left turn LED, and right turn LED need to be connected to  the GND plain on the power distribution board (see Figure 6). Use jumper wires to connect these peripherals.
  • Connect the DC barrel jack soldered to the power distribution board to jack J1 on the expansion board.
  • Refer to Figure 6 above to see the connections.

7 – Completed Connections

After completing steps 1-6 above your hardware configuration should look similar to what is shown in Figure 9.

Hardware Connections

Figure 9 – Completed Hardware Connections

8 – Create Intel® IoT XDK Project

Open Intel XDK IoT Edition and create a new project called “Smart_IoT_Stroller”. For help with Intel XDK IoT Edition see:

  • https://software.intel.com/en-us/articles/getting-started-with-intel-xdk-iot-edition-on-intel-iot-platforms

9 – Smart IoT Stroller Code

File: main.js

Download the main.js file from the GitHub URL provided below and import it into your main.js file in the  Smart_IoT_Stroller XDK project. The code sets up the general purpose input/output (GPIO) pins used in the Smart IoT  Stroller design via the setupIO() function. After setting up the hardware direction and initial values of the output pins  used for controlling the relays, the JavaScript* setInterval() function is used (see line 90) to call the function defined  as the first argument every 500 milliseconds. This is essentially the infinite loop that one would expect in a C/C++ 

Arduino project; however, the function/loop code will only execute once every 500ms instead of continuously like in  Arduino. To change the frequency at which the function is called simply change the argument 2 in the setInterval()  function call. Argument 2 is the number of milliseconds to wait before calling the function again.
Inside the function defined as argument 1 of the setInterval() function call, each capacitive touch sensor is read and is  used to control the states of the solenoid, left turn LED strip, and right turn LED strip. Any changes to the state of the  capacitive touch sensors, solenoid, left turn LED, and right turn LED are logged to the cloud via the save_to_cloud()  function. 
Application Note: Replace the ‘CLOUD_STORAGE_URL’ variable on line 41 with your cloud storage URL.
GitHub URL:  https://github.com/joshsackos/smart_iot_stroller/blob/master/main.js

File: package.json

To perform HTTP posts in the Smart IoT Stroller the request client must be included in the Intel XDK dependencies list.  Open the package.json file located in the left-hand navigation of the Intel XDK IDE. In the package.json file add  request:latest between the dependencies curly braces and save the document. After adding the request client to the  dependency list, your package.json file should be similar to the package.json file located at the GitHub URL below.
GitHub URL:  https://github.com/joshsackos/smart_iot_stroller/blob/master/package.json

10 – Build and Program your Intel® Edison board

Connect the Intel Arduino expansion board to your PC with the Micro-USB cables, and connect to your board from in the  Intel XDK IDE. Build the Smart_IoT_Stroller project and upload it to the Intel Edison. Disconnect both USB cables from  your expansion board. See Figure 10 for details.

XDX IDE Connect Program

Figure 10 – Intel® XDK IDE – Connect, Build, Program

11 – Cloud Storage and Android App

The cloud storage utilized in the Smart IoT Stroller project was achieved using Microsoft Azure* Mobile services. The  Android cell phone application was built with Xamarin. Setting up the cloud storage and developing the Android app are not  covered in this document; however, the links below should get you started with your cloud storage and Android app  development.

  • Cloud Storage:

http://azure.microsoft.com/en-us/services/mobile-services/

  • Android App Development:

http://developer.xamarin.com/guides/android/getting_started/

12 – Connecting the Battery

Insert 8 “AA” batteries to power your Smart IoT Stroller. After powering your design wait about 20 seconds for the Intel  Edison to boot up.

13 – Working Smart IoT Stroller Configuration

Once the Intel® Edison board has finished booting complete the different touch combinations outlined in the video below.  If your Smart IoT Stroller hardware configuration is functioning properly, you are ready to mount the hardware onto your  jogging stroller. If your hardware configuration is not functioning properly, work through this document again and make  sure that all hardware and software configurations are correct.

14 – Working Smart IoT Stroller Configuration

Mount the working Smart IoT Stroller hardware/software configuration to your jogging stroller. Figure 11 below is the  mounting configuration used for the Smart IoT Stroller project.

Figure 11 – Smart IoT Stroller with Hardware Mounted

Conclusions
Safety Considerations

This design is intended to demonstrate how IoT devices can make everyday objects smarter and is not intended to be used in  real-world applications as is. If the stroller is in motion and the battery used for the system reaches a critical level,  the solenoid will lose power and extend the metallic rod. This is the same as applying the brake and such an event could  inadvertently cause the stroller to flip over.  An alternative would be to have a manual brake system that can also be  controlled by the Intel® Edison board, so functionality is not lost in the event the battery loses charge.

IoT-Connected World

Integrating technology into everyday objects increases convenience, allows for data collection, provides access to cloud  services, and enhances the quality of people’s lives. IoT enables the collecting of health and fitness data,  communications, statuses of important systems, and scientific measurements. IoT is an emerging market with nearly endless  possibilities.

For more such Android resources and tools from Intel, please visit the Intel® Developer Zone

Source: https://software.intel.com/en-us/articles/smart-iot-stroller

Digit.in
Logo
Digit.in
Logo