Original Post: http://bradhenson.com/rfid-controller/
Note: The intent of this post is not to provide a how to guide to building an RFID reader. I am just trying to give a quick snap shot of where the project is and provide some useful links to people working on similar projects.
The parts for the updated hardware version of the RFID Reader came in faster then I expected. I decided to devote some time this weekend to updating the project to take advantage of some significant hardware changes. The main goal was to add a data logging feature to the device, so I needed a real time clock and SD card reader. A quick summary of the changes is:
- Added an Adafruit data logging shield (this included an SD card reader that uses SPI and a RTC that uses I2C)
- Purchased an enclosure from Adafruit, designed for an Uno, a single shield, and LCD
- Added a port expansion LCD backpack to free up some pins, uses I2C for communication to the Uno
- I used the prototyping area on the shield as a connection point for all the devices in the case.
In this hardware version I needed to use some none standard libraries to get things working properly. I ran into issues initially with the LCD backpack. The one I purchased a while back was a cheap ebay special, and required hunting down a library that would work. I ultimately came across http://arduino-info.wikispaces.com/LCD-Blue-I2C, which worked perfectly for my needs. The part that was messing me up was not removing the standard LiquidCrystal library all together and trusting that the new one would cover it. The library for the backpacks utilizing the PCF8574A chip can be downloaded here: https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/NewliquidCrystal_1.3.4.zip.
I used the RTClib library provided on Adafruit’s website and had no issues getting things up and running after reviewing their provided documentation. Check out Adafruit’s website for information on the logging shield: https://learn.adafruit.com/adafruit-data-logger-shield
The amount of memory that the SD card reader requires was a bit surprising. Right off the back, this thing will eat up 50% of your available RAM. My original source code was already using up to 50% of the available 2k of RAM in the Uno, so something had to give. I found that every time I used the print function for writing to an LCD or Serial interface, it was causing the compiler to set aside a little memory space. To stop this from happening I found a good little write up by the Bald Engineer on how to use the macro F() to free up this assignment (https://www.baldengineer.com/arduino-f-macro.html). By following this little trick I got my memory usage down to around 16% before adding the SD card code to it.
Code for this project can be found on my Github page. I branched off the first version to maintain the non-data logging code.