GPS shoes with wireless charging.
With these shoes you’ll always know where your family and you will not have to worry about charging the battery. Upon returning home the shoes will be reloaded thanks to wireless charging platform or placed inside the shoe !!!
This will make it possible to have a GPS hidden from prying eyes and through wireless charging recharge the battery contained in the shoe without any outlet.
Besides security it can be used as tracking of whole life !!
Step programming:
***********************************************************************
- Module GSM / GPS LoNet with Simcom Sim808 (about 51 EUR)
- 7100 – FT1235M Wireless Power Trasmitter + coil (38 EUR)
- 7100 – FT1236M Wireless Power Receiver + coil (18 EUR)
- ATMEGA328P-au (SMD) (about 3 Euros)
- 7 volt lithium battery 1000 MA (Product Code: 7893-PLIB1000) 6.90 EUR
- Reristor 1K
- Optional quartz oscillator 8 MHz and 2 capacitors capacity 18 microfarads
Documentation module Module GSM / GPS LoNet with Simcom Sim808:
http://wiki.seeedstudio.com/wiki/LoNet_808_-_Mini_GSM/GPRS_+_GPS_Breakout
http://www.elecrow.com/download/SIM800%20Series_AT%20Command%20Manual_V1.09.pdf
http://www.elecrow.com/download/SIM800%20Series_GSM%20Location_Application%20Note_V1.01.pdf
http://www.elecrow.com/download/SIM808%20SPEC_V1507.pdf
http://www.elecrow.com/download/SIM800%20Series_GNSS_Application%20Note%20V1.00.pdf
Documentation relating to the 7100 form – FT1235M
http://www.futurashop.it/Wireless-Power-Trasmitter-7100-ft1235m-idt
Documentation relating to the 7100 form – FT1236M
http://www.futurashop.it/Wireless-Power-Received-7100-FT1236M-idt
Documentation relating to ATMEGA328P-au chip
http://www.atmel.com/devices/ATMEGA328P.aspx
Documentation relating to the lithium battery 3.7 volt 1000 MA
The programming of ATMEGA328P chip is made using the Arduino Ide program downloaded from the site https://www.arduino.cc/
The chip is programmed via ISP interface using an Arduino Board and ArduinoISP firmware. For the first programming is required the presence of quartz, then eventually you can remove and use the internal resonator modifying their fused programming.
boards.txt
##############################################################
atmega328GPS.name=ATmega328 on a breadboard (8 MHz internal clock)
atmega328GPS.upload.protocol=arduino
atmega328GPS.upload.maximum_size=32768
atmega328GPS.upload.speed=57600
atmega328GPS.bootloader.low_fuses=0xE2
atmega328GPS.bootloader.high_fuses=0xDF
atmega328GPS.bootloader.extended_fuses=0x07
atmega328GPS.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328GPS.bootloader.unlock_bits=0x3F
atmega328GPS.bootloader.lock_bits=0x0F
atmega328GPS.build.mcu=atmega328p
atmega328GPS.build.f_cpu=8000000L
atmega328GPS.build.core=arduino:arduino
atmega328GPS.build.variant=arduino:standard
atmega328GPS.bootloader.tool=arduino:avrdude
atmega328GPS.upload.tool=arduino:avrdude
********************************************************************
The speed of 8 MHz which allows high energy savings compared to normal speed. Sending the GPS position is via SMS and is activated by a call to the module, which recognizes the caller’s number and send the battery status and its location.
The achievement of 100% of the battery charge, the GPS module sends the state of the end of charge “2” to the atmega chip, that will take care of the GPS module off, it remains disabled until it moves away from the base of the GPS system charging.
/* Wireless power contest
*
* *GPS By SCHRANZ Gilio versione 1.0 beta
*
*/
//myserial per debug
#include <SoftwareSerial.h>
SoftwareSerial mySerial(12, 11); // RX(mosi), TX(miso)
int onGpsPin= 6;//Pin di accensione modulo gps attivo low per 2 secondi
int RiGpsPin= 4;//Pin RI modulo gps
int onWirelessENPin= 17; // pin pc3 Wireless pin en
int onWirelessSTATPin= 16; //pin pc2 Wireless pin stat
int onWirelessINTPin= 15; //pin pc1 Wireless pin int
int onWirelessCHGEPin= 14; //pin pc0 Wireless pin chge
uint8_t risposta=0;
//Posizione modulo on Wireless charge
int valore_stat=0;
int flag_chiamata_stat=0;
char sms_string[30];
int flag_chiamata = 0;
char number [20];
char realnumber[13];
//Numero di telefono abilitato
char mynumber[]=”+39***************”;
//Buffer contenente i dati ricevuti dai satelliti
char frame[200];
//Stringa contenente la latitudine
char latitudine[30];
//Stringa contenente la longitudine
char longitudine[30];
//Stringa contenente la data di rilevazione
char ora[30];
char fix[0];
//char response[100];
uint8_t x=0;
int a=0;
int b=0;
int c=0;
//Imei
char imei[15];
//Stato Batteria
char *Stato_Carica;
char Percentuale_Carica[3];
void setup() {
//settaggio pin
pinMode(onGpsPin, OUTPUT);
digitalWrite(onGpsPin,LOW);
pinMode(RiGpsPin, OUTPUT);
digitalWrite(onGpsPin,HIGH);
pinMode(onWirelessINTPin, INPUT_PULLUP);
pinMode(onWirelessSTATPin, INPUT_PULLUP);
//pin chge ft1236
pinMode(onWirelessCHGEPin, OUTPUT);
digitalWrite(onWirelessCHGEPin,LOW);
pinMode(onWirelessENPin, OUTPUT);
digitalWrite(onWirelessENPin,LOW);
//seriali
Serial.begin(9600);
mySerial.begin(9600);
power_on();
//modalita SMS ASCII
risposta = 0;
while(risposta == 0){
// comando AT per controllare che il modulo sia acceso
risposta = sendATcommand(“AT+CMGF=1rnrn”, “OK”, 2000);
}
//modalitta lettura SMS ASCII in arrivo
risposta = 0;
while(risposta == 0){
// comando AT per controllare che il modulo sia acceso
risposta = sendATcommand(“AT+CMGF=1rnrn”, “OK”, 2000);
}
//attiva la modalità clip con visualizzaione del numero chiamante
risposta = 0;
while(risposta == 0){
// comando AT per controllare che il modulo sia acceso
risposta = sendATcommand(“AT+CLIP=1”, “OK”, 2000);
}
//attiva gps
sendATcommand(“AT+CGNSPWR=1”, “OK”, 2000);
sendATcommand(“AT+CGNSSEQ=RMC”, “OK”, 2000);
//richiede imei
get_imei();
}
void loop() {
/*controlla lo stato della batteria quando carica spegne il modulo gps-gprs
* appena si allontana dalla wireless charge il modulo gps viene riattivato
*/
stato_batteria();
//legge il pin STAT per verificare se il dispositivo è sopra la wireless charge
valore_stat = digitalRead(onWirelessSTATPin);
mySerial.println(“Valore pin Stat”);
mySerial.println(valore_stat);
// se zero è sopra la wireless charge
if ((valore_stat == 0 )&&(flag_chiamata_stat==0)){
flag_chiamata_stat=1;
}
if ((valore_stat == 1 )&&(flag_chiamata_stat==1)){
power_on();
flag_chiamata_stat=0;
}
// controlla l’arrivo di una chiamata
risposta = 0;
risposta = sendATcommand(“”, “+CLIP: “”, 2000);
if (risposta == 1)
{
mySerial.println(“Chiamata in arrivo”);
if ( flag_chiamata == 0){
for (int i=0; i<14; i++){
while (Serial.available() == 0)
{
delay (50);
}
number[i] = Serial.read();
}
Serial.flush();
flag_chiamata = 1;
}
strcpy(realnumber,number);
//Controlla il numero
for (int i=0;i<13;i++){
if (realnumber[i] == mynumber[i]){
a++;
if( a==13){
mySerial.println(“Numero corretto”);
sendATcommand(“ATH”, “OK”, 1000);
if(b==1){
mySerial.println(“al b”);
b=0;
}else{
mySerial.println(“al c”);
b=1;
c=1;
}
break;
}
}else{
mySerial.println(“Numero errato”);
break;
}
}
a=0;
risposta=0;
flag_chiamata = 0;
}
//invio sms
if (b==1){
get_GPS();
//send_HTTP();
delay(500);
//if (c==1){
mySerial.println(“fixxxxxxx”);
mySerial.println(fix);
if (strstr(fix, “1”) != NULL) {
mySerial.println(“invio smss”);
sendSMS();
delay(5000);
b=0;
//}
}
}
}
/*
Procedura di accensione del modulo
*/
void power_on(){
mySerial.println(“Attivazione Gps”);
uint8_t risposta=0;
// verifica se il dispositivo risponde al comando
risposta = sendATcommand(“AT”, “OK”, 2000);
if (risposta == 0)
{
digitalWrite(onGpsPin,HIGH);
delay(2000);
digitalWrite(onGpsPin,LOW);
delay(3000);
digitalWrite(onGpsPin,HIGH);
delay(15000);
while(risposta == 0){
// verifica se il dispositivo risponde al comando
risposta = sendATcommand(“AT”, “OK”, 2000);
}
}
}
/*
Funzione stato batteria
*/
int8_t stato_batteria(){
int8_t counter, risposta;
long previous;
while( Serial.available() > 0) Serial.read();
risposta = sendATcommand(“AT+CBC”, “+CBC: “, 2000);
counter = 0;
risposta = 0;
memset(frame, ”, 100);
previous = millis();
do{
if(Serial.available() != 0){
frame[counter] = Serial.read();
mySerial.print(frame[counter]);
counter++;
if (strstr(frame, “OK”) != NULL)
{
risposta = 1;
}
}
}while((risposta == 0) && ((millis() – previous) < 2000));
frame[counter-3] = ”;
Stato_Carica=strtok(frame,”,”);
strcpy(Percentuale_Carica,strtok(NULL,”,”));
//Percentuale_Carica=strtok(NULL,”,”);
mySerial.println(“Stato_Carica”);
mySerial.println(Stato_Carica);
mySerial.println(“Percentuale_Carica”);
mySerial.println(Percentuale_Carica);
if ((strstr(Stato_Carica, “2”))!= NULL)
{
//spegne il modulo gprs-gsm
//AT+CPOWD=1
mySerial.println(“Carica completa disattivo il modulo gps”);
risposta = sendATcommand(“AT+CPOWD=1”, “AT+CPOWD=1”, 2000);
}
else{
//attiva la ricarica wireless
}
return risposta;
}
/*
Richiesta imei dispositivo
*/
void get_imei(){
int8_t counter, risposta;
long previous;
while( Serial.available() > 0) Serial.read();
risposta = sendATcommand(“AT+GSN”, “AT+GSN”, 2000);
counter = 0;
risposta = 0;
memset(frame, ”, 100);
//tempo di servizio
previous = millis();
// Finche non riceviamo i dati
do{
if(Serial.available() != 0){
frame[counter] = Serial.read();
mySerial.print(frame[counter]);
counter++;
if (strstr(frame, “OK”) != NULL)
{
risposta = 1;
}
}
}while((risposta == 0) && ((millis() – previous) < 2000));
frame[counter-3] = ”;
//serve per spezzare una stringa s in base a dei
//caratteri di separazione.
//char *strtok(char *s, char *sep);
strcpy(imei,frame);
}
/*
Funzione di ricezione dei dati gps dal satellite
*/
int8_t get_GPS(){
int8_t counter, risposta;
long previous;
// Pulizia buffer
while( Serial.available() > 0) Serial.read();
// comando AT per richiedere i dati
sendATcommand(“AT+CGNSINF”, “+CGNSINF: “, 2000);
counter = 0;
risposta = 0;
memset(frame, ”, 100);
previous = millis();
do{
if(Serial.available() != 0){
frame[counter] = Serial.read();
counter++;
if (strstr(frame, “OK”) != NULL)
{
risposta = 1;
}
}
}while((risposta == 0) && ((millis() – previous) < 2000));
mySerial.println(frame);
frame[counter-3] = ”;
//primo dato non usato
strtok(frame,”,”);
//salvo fix
strcpy(fix,strtok(NULL,”,”));
//salvo data
strcpy(ora,strtok(NULL,”,”));
//salvo latitudine
strcpy(longitudine,strtok(NULL,”,”));
//salvo longitudine
strcpy(latitudine,strtok(NULL,”,”));
mySerial.println(fix);
mySerial.println(ora);
mySerial.println(longitudine);
mySerial.println(latitudine);
return risposta;
}
/*
Procedura di invio sms
*/
void sendSMS(){
//Controllo la rete
while( (sendATcommand(“AT+CREG?”, “+CREG: 0,1”, 500) ||
sendATcommand(“AT+CREG?”, “+CREG: 0,5”, 500)) == 0 );
mySerial.print(“SMS mode text”);
sendATcommand(“AT+CMGF=1”, “OK”, 1000); // sets the SMS mode to text
mySerial.println(“Invio SMS”);
sprintf(sms_string,”AT+CMGS=”%s””, mynumber);
risposta = sendATcommand(sms_string, “>”, 2000); // send the SMS number
if (risposta == 1)
{
Serial.print(“Capacita batteria=”);
Serial.print(Percentuale_Carica);
Serial.print(“nr”);
Serial.print(“https://www.google.com/maps/@”);
int i = 0;
while(longitudine[i]!=0){
Serial.print(longitudine[i]);
i++;
}
Serial.print(“,”);
i = 0;
while(latitudine[i]!=0){
Serial.print(latitudine[i]);
i++;
}
Serial.print(“,17z”);
Serial.write(0x1A);
risposta = sendATcommand(“”, “OK”, 20000);
if (risposta == 1)
{
mySerial.print(“Invio “);
}
else
{
mySerial.print(“Errore “);
}
}
else
{
mySerial.print(“Errore”);
mySerial.println(risposta, DEC);
}
}
/*
Procedura di invio comando AT
ATcommand = comando da inviare
expected_risposta = risposta che si aspetta dal modulo
timeout= tempo massimo di risposta
*/
int8_t sendATcommand(char* ATcommand, char* expected_risposta, unsigned int timeout){
uint8_t x=0, risposta=0;
//buffer di risposta
char response[100];
unsigned long previous;
//Inizializza buffer risposta
memset(response, ”, 100); // Initialice the string
delay(100);
//Pulisce il buffer serial
while( Serial.available() > 0) Serial.read(); // Clean the input buffer
if (ATcommand[0] != ”)
{
//Invia il comando AT al serial
mySerial.println(ATcommand); // invia seriale di debug
Serial.println(ATcommand); //
}
x = 0;
previous = millis();
//Aspettiamo la risposta
do{
if(Serial.available() != 0){
response = Serial.read();
x++;
if (strstr(response, expected_risposta) != NULL)
{
risposta = 1;
}
}
}while((risposta == 0) && ((millis() – previous) < timeout));
mySerial.println(response);
return risposta;
}