Working on the body 2

We are going to finish the rest of the body kit we started yesterday, today we will be adding the panda head onto the rest of the body, this require a hot glue gun in several places, we need the structure to be solid so it won’t fall off as this may ruin the Arduino board inside. We used the hot glue gun to stick the foam onto the main base and added on the outside and inside. Below are the pictures –

IMG_2854 IMG_2855 IMG_2856

Leave a comment

Working on the body

Today me and mohammod are ready to start working on the body of the baby mobile, firstly we will need to lift up the panda’s face on the main base of the baby mobile. The reason for this is because we need to fit the Arduino Uno inside the actual device, and because there is not enough space inside the device at the moment.

We used a saw to cut the panda’s face which did take a while as it wasn’t sharp enough, after which we got some blue solid foam and cut it using a wire foam cutter. We cut two pieces, a circular shape and cut the inside to make it hollow, and a circular piece sort of like a lid. We then used a hot glue gun to stick them both together.

IMG_2845 IMG_2844IMG_2848IMG_2853 IMG_2849

Leave a comment

Completed Cry Detection Algorithm

Finally completed the cry detection algorithm. How I know it works, is because I tested it using LED’s so I can see what is going on. I set the green LED as a timer, which is on for a temporary 5 seconds, if there is another sound while the Green LED is on, the Red LED (Indicating the melody) would come on.

 

Fritzing, Schematic and 2x Photograph of the LED's in action.

Fritzing, Schematic and 2x Photograph of the LED’s in action.

, , , ,

Leave a comment

LED Lights

I have found that although the hot glue did look cheap, anything we use to add the LED lights onto the baby mobile part will require some sort of glue to add both materials together. I have taken a pictures of how the parts look with the LED fitted onto it, and it really will make a difference to the baby mobile in looking presentable.

IMG_2729

, , , ,

Leave a comment

Enhancing the cry detection algorithm

Working on the algorithm again. I realised I needed to brake the tasks into smaller pieces, to make it easier to manage.

So far, I have the timer to work, which is being indicated by an LED. As the system detects sound, an LED lights up for a few seconds, then switches off again, without the need for a trigger. How this was done was by, storing the value of millis() when a sound has been detected. The system would then check if the specified time has passed, if so, then the light would automatically turn itself off.

((millis()- lastDebounceTime)>debounceDelay)

What I have to do now is, turn on a second LED, while the first LED is on. This would be the foundations for the Cry Detection Algorithm.

, ,

Leave a comment

Tuning the algorithm

Tried to improve the algorithm for cry detection using debounce, helped slightly but didn’t solve the problem.

I also realised, a major problem with the sound detection. As sound is being read by the sensor, so many high sounds are being read in one go (I think that may be due to echo, or something – not entirely sure). To resolve this, I wanted to take in 10 sound readings at a time, the get an average for those, this would mean any echo would be smoothened out . I tried looking into arrays in Arduino, but I came a across a quicker and much simpler solution. I’m not sure if this is the best way to go about doing this, but it’s working for the time being, what I decided to do instead was, as a loud sound gets detected, there is a split second delay in the system, that way the excess high-reading gets eliminated, which did the trick.

, ,

Leave a comment

By Imdad

Last week we started adding LED lights to parts of the baby mobile, this was done by taking apart 3 pieces of the baby mobile. These 3 pieces have no function whatsoever so we decided it would be good to add some sort of function by adding LED lights. I had to cut each LED light into 4 separate sections, this was done using a wire cutter, we then added 4 LED lights to each baby mobile piece. I added glue through a hot glue gun to stick the LED’s onto the piece. This was a success however the presentation of the piece was not what we expected, it would have to be back to the drawing board for this one as even though the hot glue managed to stick on the LED lights, it looked a little cheap. Our targets now is to either cover the hot glue with some sort of presentable material, this means I will have to research a number of material that can be used.

IMG_2727

Leave a comment

SSS cipher

Tried combining the Shift, Swap and Slice ciphers together, but failed. I suspect this is because of the way processing is written now, I’m trying to get char to output a String, which processing is not allowing me to do. I tried to combine them two at a time, but yet resulted to nothing. I’ve even tried to read directly from the terminal, which is how I discovered PrintWriter, which will allows printing char to a text file. The problem with PrintWriter is that, it only printed one character to the file, I haven’t quite understood how it works, but it’s what i’ll be focusing on next time.

On the other hand, I’ve more or less have the whole system complete. I’ve managed to write un-encrypted username and passwords to a text file, which works once the button is clicked. What I have left to implement as opposed to the cipher is: compare the login username and password to the values in the text file to allow entry to the system, else it should deny.

This is what I intend to work on next time, and will come back to encryption at a later date.

, , , , ,

Leave a comment

Slice cipher (Block cipher)

Successfully managed to implement the slice section of the cipher, although it does the same job as a block cipher, slice is coded into the program so a key is not used to encrypt the message. Since the user will not be able to determine how the encryption takes place, there is no need for a key word. Below is an example of the Slice cipher, with an imaginary key length of 3.

Sample code:

String message = “mohammod”;

for (int i = 0; i < message.length(); i += 3) {
     char c = message.charAt(i);
     print(c);
}

for (int j = 1; j < message.length(); j +=3 ) {
     char d = message.charAt(j);
     print(d);
}

for (int k = 2; k < message.length(); k +=3 ) {
     char e = message.charAt(k);
     print(e);
}

Output:

ocqqofjo

As you can see from the codes, it’s just a simple use of 3 for loops, which replicates the result of block cipher, using a 3 letter key.

The challenge now is to combine the Shift, Swap and Slice to create the SSS cipher.

, , ,

Leave a comment

Swap cipher

This task turned out to be a lot more challenging than I thought it would be. The objective of this stage is to swap the order of letters in pairs, if the total number of letters is odd, then the final letter should get ignored. For example: ‘WordPress’ would become ‘oWdrrpses’.

Although I am not fully satisfied with the codes, it appears to display correct, I’m not entirely sure how this will affect the encryption at a later stage. I’ll just have to tackle that obstacle when I get there.

Sample Code:

String message = “mohammod”;

for(int i=0; i<message.length(); i++){

     int j = (i ++);
     char c = message.charAt(i);
     char d = message.charAt(j);

     print(c + “” + d +””);
}

Output:

omahmmdo

Next task is to code in the Block cipher.

, ,

Leave a comment