Arduino GSM Expandable Vehicle Connection Project


Today, since I’m pretty hung over, we decided to go grab lunch at our newest craft beer place. So many choices…

Using our newest member of the group, Luca, we tested the functioning of my device with a baby seat with baby and all.

We filmed him left in my car in the baby seat. He cried, I got a text saying that he may be in danger. It was awesome!

So not only did the project work beautifully, I got some feedback from some awesome friends who actually have a baby.

Now time to make the project nicer looking and “wife friendly”. What I mean by that is that you don’t want to install a device in you car that will create a constant nagging that you have wires sticking out everywhere.

And just a little advertisement for a new tool I just purchased. The 8pk-371 write stripper and crimper tool. This thing is amazing all metal construction. Made with quality and reliability in mind … All of this time I was stripping my wires with my front teeth. My dentist will appreciate.

Arduino GSM Expandable Vehicle Connection Project


So today I installed the remaining portion on the project in my car. I rooted the second wrote that goes to the driver seat. This was a little harder than the rear seat cable ad I had to take apart most of the car’s ceiling.

Now that all the routing is done, I will focus on adding an LCD display and mounting the Arduino in back of my rear view mirror. I also need to t-tap into my overhead light power source (i should also check to confirm that it is 12v).

Arduino LED light showing that I’m sitting in the driver seat.
Currently these aluminum on leather sensors are above the seat. I plan on placing them under the material.
One thing to note on this type of sensor. Since the Arduino measures the time it take the RC circuit to discharge after it is fully charged, the longer the cable that connects the sensor to the Arduino is, the longer it will take to circuit to discharge. This the sensor will take a little longer to register than during my initial tests.

Arduino GSM Expandable Vehicle Connection Project


So today I decided to start trying to take apart the insides of my car. The first 10 minutes were the hardest… Mostly head scratching hard. After pulling out my rear carseat I managed to find a weak spot in the armour… Got my tiny drill out and had my way with her. Turns out it wasn’t too hard after all. In about an hour I have routed a ground wire of relatively small gauge all the way from the baby seat location to the rear view mirror.

Next, I will tackle the driver seat. This one will be a little more tricky. It turns out that I can’t route 2 cables together without interference (maybe one day I will sit down and tackle this dreaded interference issue).

For the next part of today I will work on a solid capacitance sensor design that I can plug in and out for both the baby seat and the driver seat.

Arduino GSM Expandable Vehicle Connection Project


/* This sketch is created for use of a GSM board with an arduino. The sensors utilized are 1x DHT11 + 2x BOCHEN 3386 Potentiometer + 5k resistor +
5V solar Array + 2 aluminum foils connected to 10k OHM resistors.
Copyright: Bobby Lumia, may be used and modified for personal use only. No resale.
Please reference my project blog: http://bobbobblogs.blogspot.ca/ if useing this sketch in your work.
*/

#include // Library Needed for our capacitance readings
#include // Library Needed for the tempeature readings

dht11 DHT11; // Declare our sensor, I bid thee dht11 … the first

//============================= \/ DEFINE PINS \/ ==============

//Do Not use Pins A4 & A5 … reserved for LCD
//Do not use Pins 0 & 1 (digital pins) these are used for GSM data transmission

int LED_1 = 4;                 // BABY Led
int LED_2 = 9;                 // DAD Led

int sol = A0;         // analogue pin 0
#define DHT11PIN A1   // analogue pin 1
int pot1 = A2;        // analogue pin 2
int pot2 = A3;        // analogue pin 3

CapacitiveSensor   cs_DAD = CapacitiveSensor(11,12);    // 10M resistor between pins 11 & 12, pin 12 is sensor pin, add a wire and or foil if desired
CapacitiveSensor   cs_BABY = CapacitiveSensor(6,7);    // 10M resistor between pins 6 & 7, pin 7 is sensor pin, add a wire and or foil if desired

//============================= \/ DEFINE VARIABLES \/ ==============

int const SAMPLES = 5;                         // number of samples taken to average out capacitance
int s_val[SAMPLES];                            //array to store the 5 samples to average
int const Initial_SAMPLES = 20;                // number of samples to initilize capacitance with
float RAW_initializer_VALS[Initial_SAMPLES];   // Array to hold initial Capacitance Values

