Introduction: Soothing Ball

The product to be designed consists of an interactive toy for children, oriented to episodes of nightmares. We focus on developing a product that allows the user to communicate with simple actions such as exerting pressure on the object, or detect the increase in voice or sound volume, for example, if the child cries. With the design of this interactive toy, when the child begins to cry, the toy begin to turn on progressively, causing the child to calm down and feel accompanied. In addition to the lighting function, it will emit stored sounds, such as relaxing songs or other sounds. The pressure sensor will allow the child to alternate between the programmed light and sound sequences. This will materialize into a spherical, soft ball that will capture the child's attention.

Step 1: Tools and Materials.

The first and most essential step is the selection of materials and components for product development.

- An indispensable element is the Arduino Uno board, from Arduino.

- We will also need a MicroSD and a MicroSD Adapter to create a music library.

- A Sound Detection Sensor Module to detect baby's crying volume by Atomic Market.

- A press button.

- A pack of 10 5050 RGB LEDs from Adafruit, which are then welded together.

- One 0.5 watts and 8 ohms loudspeaker.

- Jumpers (20 pack)

- Cable to connect the LEDs between them.

- You may need an soldering iron, if the wires can not be connected directly to the Arduino.

The elements for designing the prototype itself, i. e. the non-technological part of the prototype, are explained below.

- It will take half a metre of white fabric, velvet has been chosen but could be any other.

- Sewing thread of any color (we have chosen garnet color because we thought it made good contrast with white).

- Paper to make the pattern of how the fabric will be cut.

- Medium diameter ball, to take advantage of the foam inside.

- Natural rubber ball for consistency and shape.

- Needle and thimble for sewing.

Step 2: Components Assembly.

Initially, the entire circuit must be installed component by component.

To do this, start with the microphone assembly. A diagram for the connection of this is attached. This diagram graphically depicts the connection of a noise sensor analogically. Although in the final code the digital connection (and therefore a digital sensor) has been used because the analog microphone was broken, the ideal is to use the latter to be able to adjust the sensitivity more precisely. Therefore, this scheme is attached because the initial intention is to use the analogue typology.

The loudspeaker is then simply connected. A diagram is also attached for easy assembly.

Another component to add is LEDs. They must first be welded together with cable, and then connected to the Arduino board as shown in the diagram below.

Another component of great importance is the MicroSD card reader and the corresponding card. This is where all audio files are stored in wav format, so that they can be played back when the Arduino is running. In addition, for storing music on the MicroSD card, an SD card adapter is required to access the download. Among the diagrams is the one that indicates how to connect the reader to the Arduino board.

And the last, but no less important, component is the push button. This element is connected to the board in the way as expressed in the graphical diagram.

Step 3: Real Circuit

It is in this section where the first images of the unified circuit are exposed, with all the components attached to the board. It is then when you enter the stage of beginning to write the code and the product to design begins to take shape and functionality.

Step 4: Prototype Creation

Once the components have been assembled, the outer prototype is designed, i. e. the ball itself. To do this, some patterns will be cut on paper (downloadable on the Internet) that will serve to later cut the fabric chosen. Once the fabric has been cut to the shape required, these pieces of cloth are joined together to form the ball one by one. When we already have practically more than half of the ball sewn, it is when the technological elements are inserted inside.

To insert the components, it has been decided to empty the rubber ball inside, to insert the components there. The luminous part is that which surrounds the sphere superficially, as can be seen in the inserted images.

Once the ball is coated with LEDs and all its components, it is inserted into the sewn fabric mentioned above. Thus, it is covered with foam to further diffuse the luminous effect and generate a warm and pleasant effect.

Step 5: Final Prototype

And here is the result of all the hard work. A spongy and interactive ball that will allow children to feel more warmth and companionship.

The product offers the function of turning on the lights and music when the child cries, because thanks to the sound sensor you can activate the loudspeaker that will play up to five different songs. The control of the music will be done by pressing the button, alternating the five states until it is turned off in a predetermined time.

Step 6: Final Code

//This code

runs a lighting toy for kids when they go to sleep. If they cry or touch the toy it'll

//light and play relaxing music.

//For this project we need a microsd card, a microsd card adapter, 8hm speaker,

//digitaloranalog micrphone, pressure sensor or button and 10 RGB NeopixelLeds

//declaring lEDS and library

#include

#ifdef __AVR__

#include

#endif

#define PIN 6

#define NUM_LEDS 10

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

//declaring MICROPHONE

int microPin = 2;

int microValue = 0;

//declaring MicroSD Library TMRpcm

#include "SD.h"

#define SD_ChipSelectPin 10

#include "TMRpcm.h"

#include "SPI.h"

TMRpcm tmrpcm;

//declaring BUTTON

int buttonPin = 4; // FSR is connected to analog 0

int buttonValue; // the analog reading from the FSR resistor divider

