Introduction: RFID Treasure Box
A box with rfid reader, lcd display and servo to open a bolt. Built as a treasure hunt for a birthday party of 7-year old daughter.
Children had to collect five RFID-cards and swipe them in a correct order over the box to open the box and find the chocolate coins inside.
(Texts in the pictures are in dutch)
- Arduino Uno
- RFID-RC522 (e.g. found here)
- 16x2 LCD (e.g. found here)
- 4 NeoPixels (found on adafruit.com)
- resistor for the neoPixels (470 Ohm, but anything between 300 and 500 Ohm will do)
- servo (with enough torque to pull the bolt)
- capacitor for the servo (I used u 100uF)
- wires (a lot)
I used a box I had lying around, some wood, some screws, ...
If you want to skip forward. Complete code can be found on github.
Step 1: Arduino + RFID Reader + LCD
Connect the LCD screen (from top left to right):
- ground (not using a potentiometer, just giving max bright to the LCD)
- arduino pin 8
- arduino pin 9
- arduino pin 4
- arduino pin 5
- arduino pin 6
- arduino pin 7
Connect the RFID breakout:
- SPI MOSI: pin 11
- SPI MISO: pin 12
- SPI SCK: pin 13
- SDA: pin 10
- RST: pin 2
- GND: ground
I cut some holes in the top of the box and put everything in place.
Make sure you add a small piece of wood or somethin non conductive between the lid and the RFID breakout.
Step 2: Adding the Servo and Bolt
Connect the voltage and ground wire to 5V and gnd. The signal wire goes in Arduino Pin 1.
By using this pin, you can't use a Serial Communication from your Arduino code, but that's fine for this project.
(Some Arduino boards can't be programmed when this pin is in use, so if you have some problems, detach the pin every time you upload new code)
Use some wood or whatever you have to keep the bolt and servo in its place. I made a hole in the lid of the box to keep it closed.
You can see the servo and bolt working if you watch the video.
Step 3: Adding Rgb-leds
NeoPixels are easy to use because you can connect them in series. Drill four holes in the lid, connect the leds. They need 3.3V and a gnd connection. Use pin 3 (a PWM enabled pin) for the input but put the 470 Ohm resistor between pin 3 and the first NeoPixel.
Step 4: Finishing Up
Attach the arduino to the lid. You can put a battery pack in the lid as well (or use an external power source).
See the complete flow in the video attached (displayed texts are in Dutch).
Rules for the treasure box:
- Cards need te placed in the correct order. Every correct card adds a green light. When all cards are placed: blue lights are shown.
- When a card is the wrong one, you have to start all over (red lights are shown).
- When you wait too long between cards, you have to start all over (white lights shown again).
- There is one master rfid card which opens the box immediately.
You can find the Arduino code here.
Step 5: Have Fun!
Make up a small quest for the kids to find the cards.
FrankG53 made it!