Arduino Phone

any problem - please send us a massage on the feedback form with the title of the project.

Combining Arduino and other shield modules, we make a mobile phone named Arduino Phone. Meanwhile, we printed a shell for it with the 3D printer. Although it’s not such fine as you think, even a little bit clunky, it’s still very cool. That is the point this is a cell phone made by ourselves.

While, we can’t install Arduino Phone Apps limited by Arduino. So, if you want to play Angry Birds, then you need to do some big modifications on Arduino Phone. :)

Next, I will make a detailed explanation about the steps of making an Arduino Phone, including the hardware connection and software implementation.

Now, let’s begin.

Preparing stuffs

At the very beginning, we’d better prepare the materials. Of course, most of these modules can be purchased directly, such as Arduino Uno, TFT Touch Shield and GPRS Shield.

Owning to we want to put our Arduino Phone into a 3D printed shell, and in order to adapt the size of this shell, we have to DIY a charging and discharging PCB board (including two parts) and an expansion PCB board which can connect to the headphone jack of GPRS Shield.

If you want to make a shell by yourself, you can directly take Lipo Rider, or something like this, as the charge sheet. Thus, you do not need to DIY PCB board in order to meet the size of the shell.

What you need:
4.RTC
5.Custom ArduinoPhone Charge Circuit (or Lipo Rider)
7.A shell (with 3D printer)
All components at here.

Hardware Connection

After preparing the materials, we need to assemble the above electronic components to lay the foundation functional part of Arduino Phone.

1.Plug GPRS Shield into Arduino UNI, then, connect the TFT Touch Shield to GPRS.
2.Connect RTC module to Arduino UNO.
2.Plug into the power module, and connect your earphone to the headphone jack on GPRS.
Well, if you choose to use Lipo Rider, you can refer to this sort of connection.
Ok, now, we are going to get into the software program part.

Programming and Test

This Arduino Phone contains the following main functions.
1. receive & send message, letter input
2. dial & answer calls
3. real time clock display
4. A convenient and concise UI, You can switch function by sliding your finger on the screen. A standard 12 key input method for inputting message.
You can get all of the Arduino Phone code from the Github, including the dependent libraries.

Before uploading code to the Arduino, you need to copy all the files in Libraries directory of source
code to Arduino-1.0.4\libraries folder.

However, a much more difficult problem is that this Arduino Phone hasn’t physical buttons
(except the Reset button switch and GPRS). So, how to manage UI will be a challenging task.

Fortunately, TFT Touch not only provides a display function, also a touch screen function.
Thus, we can manage the UI through gesture, like left-swipe and right-swipe.

It this step, we will show how ArduinoPhone works. And the picture indicates the workflow of ArduinoPhone.

Finally, opening ArduinoPhone.ino with Arduino IDE, then uplaod source code to ArduinoPhone.

Assembling

In order to make it look like a phone, we printed a shell with 3D printer as shown below. Then, assemble them carefully.
This is a troublesome but interesting process. Actually, maybe it will be more interesting if you put them into other shells, such as in shoes( see the picture :) ).
We are planning to do Arduino upgraded version. If you have any ideas or are willing to help us design a more perfect UI, welcome to contact me.

Version 2.0

Do you have any ideas to improve the ArduinoPhone? We plan to develop the Vesion 2.0.

Features:

1.More powerful hardware.
2.Amazing shell, created by paper, 3D printer, or whatever you like.
3.Integrated moudels that you want.

More detail you can look at here.

How To Make a Simple Arduino Alarm System

any problem - please send us a massage on the feedback form with the title of the project.
Detect movement, then scare the heck out of an intruder with a high pitched alarm sounds and flashing lights. Does that sound fun? Of course it does. That’s the goal of today’s Arduino project, suitable for beginners. We’ll be writing completely from scratch and testing as we go along so you can hopefully get some idea of how it’s all being done rather than simply installing something I’ve already made.
Disclaimer: this isn’t going to actually protect your house. It might give your sister a nasty shock when she sneaks into your room though.
You’ll need:
  • An Arduino
  • Ultrasonic “ping” sensor, I’m using HC-SR04 A PIR would be better, but those are expensive. A ping sensor can be placed surreptitiously in a doorway and still serve the same basic job, and is only $5
  • A piezo buzzer
  • LED strip light, with the same wiring we used back in this project.
As you’re wiring up this project, don’t remove everything each time — just keep building on the last block. By the time you get to “Coding The Alarm System” section, you should have all the bits and pieces wired up, looking something like this:
finished-wiring

Flashing Lights

Use the wiring diagram from this project to hook up your LED strip; don’t change the pins, as we need PWM output. Use this code to quickly test your wiring. If all goes well, you should have this:
led-rgb-test

Distance Sensor

On the SR04 module, you’ll find 4 pins. VCC and GND go to +5V rail and ground respectively; TRIG is the pin used to send a sonar signal, put this on pin 6; ECHOis used to read the signal back (and therefore calculate the distance) — put this on 7.
sr04
To make things incredibly simple, there’s a library we can use called NewPing. Download and place in your Arduino’s Library folder and restart the IDE before continuing. Test using this code; open up the serial monitor and make sure the speed is set to 115200 baud. With any luck, you should see some distance measurements being send back to you at a pretty high speed. You may find a variance of 1 or 2 centimeters, but this is fine. Try running your hand in front of the sensor, moving it up and down to observe the changing readings.
ping-output
The code should be fairly simply to understand. There are a few declaration of relevant pins at the start, including a maximum distance – this may vary according to the exact sensor you have, but as long as you’re able to get less than 1 meter readings accurately, you should be fine.
In the loop of this test app, we use the ping() function to send out a sonar ping, getting back a value in milliseconds of how long it took for the value to return. To make sense of this, we use the NewPing libraries built in constant ofUS_ROUNDTRIP_CM, which defines how many microseconds it takes to go a single centimeter. There’s also a 50 ms delay between pings to avoid overloading the sensor.

