lundi 7 avril 2014

Sending SMS with Android


This is a quick example on how to integrate the SMS your app. Threre are two ways to do it:
  • Programmatically
public void SendSms(string phoneNumber, string smsMessage){

         SmsManager mySmsManager = SmsManager.getDefault();

         mySmsManager .sendTextMessage(phoneNumber, null, smsMessage, null, null);

}
  • Using the built in Android SMS Application 

public void builtINSMS(string phoneNumber,string message) {

        Intent intentSMS = new Intent(Intent.ACTION_VIEW);



        intentSMS.putExtra("sms_body", message);

        intentSMS.putExtra("address", phoneNumber);

        intentSMS.setType("vnd.android-dir/mms-sms");

        startActivity(intentSMS );

}


Don't forget to add Sending SMS permission in your manifest file

<uses-permission android:name="android.permission.SEND_SMS" />

mercredi 2 avril 2014

Arduino and Android ADK


Smartphones gives us a wide range of applications that help us organize our selves, play and wake up on time, but if only there is a way to connect our phones to the real world to control hardware stuff like house lighting system or the garage door. Smartphones have a bunch of possibilities including sensors like GPS, accelerometers and temperature, a decent cpu for processing data but the most important feature a smartphone can give is its portability.




In 2011 Google starts a project called Android ADK: http://accessories.android.com/ the Android accessory kit, that can make your phone communicate to devices (accessories) by make a bridge between the power of android devices and the real world through a simple USB communication. This bridge can solve so many problems :D



So I thought to try it out with an arduino ADK board. The project I've done is to control a led and a DC motor From the Android to the arduino passing by xbee modules.
The next diagram explains entities communication:


The code has three sides:

  • The Android side : sending commands through ADK
  • The Arduino ADK Side: Receiving commands and send it wirelessly to other arduino boards with xbee
  • The Arduino Uno Side: Receiving commands from xbee and control the DC motor and the led.
The hole project:

I'll  be happy to answer questions in the comments
Thanks.

dimanche 5 janvier 2014

2 DC MOTORS DRIVER with L298

Hi,
As I'm starting with CADSoft Eagle software, I wanted to make a simple 2 motor driver board.
This board can control 2 DC motors using the L298 circuit from ST.


You can find the complete data-sheet of the circuit here

The schematics:


The circuit:





samedi 4 janvier 2014

STM32F4 discovery board adapter parts with Eagle

The STM32F4 discovery is a wonderful board but it is really not freindly when testing with all its ugly male connectors that it is impossible to put it in a lab board.

I don't know if anyone did this before, but I made a small adapter in eagle for this board so it can be easily integrated with other test or prototyping project or it can be simply used in a hole PCB board.

Download the part from here: