Thursday, June 19, 2014

Audio File reading from arduino

Code

/*

 Demonstrates the use of the Audio library for the Arduino Due

 Hardware required :
 *Arduino shield with a SD card on CS 4 (the Ethernet sheild will work)
 *Speaker attched to ground and DAC0

 Original by Massimo Banzi September 20, 2012
 Modified by Scott Fitzgerald October 19, 2012

*/


#include <SD.h>
#include <SPI.h>
#include <Audio.h>

void setup()
{
  // debug output at 9600 baud
  Serial.begin(9600);

  // setup SD-card
  Serial.print("Initializing SD card...");
  if (!SD.begin(4)) {
    Serial.println(" failed!");
    return;
  }
  Serial.println(" done.");
  // hi-speed SPI transfers
  SPI.setClockDivider(4);

  // 44100 Hz stereo => 88200 sample rate
  // 100 mSec of prebuffering.
  Audio.begin(88200, 100);
}

void loop()
{
  int count=0;

  // open wave file from sdcard
  File myFile = SD.open("test.wav");
  if (!myFile) {
    // if the file didn't open, print an error and stop
    Serial.println("error opening test.wav");
    while (true);
  }

  const int S=1024; // Number of samples to read in block
  short buffer[S];

  Serial.print("Playing");
  // until the file is not finished
  while (myFile.available()) {
    // read from the file into buffer
    myFile.read(buffer, sizeof(buffer));

    // Prepare samples
    int volume = 1023;
    Audio.prepare(buffer, S, volume);
    // Feed samples to audio
    Audio.write(buffer, S);

    // Every 100 block print a '.'
    count++;
    if (count == 100) {
      Serial.print(".");
      count = 0;
    }
  }
  myFile.close();

  Serial.println("End of file. Thank you for listening!");
  while (true) ;
}
 

Reading configuration file from an SD-card

#include <SD.h>
#include <ctype.h>
File myFile;
struct parameters {
  int interval;
  boolean co2;
  boolean temp;
  boolean rh;
  boolean lux;
  boolean valid;
  boolean heater;
  String lokaal;
} settings;
// Setting for SD-card reader
const int chipSelect = 10;
void getSettings()
{
 // Open the settings file for reading:
  myFile = SD.open("settings.txt");
  char character;
  String description = "";
  String value = "";
  boolean valid = true;
    // read from the file until there's nothing else in it:
    while (myFile.available()) {
      character = myFile.read();
             if(character == '/')         {
               // Comment - ignore this line
               while(character != '\n'){
                 character = myFile.read();
               };
      } else if(isalnum(character))      {  // Add a character to the description
        description.concat(character);
      } else if(character =='=')         {  // start checking the value for possible results
      // First going to trim out all trailing white spaces
      do {
        character = myFile.read();
      } while(character == ' ');
        if(description == "interval") {
          value = "";
          while(character != '\n') {
            if(isdigit(character)) {
              value.concat(character);
            } else if(character != '\n') {
              // Use of invalid values
              valid = false;
            }
            character = myFile.read();            
          };
          if (valid) { 
            // Convert string to array of chars
            char charBuf[value.length()+1];
            value.toCharArray(charBuf,value.length()+1);
            // Convert chars to integer
            settings.interval = atoi(charBuf);
          } else {
            // revert to default value for invalid entry in settings
            settings.interval = 60;
          }
        } else if(description == "co2") {
           if (character=='1') {
             settings.co2 = true;
           } else {
             settings.co2 = false;
           }
        } else if(description == "rh") {
           if (character=='1') {
             settings.rh = true;
           } else {
             settings.rh = false;
           }        
        } else if(description == "temp") {
           if (character=='1') {
             settings.temp = true;
           } else {
             settings.temp = false;
           }
        } else if(description == "lux") {
           if (character=='1') {
             settings.lux = true;
           } else {
             settings.lux = false;
           }        
        } else if(description == "heater") {
           if (character=='1') {
             settings.heater = true;
           } else {
             settings.heater = false;
           }        
        } else if(description == "location") {
           value = "";
           do {
             value.concat(character);
             character = myFile.read();
           } while(character != '\n');
           settings.lokaal = value;
        
        }else { // unknown parameter
          while(character != '\n')
          character = myFile.read();
        }
        description = "";
      } else {
        // Ignore this character (could be space, tab, newline, carriage return or something else)
      }
    
    }
    // close the file:
    myFile.close();
}
void setup()
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  Serial.println("Starting...");
  pinMode(10, OUTPUT);
  
  if (!SD.begin(chipSelect)) {
    Serial.println("initialization failed!");
    return;
  }
  getSettings();
  Serial.print("Interval: ");
  Serial.println(settings.interval);
  Serial.print("CO2: ");
  if(settings.co2) { Serial.println("YES"); } else { Serial.println("NO"); }
  Serial.print("TEMP:");
  if(settings.temp) { Serial.println("YES"); } else { Serial.println("NO"); }
  Serial.print("RH:  ");
  if(settings.rh) { Serial.println("YES"); } else { Serial.println("NO"); }
  Serial.print("lux: ");
  if(settings.lux) { Serial.println("YES"); } else { Serial.println("NO"); }
  Serial.print("htr: ");
  if(settings.heater) { Serial.println("YES"); } else { Serial.println("NO"); }
  Serial.print("Lokaal: ");
  Serial.println(settings.lokaal);
  
}
void loop()
{
 // nothing happens after setup
}

