Académique Documents
Professionnel Documents
Culture Documents
While playing with it one day, our forklift driver suddenly dumps a crate nearby
(loaded with heavy cooling cylinder), suddenly as the mercury danced like a sea
wave an idea came to me, “Why not make it a vibration or motion monitor for car?”
Surfing the web lead me to the ATROX web site of ADRIAN DABROWSKI. Definitely
one of the benefits of the Internet, it's capability to search information from many
sources. I discovered the NOKIA 6210 has an internal modem and you can
communicate to it using the well-known AT COMMANDs. I have a 6210! So enthused
with the possibilities I constructed the DLR3. I strongly suggest you visit the site
before trying to build this project.
I will spare you the frustrations I encountered during construction and learning the
AT COMMANDs, suffice to say hyper terminal was involved! Instead let’s go direct to
the PIC to DLR3 to SLAVE phone trials.
Note
I used a 16F876 running at 4 MHz and a 2x40 LCD during this trials
After setting Declares and set the baud to 9600 (standard communication baud rate I
supposed). I send HSEROUT [“AT”, 13] and the phone answered with
AT13101310“OK”1310.
1
Where 13 is Carriage Return and 10 is the Line Feed
Perfect! The PIC communicates with the phone and displays it to my LCD.
I then change the crystal to 20 MHz, and the phone communicates up to 115200
without any problem.
AT+CMGR=1^^*+CMGR:
1,,26^*0791695650309299040C91695620141006000040906
11132602107D0E493F904C500^*^*OK^*
Where ^ is CR, * is LF (I wrote the ^* to make it easier to read)
AFTER A WEEK:
Here’s the AT COMMAND used in this project
AT+CMGF=0 ………………………………… Instruct the phone to use PDU Mode
AT+CMGF=1 ………………………………… Instruct the phone to use TEXT
Mode
AT+CMGW=1 ………………………………… Write message at Sim memory
location 1
AT+CMGR=1 ………………………………… Read Sim memory location 1
AT+CMSS=1,”Phone number”,129 …………… Forward message located in Sim
memory 1
AT+CMGD=1;+CMGD=2 ……………………. Delete Sime memory location 1 to 2
AT+CBC ………………………………………. Check Phone Battery Status
For security reason and to make it user friendly, I decided to make the SET-UP via
SMS messaging and dropped the idea of using Push button for entering mobile
numbers, passcode… etc…..
2
Now the SLAVE_PHONE and DLR3 start sending MBUS-frames to each other.
Once a connection is established, the MBUS LED starts to blink to show that the
SLAVE_PHONE and DLR3 are on-line. On the background, the MASTER_PIC, that
is monitoring the presence of the SLAVE_PHONE, will blink the BI-LED when a
connection is established via FBUS. Once a link is establish between the
MASTER_PIC and the SLAVE_PHONE, the MASTER_PIC start to delete the
SLAVE_PHONE SIM card starting from memory location 1 and 2. This location is
reserve for tracking the incoming USER COMMAND messages.
NOTE: Sending the DEFAULT PASSCODE will always update the Mobile number
regardless whoever send the PASSCODE, and others can control it. To avoid this
please read the next step.
The next step to do is change the default PASSCODE. Otherwise I know your
PASSCODE! Lol!
ARMED ALARM ………. This will Armed SmartCarBuddy and enable sms
messaging.
DISARMED ALARM…… This will Disarmed SmartCarBuddy and disable sms
messaging
RELAY ON ……………… This will energized the onboard relay
RELAY OFF…………….. This will de-energized the onboard relay
XXXXXXXX NEW ……… This will change your passcode. Where X is your new
passcode. (Combination of Capital or Small letters and numbers are accepted)
SLDR SETUP …………….. This will change the Default parameters
Where (S) Scan Delay of tilt switch [3SEC DEFAULT]
(L) Long Alarm Delay [6SEC DEFAULT]
(D) Danger Status Counter [3 DEFAULT]
(R) Relay Function (0 DEFAULT)
Example: 4520 SETUP
|||| |
| | | | Inform SmartCarBuddy this is a Setup Command
| | | Auto or Manual RELAY function … (see Table 1)
| | Danger Status (How many short alarm before activating the Long Alarm)
| Duration of Long Alarm
Scan Delay (This is the duration after each Short Alarm)
3
GEBARU ………………… See related explanation
DEFAULT ……………….. Set to original setting
Don’t forget that all the User Commands including the “NEW” of Change Passcode
are all in capital letters and no trailing or leading white space character(s).
To change the PASS CODE send an 8-character passcode (including space) followed
by “NEW”
Note: Pass Code is case sensitive. “NEW” should be always in capital letter.
mymobile(space)NEW
4
If you forgot your PASSCODE! Hmmnnn, you’re too old! Lol!
Send “GEBARU”
SmartCarBuddy will send you back your forgotten PASSCODE, again if your mobile
number is registered.
If you find yourself going somewhere, just type DEFAULT and all the default setting
are set.
Actually the MASTER_PIC read the message from the SLAVE phone, filtered it (see
below) and extracts the last 8 byte of the message in PDU Mode, and the
MASTER_PHONE number in text mode. Then compare the MASTER_PHONE
number if it is a valid user. If valid, the MASTER_PIC compare the extracted 8 byte
(User command) and is executed as requested. I supposed that that is the right
approach and it looks more professional rather than compare it in TEXT mode. (IF
HELLO=HELLO THEN…)
Unfiltered received message in PDU FORMAT: (CR = ^ , LF = * )
AT+CMGR=1^^*+CMGR: 1,,26^*0791695650309299040C91695620141006000040906
11132602107D0E493F904C500^*^*OK^*
In TEXT Mode
1111111111222222222233333333334444444444555555555566666666667777777
01234567890123456789012345678901234567890123456789012345678901234567890123456
+CMGR: "REC READ","+966502410160",,"04/09/16,11:23:06+12"*^PIOLO V1*^*^OK*^###
| |
Mobile Number Message
The unit continuously monitors the SENSORS for any untoward vibrations. Next the
INBOX memory location 1 of SLAVE_PHONE is check for a presence of new
message (SMS). If the message is too long, the MASTER_PIC will treat it as an
invalid message and delete it from the inbox including memory 2. This is to insure
that the first 2 memory of the SLAVE_PHONE SIM card is always clear for incoming
sms messages. I say 2-memory location because new generation mobile phone now
can send 4 pages of SMS. And you don’t want your mobile to be flooded with SMS.
That is when you use an old sim card and your unaware friends send you a bulk of
messages. Most often I receive a message mainly by mistake or some promotions from
the network. That’s cleared the issue.
5
WHEN ARMED:
The SIREN will activate in 1 sec interval when the sensors status change within the
predefined period set by the parameters , and a COUNTER start to increment. If the
disturbance disappeared before the COUNTER reach the maximum count, the
COUNTER is reset to zero and back to normal scanning. But when the COUNTER
reach the max count (Set by parameters) , the unit goes in danger status and sound
the SIREN for 6 seconds and send a message to the user. “ALERT! DANGER
STATUS!”
Now it is your decision what step you should do after receiving the ALERT
MESSAGE.
TIP: You can activate the onboard relay… say … connected to your Car Ignition
relay or Head Light and Horn. Or maybe connected to a Stun Gun. Or you may
deactivate the alarm by issuing “DISARMED ALARM”, leaving your car without
protection. The choice is yours.
We can use Class 0 and Flashing Message of PDU Format, but due to limited
memory of the PIC I used, we cannot implement it here. Flashing messages will
double the length of the message.
What a nice SET-UP. All you have to do is connect it to a car battery, connect
your SLAVE_PHONE, and send your Passcode and Parameters. All the set-up is
done by the MASTER_PIC. It will even monitor the SLAVE_PHONE battery and
remind you via sms when the battery is in critical level. The next time you connect a
SLAVE_PHONE, SmartCarBuddy acts like a Plug And Play Unit.
Well! That’s all! Who say’s Mobile Phones are for Human’s only. It can be a SMART
CAR BUDDY. This project could not be made possible without DLR3 cable. Mbus
protocol is way beyond my capability for the time being. And of course, without a
genuine compiler, life won’t be easier and that is PROTON PLUS V2.1.5 of
CROWNHILL ASSOCIATES.
CONTACT: dc@atrox.at
Adrian wrote: QA
Can I copy your Site for my own?
Please write a small summary on your Site (if you like) and link for the rest to me.
I've spent a lot of time in investigating and testing the whole matter. Honor it that
way. Thank you.
6
FAULT FINDING
IF NO COMMUNICATION LINK:
I make the PCB using the old version of Number One System, EASYPC for DOS
and Orcad V10. Email me if you want the hardcopy.
a_balina@hotmail.com