int HIGH_Thresh;     // Threshold to trigger Capacitace 1 HIGH
int LOW_Thresh;      // Threshold to trigger Capacitace 1 LOW
int HIGH_Thresh_2;   // Threshold to trigger Capacitace 2 HIGH
int LOW_Thresh_2;    // Threshold to trigger Capacitace 2 LOW

int i;              // loop counter
int triggered = 0;  // Baby text trigger … don’t want to send out too many texts

long start;         // Start the timer for performance monitoring
float Where_DAD;      // Start the Where’s DAD counter
float Cap_1;        // Capacitance Sensor – 1
float Cap_2;        // Capacitance Sensor – 2
float SolVolt;      // Solar Voltage value (0-5 Volt)
float Amb_Temp;     // Ambient temperature Variable
int chk;            // Checks the Temperature sensor status and possible faults
int pot1Value;      // Potentiometer 1 value — Used to calibrate Capacitor 1 Trigger sensitivity
int pot2Value;      // Potentiometer 1 value — Used to calibrate Capacitor 2 Trigger sensitivity
int T_multi = 4;    // Scaling factor for threshold (1 = 1024, 2 = 2048 MAX)

char str1[]={‘A’,’T’,’+’,’C’,’S’,’C’,’S’,’=’,'”‘,’G’,’S’,’M’,'”‘};  // AT+CSCS=”GSM”  — This sets:  GSM default alphabet
char str2[]={‘A’,’T’,’+’,’C’,’M’,’G’,’S’,’=’,'”‘,’1′,’7′,’7′,’8′,’8′,’8′,’2′,’1′,’8′,’6′,’7’,'”‘};  // AT+CMGS=”17788821867″  — This sets Phone number to Text
char hex1[]={0x1A};  // Stop Character used to signify the end of a Text Msg

void setup()                  
{
   Serial.begin(115200);
 
   pinMode(LED_1, OUTPUT);           // set pin to output
   pinMode(LED_2, OUTPUT);           // set pin to output
   pinMode(LED_1+1, OUTPUT);           // set pin to output
   pinMode(LED_2+1, OUTPUT);           // set pin to output
 
   Serial.println();
   Serial.println(“Starting GSM Communication…”); //Just an FYI … not really chacking anything
   Serial.println();
}

void loop()                  
{

    ReadSensors();               // All sensor readings grouped in a function
    Print_Sensor_Vals_Serial();  // Now print these values on the screen for all to see!
 
    if (Cap_2 > HIGH_Thresh_2) LED_1_ON();
    else LED_1_OFF();
 
    if (Cap_1 > HIGH_Thresh) LED_2_ON();
    else LED_2_OFF();
 
    delay(200); // no use reading less than half a second … it just confuses the sensors (mostly temp)
 
    if (Cap_2 > HIGH_Thresh_2){ // If Baby is in seat
      if (Cap_1 < LOW_Thresh) { // If daddy in not there
         if (triggered == 0){
           Where_DAD = millis(); // DAD, your timer has begin
           triggered = 1; // Level 1 trigger
           Serial.println();Serial.println();Serial.println(“Countdown Begins! Where are you dad?”);Serial.println();
         }
       
         if ((millis() – Where_DAD > (5.0 * 1000.0)) && triggered == 1){ // If daddy is still not there after 120 seconds
           Serial.println();
           SendTXT();  // Send dad a text to tell him that something is wrong
           triggered = 2; // Level 2 trigger
           Serial.println();Serial.println();Serial.println(“Baby on Board! Where are you dad? THIS IS AN ALARM”);Serial.println();
         }
      }
   
      if (triggered == 1){
         Serial.print((millis() – Where_DAD)/1000.0,1);Serial.print(” Seconds .. “);Serial.println();
         LED_1_OFF();
       }
     
       if ((millis() – Where_DAD > (5.0 * 1000.0)) && triggered == 1){ // If daddy is still not there after 120 seconds
         Serial.println();
         SendTXT();  // Send dad a text to tell him that something is wrong
         triggered = 2; // Level 2 trigger
         Serial.println();Serial.println();Serial.println(“Baby on Board! Where are you dad? THIS IS AN ALARM”);Serial.println();
       }
     
    }
 
    if ((Cap_2 HIGH_Thresh&& (triggered == 2 || triggered == 1))){ // Stop panic if, Baby is removed, or Dad has arrived … after an even was triggered
      triggered = 0;
      Serial.println();Serial.println();Serial.println(“Baby SAFE!”);Serial.println();
    }
}