//declaring MODE, every mode has a song and a led's colour assigned

int mode = 0;

//declaring MUSIC variables

boolean p = false; //if music is playing or not

long start;

void setup(void) {

// MICRO SETUP

Serial.begin(9600);

pinMode(microPin, INPUT);

microValue = digitalRead(microPin);

//LED SETUP

strip.begin();

strip.show(); // Initialize all pixels to 'off'

//FSR SETUP

Serial.begin(9600);

pinMode(buttonPin, INPUT);

digitalWrite(buttonPin, HIGH); //activate arduino internal pull up

//MICROSD SETUP

tmrpcm.speakerPin = 9; //analog output for speaker

Serial.begin(9600);

tmrpcm.setVolume(6); // volume from 1 to 6

if (!SD.begin(SD_ChipSelectPin))

{

Serial.println("SD fail");

return;

}

// TIMER

start = millis();

}

void loop() {

mode = 0; // mode = 0 do nothing

estat();

// if microphone detects noise -> Start Mode 1

if (digitalRead(microPin) == LOW ) {

delay(100);

mode = 1;

}

//if button is pressed -> Start Mode 1

if (digitalRead(buttonPin) == LOW) {

Serial.println("Button is pressed");

delay(500);

mode = 1;

}

//TIMER: 1 min for every mode, more than a minute will switch off the toy.

if (millis() - start > 60000) {

p = false;

mode = 0;

}

}

void estat() {

//declaration of led variables (4 leds will light up)

int l = random (0, 11);

int e = random (0, 11);

int d = random (0, 11);

int s = random (0, 11);

//declaration of led RGB colours ( RGB=ABC )

int A ;

int B ;

int C;

if (mode == 0) {

//OFF

start = millis();

tmrpcm.stopPlayback();

}

if (mode == 1) {

//If music is not playing play next audio and start timer

if (!p) {

tmrpcm.play("1.wav");

p = true;

start = millis();

}

//COLOR

A = 255;

B = 0;

C = 0;

FadeInOut(l, e, d, s, A, B, C);

}

if (mode == 2) {

if (!p) {

start = millis();

tmrpcm.play("2.wav");

p = true;

}

A = 0;

B = 0;

C = 255;

FadeInOut(l, e, d, s, A, B, C);

}

if (mode == 3) {

if (!p) {

tmrpcm.play("4.wav");

p = true;

start = millis();

}

A = 255;

B = 255;

C = 0;

FadeInOut(l, e, d, s, A, B, C);

}

if (mode == 4) {

if (!p) {

tmrpcm.play("6.wav");

p = true;

start = millis();

}

A = 200;

B = 0;

C = 155;

FadeInOut(l, e, d, s, A, B, C);

}

if (mode == 5) {

if (!p) {

tmrpcm.play("9.wav");

p = true;

start = millis();

}

A = 0;

B = 205;

C = 50;

FadeInOut(l, e, d, s, A, B, C);

}

}

void FadeInOut(int led1, int led2, int led3, int led4, byte red, byte green, byte blue) {

// take 4 random leds and make a a fade in and a fade out

float r, g, b;

for (int k = 0; k < 256; k = k + 1) {

r = (k / 256.0) * red;

g = (k / 256.0) * green;

b = (k / 256.0) * blue;

delay (10);

strip.setPixelColor(led1, strip.Color(r, g, b));

strip.setPixelColor(led2, strip.Color(r, g, b));

strip.setPixelColor(led3, strip.Color(r, g, b));

strip.setPixelColor(led4, strip.Color(r, g, b));

showStrip();

// if button is pressed change mode

if (digitalRead(buttonPin) == LOW) {

Serial.println("Button is pressed");

delay(500);

mode = mode + 1;

p = false;

estat();

}

// if button is pressed is mode 5 change mode to 1

if (digitalRead(buttonPin) == LOW && mode > 5) {

Serial.println("Button is pressed");

mode = 1;

p = false;

estat();

}

}

for (int k = 255; k >= 0; k = k - 1) {

r = (k / 256.0) * red;

g = (k / 256.0) * green;

b = (k / 256.0) * blue;

delay (10);

strip.setPixelColor(led1, strip.Color(r, g, b));

strip.setPixelColor(led2, strip.Color(r, g, b));

strip.setPixelColor(led3, strip.Color(r, g, b));

strip.setPixelColor(led4, strip.Color(r, g, b));

showStrip();

if (digitalRead(buttonPin) == LOW) {

Serial.println("Button is pressed");

delay(500);

mode = mode + 1;

p = false;

estat();

}

if (digitalRead(buttonPin) == LOW && mode > 5) {

Serial.println("Button is pressed");

mode = 1;

p = false;

estat();

}

}

}

void showStrip() {

#ifdef ADAFRUIT_NEOPIXEL_H

// NeoPixel

strip.show();

#endif

}