wav file on sdcard using arduino

code

#include <SD.h>                      // need to include the SD library
//#define SD_ChipSelectPin 53  //example uses hardware SS pin 53 on Mega2560
#define SD_ChipSelectPin 10  //using digital pin 4 on arduino nano 328
#include <TMRpcm.h>           //  also need to include this library...

TMRpcm tmrpcm;   // create an object for use in this sketch
char mychar;

void setup(){

  tmrpcm.speakerPin = 9; //11 on Mega, 9 on Uno, Nano, etc

  Serial.begin(9600);
  if (!SD.begin(SD_ChipSelectPin)) {  // see if the card is present and can be initialized:
    Serial.println("SD fail");  
    return;   // don't do anything more if not
  }
  tmrpcm.play("beware.wav"); //the sound file "music" will play each time the arduino powers up, or is reset
}

void loop(){  

  if(Serial.available()){   
    mychar = Serial.read();

    if(mychar == 'o'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("helpyou.wav");
    } else if(mychar == 'r'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("chortle.wav");
    } else if(mychar == 'q'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("helpyou.wav");
    } else if(mychar == 'p'){
      tmrpcm.play("beware.wav");
    }
    else if(mychar == 'w'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("impresiv.wav");
    }
    else if(mychar == 't'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("seekyoda.wav");
    }
    else if(mychar == 'y'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("sensefear.wav");
    }
    else if(mychar == 'u'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("strongami.wav");
    }
    else if(mychar == 'i'){ //send the letter p over the serial monitor to start playback
      tmrpcm.play("whyhere.wav");
    }
  }

}

Thursday, June 5, 2014

Beagle bone based projects list



1BeaglePhone
BeaglePhone is experimental cape for developing analog phone applications like VoIP gateway. This cape is based on Silicon Labs Si3215 ProSlic. The ProSLIC is a low-voltage CMOS device that provides a complete analog telephone interface ideal for customer premise equipment (CPE) applications.
BeaglePhone is chip-compatible with Asterisk PBX and can be used for drivers developing.
This project is still under developing.
Planned features:
  • FXO version of the cape
  • Overvoltage/overcurrent protection
  • Asterisk drivers

2.Traffic light controller

3.Streaming video beaglebone black

In this video, you look at video streaming (320x240, 640x480) using the Beaglebone black.
To realise this c language project i used: v4l driver, compression and decompression JPEG, UDP protocol transfer, openCV image show.

4.Autonomous Solar Car

The aim of this project is to build a solar energy powered autonomous car. Resistive matching has been employed to extract maximum energy from a solar panel, with minimal complications. This is done in order to maximize the amount of energy that is transferred from the solar cell into a Li-ion battery. This battery is used to drive an H-bridge motor controller which is controlled through the BeagleBone. 

5.Building a Home Security System with BeagleBone

ne of the best kept secrets of the security industry is just how simple the monitoring hardware actually is - BeagleBone has all the computing power you need to build yourself an extremely sophisticated access control, alarm panel, and home automation and network intrusion-detection system. Security companies make a fortune each year by charging exorbitant fees to their customers. You will learn how easy it is to make an alarm system with Beaglebone.

6.BeagleBone Home Automation