void ReadSensors()
{
    start = millis();  
 
    Cap_1 = avg(); // DAD Read capacitor time constant 1
    Cap_2 = avg2(); // BABY Read capacitor time constant 2
 
    SolVolt = analogRead(sol) * (5.0 / 1023.0); // Read output voltage created by the SUN!
 
    pot1Value = analogRead(pot1);
    pot2Value = analogRead(pot2);
 
    chk = DHT11.read(DHT11PIN);
    Amb_Temp = DHT11.temperature;
 
    HIGH_Thresh = T_multi*pot1Value;
    LOW_Thresh = T_multi*pot1Value-100;
    HIGH_Thresh_2 = T_multi*pot2Value;
    LOW_Thresh_2 = T_multi*pot2Value-100;    
}

void Print_Sensor_Vals_Serial()
{
  if (triggered != 1){
    Serial.print(“performance:   “);
    Serial.print(millis() – start);        // check on performance in milliseconds
    Serial.print(“\t”);Serial.print(“\t”); // tab character for debug windown spacing

    Serial.print(“C1: “);
    Serial.print(Cap_1);Serial.print(“/”); // print sensor output 1 / Threshold
    Serial.print(HIGH_Thresh);
    if (Cap_1 > HIGH_Thresh) Serial.print(“*PROXI*”);
    else Serial.print(”       “);
    Serial.print(“\t”);                    // tab character for debug windown spacing
 
    Serial.print(“C2: “);
    Serial.print(Cap_2);Serial.print(“/”); // print sensor output  / Threshold
    Serial.print(HIGH_Thresh_2);
    if (Cap_2 > HIGH_Thresh_2) Serial.print(“*PROXI*”);
    else Serial.print(”       “);
    Serial.print(“\t”);                    // tab character for debug windown spacing
 
    switch (chk){
      case 0: Serial.print(“Temperature: “); Serial.print(Amb_Temp); Serial.print(” oC”); if (Amb_Temp > 38.0) Serial.println(“*TEMP*”); break;
      case -1: Serial.print(“Checksum ERR: data was received but may not be correct”); break;
      case -2: Serial.print(“Timeout ERR: communication has failed”); break;
      default: Serial.print(“Unknown ERR: this is the catch-all bucket … S.O.L. buddy”); break;
    }

    Serial.print(“\t”);                    // tab character for debug windown spacing
    Serial.print(“Solar Voltage: “);
    Serial.print(SolVolt, 2);
    if (SolVolt > 4.0) Serial.print(“*SUN*”);
    Serial.println();
  }
}

float avg()
{
  float sampleSum = 0;
  for(int i = 0; i < SAMPLES; i++) {
    s_val[i] = cs_DAD.capacitiveSensor(15);
    sampleSum += s_val[i];
    delay(1); // set this to whatever you want
  }
  float meanSample = sampleSum/float(SAMPLES);
  return meanSample;
}

float avg2()
{
  float sampleSum = 0;
  for(int i = 0; i < SAMPLES; i++) {
    s_val[i] = cs_BABY.capacitiveSensor(15);
    sampleSum += s_val[i];
    delay(1); // set this to whatever you want
  }
  float meanSample = sampleSum/float(SAMPLES);
  return meanSample;
}

void SendTXT()
{
      for(i=0;i<13;i++)
        Serial.print(str1[i]);//AT+CSCS=”GSM”  ==> It must be done this way due to double quotes
      Serial.println();
   
      for(i=0;i<21;i++)
        Serial.print(str2[i]);//AT+CMGS=”17788821867″  ==> It must be done this way due to double quotes
      Serial.println();
   
      Serial.print(“Baby may be in danger!”);
      delay(1000);
      Serial.print(hex1);
      delay(1000);
      Serial.println();
}

void LED_1_ON(){
  digitalWrite(LED_1, HIGH);       // turn on
  digitalWrite(LED_1+1, LOW);       //
}

void LED_1_OFF(){
  digitalWrite(LED_1, LOW);       // turn off
  digitalWrite(LED_1+1, LOW);       //
}

