everhack Stuff I've been messing with, or just thinking about.

22Jun/110

avr rfids, take 1.5….

I spent a few hours reading about 125k antenna formulas and designs to try and better understand the relationship between desired frequency, loops of wire, wire gauge, and the value of the tuning capacitor.

Microchip AN678 RFID Coil Design

I worked through some of the formulas in this datasheet, plugging in 100 turns, 66mm, 30 gauge to see what it would come up with for inductance, ideal # of turns, and capacitor value, to see if they would match the 1nf & 100 turn values specified in scanlime's blog entry. I wrote a simple java program to calculate the values for me after not finding what I thought I was looking for on various online antenna calculators (they seemed to be all too complicated).

I found this interesting note along the way which I had not seen elsewhere:ย  "... For copper wire, the loss is approximated by the DC resistance of the coil, if the wire radius is greater than cm. At 125 kHz, the critical radius is 0.019 cm. This is equivalent to #26 gauge wire. Therefore, for minimal loss, wire gauge numbers of greater than #26 should be avoided if coil Q is to be maximized....".

So, #26 gauge wire next time!

Unfortunately my program isn't putting out believeable numbers yet, so I have more work to do.

In the meantime, I also discovered this other datasheet for a neat little 0.32 cent RFID chip (theย  Philips Hi Tag-S) that has a good description of the details of the encoding methods used starting in Section 7.3 (including our manchester, for future reference)

Hi-Tag S Datasheet

And here's another good discussion of the antenna design and coupling (different frequencies, same concepts and formulas).

Design Examples for
13.56MHz and 900 MHz RFID Antenna

I played with the open source 4NEC2 Antenna Modeler & Analyzer for a while trying the helical generator, but it kept blowing up at simulation time with my RFID design, complaining that the antenna was connected to ground at the end (duh, this is what the tutorial shows, I don't get it!).

Filed under: Cricut, Eagle, Inkscape, MTC No Comments
21Jun/111

AVR HID RFID, take 1…

I've been slowly making progress building my own AVR RFID according to the instructions in this blog: http://scanlime.org/2011/05/duct-tape-rfid-tag-1/

After building the assembly code for HID tag type, I obtained a ATTiny85 and a handful of ATMega168s. I wanted to prototype first with the Tiny85s, but I have a cheap and plentiful source for the 168s and wanted to use those if possible: http://store.atxhackerspace.org/

Building the code for the ATMega168 turned out to be challenging, as I kept getting the same compiler error over and over and just couldn't fix it with any of the most common suggestions I found by googling:

 

C:AppDataLocalTemp/cc69IjcD.o: In function `loop': (.text+0x1d12): relocation truncated to fit: R_AVR_13_PCREL against `no symbol'

This comment gave me the clue:

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=764390

"... IOW, you are trying to RJMP to a location that
cannot be reached that way. .."

Researching rjmp vs jmp I found this thread..

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=21053&start=0

I changed the "rjmp loop" to "jmp loop" and it compiles now. Whether it works or not, we'll see ๐Ÿ™‚

Back to the Tiny85, I got one and soldered it to a $2 Surfboard from Frys. This was my first experience hand soldering SMD components and it was pretty challenging but I managed to do a pretty good job. This was a little crazier by the fact that I had purchased 0203-sized (grain of sand) sized parts without thinking it through.

In the end, I was able to successfully solder the 2 caps in place on the surfboard. (Circled in red)

To make the antenna, I laboriously made a 66mm form out of cardboard, started winding it, and noticed a nearby beer can. Just for fun, I measured the beer can and it turned out to be... 66 mm! What are the odds?

I wound approximately 100 turns of 30 gauge magnet wire (or maybe 98... or 102... :), slipped it off the can, and stuck it to a clear packing tape backing. I soldered a 1x4 male 0.1 header strip flat against the contacts to connect the bus pirate probes up to for (very slow) programming purposes.

Ultimately, unfortunately my first test was a failure. Swiping the "badge" by the hackerspace and my office readers does not result in a beep. I'm certain the hackerspace badge is the right type. After looking closer, I realized I had attached the capacitor in series with the antenna rather than in parallel.

After fixing the error this morning (with a parts-bin capacitor roughly 100 times larger than the original :), the badge still does not garner a beep from the card reader.

 

I have to say, I'm pretty pleased with myself for just getting this far, it does look pretty neat even when it doesn't work.

Next steps: probe the antenna leads with the oscilloscope while trying to read the badge to check for resonance; also go back to the formula and try to recalculate the antenna length. Perhaps using a heavier-gauge wire or a slightly incorrect number of turns of wire resulted in a change in the resonant frequency? (I don't really know what I'm doing here yet, just learning as I go ๐Ÿ™‚

I'll also probably also attempt to build my own reader at some point using these instructions here by the same author: http://forums.parallax.com/showthread.php?105889-World-s-simplest-RFID-reader

 

 

 

Filed under: Uncategorized 1 Comment
17Jun/110

Custom Catan Tiles

Just a little something I was playing with.. Email me (gossiphog@gmail.com) if you want the template.

Filed under: Uncategorized No Comments