Home automation lets you control daily activities such as changing the temperature, opening the garage door, or dimming the lights of your house using microprocessors. BeagleBone is a low-cost, high-expansion, hardware-hacker-focused BeagleBoard. It is small and comes with the high-performance ARM capabilities you expect from a BeagleBoard. BeagleBone takes full-featured Linux to places it has never gone before.
Starting with the absolute basics, BeagleBone Home Automation gives you the knowledge you will require to create an Internet-age home automation solution. This book will show you how to set up Linux on BeagleBone. You will learn how to use Python to control different electronic components and sensors to create a standalone embedded system that also accepts control remotely from a smartphone.
This book starts with the very basics of Linux administration and application execution using terminal connections. You will learn the basics of the general purpose input/output pins and discover how various electronic sensors and electronic components work. The "hardware jargon" is explained, and example applications demonstrating their practical use are created so that you will feel in control of the capabilities provided.
Network programming is also a big part of this book, as the created server will be made accessible from the Internet through a smartphone application. You will also learn how to create a fully working Android application that communicates with the home automation server over the Internet.

7.Application of image processing techniques for the extraction of vehicle number plates over ARM target board

Correct recognition of vehicles violating traffic rules and regulations is a major challenge in the present complex traffic environment. Automatic Number Plate Recognition (ANPR) systems plays an important role in the detection of such events. ANPR systems are typically standalone systems using the capabilities of embedded processors for correct recognition. The limited processing capabilities hinders the efficient determination of location of number plates in such images satisfying the real time criteria. This paper presents an adopted method for the image preprocessing, image detection and extraction of standardized white background vehicle number plates. Application of suitable Gaussian Filters along with other image preprocessing techniques, Binary jumps and Image differencing techniques have been carried out in this work. An ARM Cortex A8 processor with 1GHz processor and 512 MB RAM has been selected as the candidate embedded processor in this work. Experiments show that the proposed method posses over 90% accuracy.

8.Design of multi-threaded real time embedded video acquisition system from IP cameras

IP cameras have become the de facto imaging sensor used for video acquisition in surveillance systems because of its advantages over traditional analog cameras. Video Compression schemes are adopted for efficient transmission and bandwidth preservation of the link. Currently H.264 is the compression standard adopted for video compression in these devices. Logging of the videos from the imaging sensors is the fundamental responsibility of these surveillance systems. This paper presents an efficient method for the multi threaded acquisition of H.264 encoded video stream from these imaging sensors. An embedded implementation of the proposed method have also been carried out on an ARM Cortex A8 target. The embedded system developed possesses the capability of acquiring compressed video streams concurrently from 4 IP Cameras while handling the real time processing constraints.

9.A cloud computing-based image codec system for lossless compression of images on a Cortex-A8 platform

Aimed to provide an efficient architecture for the storage and processing of medical images, a cloud computing-based system is proposed in this paper. In addition, with the highly increased computational ability of embedded systems, an ARM-based Cortex-A8 embedded platform is applied in the proposed architecture as the kernel for the lossless compression, decompression, as well as the processing of medical images. All the images generated are first sent to the embedded platform for lossless compression before stored in the image database server. On the other hand, images are retrieved and first sent to the platform for decompression, and then transmitted via the network to the client for viewing purpose. In the proposed system, the decompressed images are transmitted with the protocol of HTTP, which means only a browser is needed for the client. Moreover, the client can perform image processing, e.g, image sharpening and histogram equalization with respect to the selected image in the browser, no other application program is required. As no other application program is required for the client other than the browser, the proposed system architecture is very easy to maintain with, and the computational burden traditionally imposed on the client can be quite alleviated. Furthermore, the coding algorithm used is very effective and efficient for the lossless compression of images as we will see in the experiment. The cloud computing-based architecture in conjunction with the high efficient coding algorithm make the proposed system very feasible for practical usage.

10.The Challenge of Testing the ARM CORTEX-A8/sup TM/ Microprocessor Core

The DFT and test challenges faced, and the solutions applied, to the Cortex-A8 microprocessor core are described in this paper. New DFT techniques have been created to address the challenges of distributing a DFT core solution that ultimately end up in many different environments. This core comprises synthesized, hand-mapped, hand-placed (HMHP) and custom blocks. A DFT solution had to be created that could be utilized by a multitude of customers

11.Temperature controlling system for LED lighting based on ARM


Since LEDs are generally considered to be an important lighting source of the future, an ARM-based LED intelligent lighting system was provided in this paper. According to the ambient temperature obtained by sensors, the designed system can adjust the glow color automatically to provide a pleasant lighting environment. Based on the ARM Cortex-M0 processor, the hardware and software of this system were accomplished and a series of pulse width modulation signals were generated to drive the LEDs. The testing results of the physical prototype show that the designed system works well. Thus, the preliminary research proves the possibilities of smart lighting.

12.Smart home design based on ZigBee wireless sensor network

