Κυριακή 30 Απριλίου 2023

Klx230SM-ProMini-Sim800L-NEO-6-Gps

 The fact that europe does not allow us (euro 5 etc..) to have
klx 230 sm
may offer me the time to develop a MINIMAL and effective system in case
that in the future ...i will be able to buy such a perfect (for me) motorbike!!!










Arduino Pro Mini Project.
-We need to be able to Find the gps location of our motorbike in case of bad peopling ...
-We dont need a motion/gyroscope detector(6050) because ....?...
-So we need only gps module , a sim800l and a micro processor...


Estimated cost
15 ,3AA rechargable batteries
8 pro mini
12 sim800l
10 neo6 gps
10(box,wires,solers, breadboard,pins ,on/off button)
10 for 2 relays
10 for voltage regulator @(4.1 vols)

~~~~~
about 75 euros per device....
Advantages
-Low cost (do it yourself) devise
-no yearly expenses just one sim phone card(10 prepaid euros for ...1 year?)
..to send gps loc on thingspeak
 

Disadvantages
-Too much power consumption(need minimized)
-Device must be in a well hidden place but easy to on/off and change batteries
-If device is static when motorbike runs....then do vibration damage electronics in the long run
(especially for someone on wheelies!)?
-be so stupid that you uploading this online(disadvantage for me only!)

Main concept
-Power on
-Find and Hold Gps Location (Home)
-May or may not set up as to inform user by thingspeak update or and call to some phone number
-User can go sleep
-Check every 10(or any other) minutes if we are on same location with some tolerance
-If same location...deep sleep
-If not...then first of all make a call 
-And every 2(or other to minimise battery consumption) minute
Update gps location on thingspeak
---till battery dies !!!!
Maybe better to update every 2 minutes 2 times in 10 seconds just to know also if thief is moving?

Till have my neo6 gps module...just building a sceleton....




---------------------------

learning things....till do it!


Smartphone and Cellular Phone Antenna Design (antenna-theory.com)

https://www.emnify.com/iot-glossary/lte-cat-1







https://content.u-blox.com/sites/default/files/products/documents/u-blox-eCall_WhitePaper_%28MNS-X-11005%29.pdf

SIM808 has intergrated gps...!!!

5G positioning

u blox white paper

This is like what i want but i am focusing just till Thingspeak SIM800L GPS Tracker | Send GPS Data To Server Using Arduino and PHP

https://forum.arduino.cc/t/gps-module-power-management/477859

--------------------------



int xlocHome,ylocHome,zlocHome;
int xlocCurr,ylocCurr,zlocCurr;
int xdif,ydif,zdif;
int xabsdif,yabsdif,zabsdif;
int distTolerance=1;
bool stillHome=true;
void checkStillHome(){
  xdif=xlocCurr-xlocHome;
  if(xdif<0){xabsdif=-xdif;}
  else{xabsdif=xdif;}

  ydif=ylocCurr-ylocHome;
  if(ydif<0){yabsdif=-ydif;}
  else{yabsdif=ydif;}
 
  zdif=zlocCurr-zlocHome;
  if(zdif<0){zabsdif=-zdif;}
  else{zabsdif=zdif;}

  stillHome = (xabsdif<distTolerance)&&(yabsdif<distTolerance)&&(zabsdif<distTolerance);
 
}
long lastMillisTookedForNewLocation;
void settingUpGps(){
  gpsRelayOpen();
  long millisStart=millis();
  prepareGps();
  gpsUpdateCurrLocation();
  long millisEnd=millis();
  lastMillisTookedForNewLocation=millisEnd-millisStart;//may need this for thingspeak field while builing project /or/and to adjust checkingMillis perfectly
  gpsRelayClose();
}

void settingUpSim(){

}
void settingUpTheApplication(){
  settingUpGps();
  settingUpSim();
}
void readCurrLocation(){

}
void settingUpInitialHome(){
  //open sim and gps relay
  readCurrLocation();
  xlocHome=xlocCurr;
  ylocHome=ylocCurr;
  zlocHome=zlocCurr;
  simRelayOpen();
  sendLocationToThingspeak();//primary way to know we are up and running(minimum systems is working fine)
  makeACall();//secondary way may be disabled
  simRelayClose();
}
void setup() {

  settingUpTheApplication();
  //stillHome=true;
  //open gps relay ,check gps is working,get current loc save it to ram
  //close gps relay
  //open sim relay ,check sim is working and send location to thingspeak
  //close sim relay



}

void deepSleep(byte minutes){

}
byte checkingEveryMinutes=10;
void loopJustCheckingLocation(){
  deepSleep(checkingEveryMinutes);
  //open gps relay ,check gps is working,get current loc


}
void loopAlarmOn(){

}


void loop() {
  // put your main code here, to run repeatedly:
  if(locationSame){
    loopJustCheckingLocation();
  }
  else{
    loopAlarmOn();
  }
}