Tuesday, November 16, 2010

E-Gizmo's Sim900D Modem

This is a very nice product from E-Gizmo.

Some GSM modems doesn't have a Sim Toolkit Command which is used to access the Sim Menu. This is one of its major selling point + it's easiness to connect with a microcontroller.

You can also hook-up earphone and microphone to be able to send/receive calls.

The serial output is TTL-level of near 3V. This can be interfaced to a microcontroller directly (with consideration to the TTL voltages). And all transactions are done via AT command.

All documents can be downloaded from SimCom.

Regular Expressions (RegEx)

This is a very powerful feature of a programming language (although not all programming languages have this feature). Some programmers use it and some are not aware of it (most of my friends don't know this yet). The following is just a simple example/demonstration of using a regex.

Python will be used for the following example.

We have a component naming on the schematic wherein there is a string and number (no spaces in between) e.g. IC1,D1,D3,R1, how do we split the number and the string and display them separately (or put the two splitted fields in two separate variables)?

MyString="IC1"
....... process .....
StringPart="IC"
NumberPart="1"


First Approach using conventional for-loop and if statements.

Using Regular Expression, I can do it this way.

Very short code right?

But python has this comprehension list which can do that as well. Take a look at this short source code using comprehension list.

Lists comprehension is a good way for this as well, but how if the string becomes, [string1][number1][string2][number2] (e.g. IC1D1)? This will be much trickier to extract using conventional methods. Here is the code using regex.

It really takes time and dedication to harness the full power of Regex, but learning it gives us another weapon in our arsenal. :)

Monday, November 15, 2010

Bus Pirate Writing/Reading ---> MMC Card

Here is a script for Serial Command Script Processor for quick prototyping and to speed up trial-and-error experiments for reading and writing to MMC card.



Command Script for the MMC Writing and Reading. link

Here is the result. (Copy and paste it into a word processing to eliminate horizontal scrolling.)

Thanks to this site: http://nada-labs.net/2010/using-the-buspirate-with-a-sd-card/

Saturday, October 2, 2010

E-Gizmo's RFID Kit

Here is an RFID kit I bought from E-Gizmo.



Stand-Alone Mode

On Stand-alone mode, if the card isn't recognized, it will beep twice. If the card is recognized, it will beep once.

To Erase:
1. Set the DIL switch to select the location.
2. Then press Erase button. The D3 LED will light shortly to signify that the any registered card is erased on the location.

To Register the Card:
1. Set the DIL switch to select the location.
2. Press and hold (for around 1sec) then release the Set button.
3. The D3 will blink continuously. The put the card that needs to be registered near the RFID kit. It will beep once, denoting that the card is successfully registered.

Up to 16 RFIDs can be stored in stand-alone mode.

Interfaced to PC

If interfaced on PC, the cards are not needed to be registered on the kit. All the validations are done on the PC side.

Here is a short Python Script that I created to read the RFID's response of the card that was shown on the picture above. (Any PL that has an access to Serial port will do, I just used python for rapid prototyping) :)

Output:
0x41 0x7d 0xff 0xdc 0xe8 0xe7 0x1b 0x87 0xfb 0x42

Here is the output on another card:
0x41 0x7d 0xff 0xdc 0xe8 0xe4 0x46 0xa7 0xfb 0x42

The 0x41 at beginning and 0x42 on end, denotes the start and end of the frame. The 8-bytes inside are needed to be processed by the PC.

This RFID is very easy to use. :)

Sunday, August 22, 2010

AT Command Script Processor... Enhanced and Renamed!



The AT Command Processor was renamed to Serial AT Command Processor. It has been featured on the Dangerous Prototype.

This software was used for creating AT Command Scripts for USB Huawei E160E HSDPA Modem and GSM/GPRS Sim900D Modem.

But later I realized the it can also be used on Dangerous Prototype's Pirate Bus, which is a very powerful tool especially for us hobbyists.

Download Link: Serial AT Command Processor


- includes sample script for AT command and Bus Pirate Sample script


Update as of 8/9/2015:  The source code and the link for the Windows executable and sample scripts are placed here

Saturday, August 14, 2010

AT Command Script Processor

Last week, I am creating a software for GSM module. The debugging of the AT command is usually done via Hyperterminalbut I got tired of typing series of AT commands via Hyperterminal. I tried looking on the web for some kind of AT Command Script Processing to be able to execute series of AT commands repeatedly but found none.

So I created an AT Command Script Processor written in C# (Visual C# 2010 Express Edition).



Here is the download link. (Current version as of this writing is 00.08.01 Alpha Release)

Included are two files: the application and a sample script file.

The script file formatting is like this:
AT Command| Get Response (bool)| Delay| Comment
Example#1:
AT|TRUE|1000|Send AT then delay for 1 sec then get data
This example wait for the reply from the GSM modem.

Example#2:
AT|FALSE| 1000|Send AT then delay for 1 sec
This example doesn't wait for reply from the GSM modem.

Update as of 8/9/2015:  The source code and the link for the Windows executable and sample scripts are placed here.

Sunday, May 16, 2010

Dangerous Prototypes

Here is a very good site for open-source projects: Dangerous Prototype. It's a very nice and educational site especially for us electronics hobbyists :)