Saturday, November 27, 2010

Arduino Meets Android (via WiFi)

Here's another simple project for Android control of Gizduino. TCP/IP shield using ATC1000M was used.



Here's a short video of LED Blinker Control of Gizduino via Android.

Arduino Simple Source Code

Python for Android Source Code

Saturday, November 20, 2010

ATC-1000M (TCP/IP to UART) Step by Step Guide -- (a Gizduino TCP/IP Shield)

Here is a E-Gizmo TCP/IP Shield which is powered by ATC-1000M, which will be covered in this post.



(the green circle shows that the RX and TX are shorted, for loopback testing)

Here is the procedure from setting the static IP up to hyperterminal loopback testing. (Connection: PC —LAN cable–ATC1000M)

ATC-1000M Loopback Setup and Test Video


Here is a C# test program:



Here is the complete source code in C#.

If the ATC-1000M is planned to be used over wifi, check the IP Address and Gateway of the ATC-1000M via the web configuration and make the necessary adjustments (if needed).

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/