Days until deadline: 13
I have had a few productive nights of coding and now have a working proof of concept. After arriving home from holiday at in-laws house I was happy to see the NTAG203 samples I had ordered had arrived while I was gone. This is the tag format that will be used in the final project.
Alas, I could find no libraries capable of writing the tags using the PN532 based hardware. And I don't have the time write one myself (maybe I do but fear of missing the deadline prevents me from starting that journey). But there is another solution which came as a shower thought (if you can't figure out your project go take a shower and it'll probably come to you!).
I can't read or write the NDEF messages using the libraries I have availalbe, but I can read the unique hardware identification (UID) of each tag. With this in hand I wrote a program that has a few different user options:
- Read UID of any tag that is scanned to the reader and dump the 7-byte value to the serial terminal in a C header format.
- Flash the complete C header file back to the chip as a PROGMEM array
- When voting, check scanned UID against this array. If found, check against a bit-packed array using the index of the UID. The bit-patcked array is stored in 64 bytes of EEPROM (512 possible voting tokens) as a 0 if this tag has not yet been used as a voting token. It is then stored as a 1 once a vote has been cast. This technique prevents multiple voting
I have implemented all of this as described. Not it's just a matter of a simple physical build: adding an LCD to display instructions and the vote totals, adding a knob to select the different voting options, adding LEDs to indicate which option is currently selected, adding a piezo for audible feedback, and actually building the physical device. This is an afternoon of work at most. Yay!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.