void LED_2_ON(){
  digitalWrite(LED_2, HIGH);       // turn on
  digitalWrite(LED_2+1, LOW);       //
}

void LED_2_OFF(){
  digitalWrite(LED_2, LOW);       // turn off
  digitalWrite(LED_2+1, LOW);       //
}

Arduino GSM Expandable Vehicle Connection Project


So I’ve completed my initial concept to check to see if all this works. It does! Really well too.

One thing to note, since I shorted the Arduino the last time, I went to Lee’s electronics the next day. Bought myself 2 Arduino’s this time. 

Turns out that I must have weakened the GSM shield. It worked perfectly well all the way up until I get to school and plug it in the outlet to get it ready for presentation… Uhh.

Back to Lee’s electronics to purchase another GSM board. Maybe this time I’ll get a proper 12 volt 3 amp power supply with a ground pin. VERY IMPORTANT! capacitance sensors must be grounded. When used to sense humans at a distance (3-5 inches) you need a reference voltage. The human body is at a fairly constant voltage compared to ground. A power source from the wall will vary without a reference, but with ground feedback. This variation is eliminated.
For the next post, I will upload my Arduino code.

Arduino GSM Expandable Vehicle Connection Project


So my newest project started as a School Industrial Design project. It is yet unfinished and will be forever a work in progress but I think posting it here may help someone with the difficulties of combining the Arduino with the GSM network.

So far I have an Arduino board, a linksprite GSM shield, an LCD, a temp sensor, a solar cell, 2 capacitance sensors (metal sheets), and 2 pots.

Yesterday, I shorted my arduino while making a custom board for all these sensors… I was sad. Mostly because I’ve been working hard trying to figure out the GSM board … I’ve even added my project as a contact in my phone book. This alone gave the project some life … I could text it, call it … Love it?

Today is a day off for me. My arduino is fried and my local electronics store is closed on Sundays.

Aperture portal gun (codename: project aperture)


So now that we’re so close to the finish line, it takes just a little longer to get things accomplished as you take just a few more moments to admire the almost-finished-product…
As a push to the finish, and also a matter of trying to respect building noise bylaws, I cut all the claw pieces out in one shot. I also do the drilling.
The claws are assembled using 10-32 socket heads with washers.
Once all the pieces are installed I add some silicone caulking to all the tabs to prep for painting
The paint seriously nails it! Right after the first coat of paint is done you realize: “holy sh*t, it actually worked”. Kinda like in home alone when Kevin realizes his wish came true and his family is gone … Except Better.
Happy Halloween!
And no portal gun is complete without it’s very own mini turret!

Aperture portal gun (codename: project aperture)


Once the molds were done, I proceeded to make the fiberglass shells.

I coated the mould with three layers of flour wax, then applied one generous layer of fiberglass resin (this is when you pray to the fiberglass gods that you don’t fuse it together)
I used about 2 to 3 layers of fiberglass and I rubbed in the resin with my fingers to make sure there were no air bubbles (this last part is seriously the most important part).
 Once all shells complete, I fitted them and trimmed to suit, attached them with industrial grade Velcro, and added some plywood tabs using epoxy.
 I
I added double sided screws with one side ground perfectly to fit the air compressor tubes I bought.
One claw was then tested using MDF. I wasn’t sure if it would be strong enough. Turns out it was.

Aperture portal gun (codename: project aperture)


This next step probably took about 2-3 weeks and was painful and arduous. The process is simple, using solidworks I printed cross sections of the shape, I was making, I even had the surface extended so that I could more easily work with the mold. One the cross sections were cut from foam, I used super 77 glue to glue the pieces together. It’s the only flute I could find that does not melt foam. After that it’s layer after layer of bondo then sanding, then bondo, then sanding, it really never ended…

For the front piece, I opted to start with a plug, then I made a mold from the plug. I did this so I wouldn’t have to sand a ridiculously concave structure.

Once my plug was fully sanded to a baby smooth 1000 grit wetsanding, I used floor wax (3 layers) to prevent the fiberglass resin from sticking to my plug. Worked like a charm. I even liked the texture it left on my mold so I didn’t even have any sanding left to do once the bondo was done.

DropBOB Designs is devoted to unique and handcrafted custom designs. A small scale business with grand ideas! A design & manufacturing service that keeps costs down by maximizing off-the-shelf components without affecting the ability to customize.