Category Archives: arduino

RFID On Arduino

So I got myself an Arduino powered Android Accessory Development Kit, not long ago. The kit have quite a lot of sensor, one of them, an 125kHz RFID reader. Which is cool except, the kit doesn’t comes with the tag necessary. 

So I finally got the tag(s) which is compatible. The reader from seeestudio have 2 ways to interface with the arduino, one is via Wiegand Mode, the other via UART, i.e Serial. 
I just use UART, because one the board is actually a Arduino Mega, so I got enough hardware serial to use. And I am using the extension board, so It make it way easy to use the extra hardware serial. But if you are just using an arduino, the Reader is actually pretty easy to use via Software Serial using NewSoftSerial library. Easier if you are using the UART version of this
Originally I thought of just forwarding the ID from the tag into a serial without any translation. From the docs, there is a checksum that we can use. It do make using an arduino as a middleman not so wasteful. It also define an header and ends, which can also be used to track error etc. 
From the docs, I have create a reader, the code is in https://gist.github.com/1626692
This is just a very early version, hacked within 15 minutes. So it don’t check the checksum, etc. 
You can check the result using the serial monitor, it just output the code as I swipe it on the reader itself, 
This reader can read one tag at a time unlike the commercial one, where the tag have random delay to make reading multiple tag possible. This is a pretty cheap, like 13USD, cannot really compare with the really big commercial one. And the distance is short too, like 8 cm. 
Despite that, it can be a fun toy to play with, not quite sure what I am going to do with this though. More to come(?)

The Great Global Hackerspace Challenge

Not long ago, Me and the Hackerspacekl gang, join The Global Hackerspace Challenge. Basically we build a Arduino Shield that process words.

Actually the whole process is best viewed on the hackerspacekl blog.
http://www.hackerspace.my/category/projects/the-story-box

In summary, here is what we learned.
– K.I.S.S, Keep It Small and Simple
The Atmega168 have only 16KiB of memory which the code itself taken half of it. and it is slow, it runs on such a speed 16 MHz. Modern computer is around 2 GHz. It better be simple, because debugging is hard.

– Serial is your best friend (on arduino anyway)
Unlike programming on PC or Web app. There is no print function to be used to debug, there is no debugger either. Even we have a LCD, it is not reliable. And serial pretty much built into the arduino board. So USE IT.

– Optimization matters
On dynamic language like python, or more modern language like java. There is garbage collector, even c/c++ have OS to help on that. So one don’t need to worry about memory issues. But on arduino, removing unused code and code, and save a lot of memory.

– One need to think very low level.
The I2C to eeprom code is about  shifting bits/bytes to write to the EEPROM. For once we are thinking in bytes. And we need to know a bit of hardware, to write the code properly.

Overall, it is fun and a interesting experience. For a programmer that spend time on python, or doing web development. Opening one eyes to embedded programming a bit, a little bit of experience that meant a lot to me.

When Python talk to Arduino

Yesterday I show a code where when we send a ‘t’ via serial connection, the LED will blink while the arduino board, send back a series of string via serial, the code below is what I used to run on arduino, to test with the python code.
link

In the arduino development environment, there is a serial monitor that do the the testing.

Since it is just a standard serial interface, so one can just do it anyway they want. Here I show how to do it via python. First what we need, is the pyserial library, you can install it using pip or easy_install or grab it from pyserial site

To install, just use to following command. if you need more detail, read the docs, because I use python 2.7 it just works for me,

pip pyserial

or

easy_install pyserial

To use it, with the arduino code from the top of the page just, do the following
link

The line s=serial.Serial(2) points to com3 on windows, on linux it should be s=serial.Serial(‘/dev/ttyUSB0’), or other port that shown by the arduino serial monitor. Pyserial actually have a few options on the Serial object, but I found that for arduino, the default is adequate.

And this is how to use arduino to interface to your computer using python. enjiy

Confession of a arduino newbie

So one of the side effect of hanging around with hackerspacekl too much is, one begin to develop feeling toward hacking hardware… Which in one of my post shows their project creating their own arduino severino.

I got myself freeduino thanks to Kakeman, our resident hardware guru in hackerspacekl. It is not the latest, but it is good enough. After following the tutorial, I begin to feel to blink a LED, which built into the board
link.

Then I play around with the serial library,
link

In the end of the day it is fun, much before I continue, I need to find time to get a breadboard and more components, like LED,transistors, resistors etc, to make more stuff. Think i am going to play with this for a long time to come

arduino’s from #hackerspacekl open hardward ftw

So today I go to hackerspacekl which is a awesome place. One of their project now involving arduino. And they making their own. For the rest, I allow the pictures to do the talking. Check the links too

off the shelve components, from pasar rd
prepare acids, for etching, 
schematic from arduino websites
now you etch it, before that you need a laser printer
after that based on schematics, solder it
now you get a arduino
Components RM55, Solder with own hand free. Having a hackable hardware, priceless