is work is based on the Internet of Things and ZigBee wireless sensor network technology. A kind of smart home design based on ZigBee wireless sensor network was proposed in this paper. Texas Instruments MCU device LM3S9B96, which is the ARM Cortex-M3 based controllers, was used in this system. The entire system is running on the μC/OS-II embedded real-time multitasking operating system. Users can access this system by a dynamic webpage of LwIP TCP/IP protocol stack or GSM SMS. Using this system users can conveniently know the environment parameters of home, such as temperature, humidity, meter readings, light, and control the home electronic equipments, such as light, aircondition, heater, by ZigBee wireless sensor network.

13.On-line monitoring system of insulator leakage current based on ARM

A ceramic insulator has an excellent anti-pollution performance, but sometimes flashover occurs on it and then the outage of power network follows. This paper analyzes the formation mechanism of flashover and the result is that the RMS of leakage current(LC) and discharge pulses reflect the contamination severity approximately. This shows that to a large extent the flashover accident can be avoided by means of monitoring the leakage current value and the discharge pulses. Existing monitoring device for contaminated insulators inspects either leakage currents or discharge pulses, also, it is difficult to meet the requirements of the client for low-power consumption, low cost and high reliability. In this paper, a novel low-power and low-cost online monitoring system is presented, which is based on ARM Cortex-M and Zigbee wireless network. In addition, the monitoring system not only acquires the leakage current and discharge pulses of insulator strings, but also measures the environmental temperature and humidity and then comprehensively analyzes the severity of insulator pollution. After that the results will be displayed on the LCD or sent to the control center through the Zigbee network. Tests show that the monitoring system has good accuracy and good practical performance.
Brain EEG signal processing for controlling a robotic arm
Researchers recently proposed new scientific methods for restoring function to those with motor impairments. one of these methods is to provide the brain with a new non-muscular communication and control channel, a direct Brain-Machine Interface (BMI). This paper presents a Brain Machine Interface (BMI) system based on using the brain electroencephalography (EEG) signals associated with 3 arm movements (close, open arm and close hand) for controlling a robotic arm. Signals recorded from one subject using Emotive Epoc device. Four channels only were used, in our experiment, AF3, which located at the prefrontal cortex and F7, F3, FC5 which located at the supplementary motor cortex of the brain. Three different techniques were used for features extraction which are: Wavelet Transform (WT), Fast Fourier Transform (FFT) and Principal Component Analysis (PCA). Multi-layer Perceptron Neural Network trained by a standard back propagation algorithm was used for classifying the three considered tasks. Classification rates of 91.1%, 86.7% and 85.6% were achieved with the three used features extraction techniques respectively. Experimental results show that the proposed system achieved high classification rates than other systems in the same application.
Implementation of a Web of Things based Smart Grid to remotely monitor and control Renewable Energy Sources
This paper describes a Smart Grid architecture implemented with the help of Web of Things. Web of Things comprise of a set of Web services provided on top of a number of Internet enabled Embedded devices. The Web browser on any computer can act as an interface to the services provided by these Web of Things. The Embedded devices are ARM Cortex M3 Processor based devices with Ethernet capabilities. CMSIS Real Time Operating System is used for process control on each of these embedded devices. LwIP Protocol Stack is implemented on top of each of these devices so that IP connectivity can be established. The Web interfaces provide us real time information on each of the energy meters that are installed on site and communicate to the Embedded Internet devices using MODBUS communication protocol. Real Time energy source scheduling, energy source selection, power connection and disconnection are some of the services that are provided to an on-line authenticated user. The Embedded Systems lab Infrastructure at the TIFAC CORE for 3G/4G Communication at National Institute of Science and Technology was used for the hardware testing of the embedded modules. We were greatly helped by the Software developers at NIST Technology Consultancy Services in designing the web applications and interfaces for our Web of Things architecture.
Embedded System for Biometric Online Signature Verification
This paper describes the implementation on field-programmable gate arrays (FPGAs) of an embedded system for online signature verification. The recognition algorithm mainly consists of three stages. First, an initial preprocessing is applied on the captured signature, removing noise and normalizing information related to horizontal and vertical positions. Afterwards, a dynamic time warping algorithm is used to align this processed signature with its template previously stored in a database. Finally, a set of features are extracted and passed through a Gaussian Mixture Model, which reveals the degree of similarity between both signatures. The algorithm was tested using a public database of 100 users, obtaining high recognition rates for both genuine and forgery signatures. The implemented system consists of a vector floating-point unit (VFPU), specifically designed for accelerating the floating-point computations involved in this biometric modality. Moreover, the proposed architecture also includes a microprocessor, which interacts with the VFPU, and executes by software the rest of the online signature verification process. The designed system is capable of finishing a complete verification in less than 68 ms with a clock rated at 40 MHz. Experimental results show that the number of clock cycles is accelerated by a factor of ×4.8 and ×11.1, when compared with systems based on ARM Cortex-A8 and when substituting the VFPU by the Floating-Point Unit provided by Xilinx, respectively.
A Multi-camera Wireless Capsule Endoscopic System
The aim of this project is to build an efficient multi camera wireless capsule endoscopic system, thereby trying to make the capsule have 360° angle of view. The primary idea is to address the problem of limited diagnosis caused due to the formation of blind areas while using a single camera. A multi camera approach helps to reduce the blind area. However increased image sensors cause increase in power consumption. In this work, a 4 camera wireless capsule system prototype was built which uses JPEG image compression to reduce the data size needed to be transmitted by the RF transmitter. Stellar is LM4F120 (ARM Cortex M4) micro controller performs the main task of image compression, EZ430-RF2500 to establish the wireless link and the cameras used are Omni vision's OV7760.
Development of Telugu Text to Speech System Using OMAP 3530
Speech is the important mode of communication. Speech synthesis is the artificial production of human speech. A text to speech system is to convert an arbitrary text into speech .In India different languages have been spoken each being the mother tongue of tens of millions of people. This text to speech sytem is primarily developed for Telugu, a Dravidian language predominantly spoken in Indian state of Andhra Pradesh where it is an official language. Telugu TTS has to face many challenges during the conversion of text to speech.The most important qualities expected from this system are naturalness and intelligibility. This paper describes a development of a Telugu text to speech system using concatenative synthesis method using beagle board OMAP 3530(ARM Cortex A-8 core) in linux.
Robotic Valet Parking System
Due to influx of vehicles on the road, citizens inevitably combat traffic congestion on a daily basis. This is underlined by the lack of parking infrastructure and shoot up of vehicle to human population ratio. The Robotic Valet Parking System uses the robotic valets, which are the vehicle carriers and parks the vehicles compactly in a given space of the parking area once the driver loads his vehicle at the loading bay. Robotic Valet Automated Parking System (APS) provides solution for the parking problems without the need for special construction for automation. The conventional concrete garages can be transformed into an automated parking system with the use of robotic valets. Since the robotic valet APS requires concrete flooring, which provides the fire separation, builders consider it approvable. The number and the position of the occupied vehicles can be determined without the deployment of the sensors in each of the parking slots. The vacancy of the parking garage is displayed on the LCD screen which is of benefit to the costumer. The central processing unit wirelessly controls the locomotion of robotic valets and the arrangement of vehicles in the parking area. We shall prove the space efficiency, accuracy, operational speed, safety and cost effectiveness of the proposed parking system. A functional prototype of a robotic valet is built which parks the vehicle loaded. The Unified Technology Learning Platform (UTLP) Kit, which has TI (Texas Instruments) ARM CORTEX A-8 microprocessor unit embedded in the TI OMAP 3530 applications processor, is the control unit and this monitors the movement of the robotic valet wirelessly. On producing the parking slip at the exit the robotic valet automatically retrieves the vehicle to the costumer.
Software-defined Radio based On Cortex-A9
This paper presents an implementation of Software-defined Radio (SDR) system over ARM Cortex-A9 processor. Compared with conventionally used general purpose CPU, e.g. X86 CPU, ARM processors have advantages in both price and power consumption under the same computing capability. Two basic issues of SDR over ARM are investigated: the real-time operation and signal processing efficiency. For the former issue, we select the Linux-based real-time operating system Xenomai, which is built on Cortex-A9 platform. Testing results show that the performance of Xenomai on Cortex-A9 meets the real-time requirement of SDR. Furthermore, the NEON technology of Cortex-A9 is used to optimize the complex signal processing algorithms in communication systems. Soft Demodulation is taken as an example for the optimization, and the experimental results are provided to show the improvement of signal processing efficiency.

Wednesday, June 4, 2014

iron man effect using arduino and accelorometer

iron man effect can be done using arduino and accelorometer...

list of the components
1.arduino uno board
2.adxl 335(acceloro meter)
3.leds

 how to do :

step1: make the led array in round shape...
step2:take the adxl335 and make the connection with the arduino
step3:connect the arduino and led strip and and adxl335 and connect accordingly..

step4:write the code for like when you requried leds should on...
do the accordingly....

python class topic video