Piezo Alarm

The Piezo crystal sensor is a simple and cheap buzzer, and we can use a PWM pin 3 to make different tones. Connect one wire to pin 3, one to ground rail – it doesn’t matter which.
Use this code to test.
The only way to kill the rather obnoxious and loud alarm is to pull the plugs. The code is a little complex to explain, but it involves using sine waves to generate a distinctive sound. Tweak the numbers to play with different tones.

Coding The Alarm System

Now that we have all the pieces of this puzzle, let’s combine them together.
Go ahead and make a new sketch, called Alarm. Start by combining all the variables and pin definitions we’ve in the test examples until now.
#include <NewPing.h>    // Select which PWM-capable pins are to be used.  #define RED_PIN    10  #define GREEN_PIN   11  #define BLUE_PIN  9    #define TRIGGER_PIN  6  // Arduino pin tied to trigger pin on the ultrasonic sensor.  #define ECHO_PIN     7  // Arduino pin tied to echo pin on the ultrasonic sensor.  #define MAX_DISTANCE 100 // Maximum distance we want to ping for (in centimeters).    #define ALARM 3    float sinVal;  int toneVal;  
Begin by writing a basic setup() function – we’ll only deal with the lights for now. I’ve added a 5 second delay before the main loop is started to give us some time to get out of the way if needed.
void setup(){       //set pinModes for RGB strip     pinMode(RED_PIN,OUTPUT);     pinMode(BLUE_PIN,OUTPUT);     pinMode(GREEN_PIN,OUTPUT);       //reset lights     analogWrite(RED_PIN,0);     analogWrite(BLUE_PIN,0);     analogWrite(RED_PIN,0);      delay(5000);   }
Let’s use a helper function that allows us to quickly write a single RGB value out to the lights.
//helper function enabling us to send a colour in one command  void color (unsigned char red, unsigned char green, unsigned char blue)     // the color generating function  {           analogWrite(RED_PIN, red);           analogWrite(BLUE_PIN, blue);      analogWrite(GREEN_PIN, green);  }
Finally, our loop for now is going to consist of a simple color flash between red and yellow (or, whatever you want your alarm to be — just change the RGB values).
void loop(){     color(255,0,0); //red     delay(100);     color(255,255,0); //yellow     delay(100);  }
Upload and test that to ensure you’re on the right track.
Now, let’s integrate the distance sensor to trigger those lights only when something comes within, say, 50 cm (just less than the width of a door frame). We’ve already defined the right pins and imported the library, so before your setup() function add the following line to instantiate it:
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.  
Underneath that, add a variable to store the state of the alarm being triggered or not, defaulting to false, of course.
boolean triggered = false;   
Add a line to the setup() function so we can monitor the output on serial and debug.
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.    
Next, let’s rename the current loop to alarm() – this is what’s will be called if the alarm has been tripped.
void alarm(){     color(255,0,0); //red     delay(100);     color(255,255,0); //yelow     delay(100);  }
Now create a new loop() function, one in which we fetch a new ping, read the results, and trigger the alarm if something is detected within the meter range.
void loop(){      if(triggered == true){        alarm();      }      else{        delay(50);// Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.        unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).        unsigned int distance = uS / US_ROUNDTRIP_CM;        Serial.println(distance);        if(distance < 100){           triggered = true;        }     }  }  
Let me explain the code briefly:
  • Start by checking to see if the alarm has been triggered, and if so, fire off the alarm function (just flashing the lights at the moment).
  • If it’s not triggered yet, get the current reading from the sensor.
  • If the sensor is reading <100 cm, something has padded the beam (adjust this value if it’s triggering too early for you, obviously).
Give it a trial run now, before we add the annoying piezo buzzer.
Working? Great. Now let’s add that buzzer back. Add pinMode to the setup()routine.
pinMode(ALARM, OUTPUT);  
Then add the piezo buzzer loop to the alarm() function:
for (int x=0; x<180; x++) {      // convert degrees to radians then obtain sin value      sinVal = (sin(x*(3.1412/180)));      // generate a frequency from the sin value      toneVal = 2000+(int(sinVal*1000));      tone(ALARM, toneVal);    }  
If you try to compile at this point, you’re going to run into an error — I’ve left this in deliberately so you can see some common issues. In this case, both the NewPing and standard tone library use the same interrupts — they are conflicting basically, and there’s not a lot you can do to fix it. Oh dear.
No worries though. It’s a common problem, and someone has a solution already — download and add this NewTone to your Arduino Libraries folder. Adjust the beginning of your program to include this:
#include <NewTone.h>  
And adjust the line:
    tone(ALARM, toneVal);   
to
      NewTone(ALARM, toneVal);  
instead.
That’s it. Set your alarm up in the doorway of your bedroom for the next hapless would-be burglar.
Or, a dopey dog, which seemed completely unfazed by the alarm.
Having trouble with the code? Here’s the complete app. If you’re getting random errors, try pasting them below and I’ll see if I can help.