I always wanted to do flight-logging so I could follow up on battery-usage with my heli’s. Used several mobile-apps, paper and pen and all other possibilities. Always either forgot or was too lazy…
There has to be a better way, there has to be a way to make logs automatic. After searching teh interwebs I found this by AlastairC, a simple solution to read RFID-tags with Jeti. So, let’s get the parts and get on it.
Features of RC-Thoughts RFID-Sensor
Features are very simple yet powerful:
- Identifies itself to receiver as normal sensor
- Compatible with Revo Bump technology
- Has five values: Tag ID, Battery Capacity, Cycles-count, C-value and Cellcount
- Cycle-count automatically increases with one after ~30 seconds powered (RC-Thoughts tag only)
- Possibility to disable automatic cycle-count if it’s set by charger (RC-Thoughts tag only)
- User can write, re-write and erase tags straight from transmitter (Not allowed on Revo Bump tags)
- User can change tags on sensor without power-cycling (From sensor v.1.5)
- Uses widely available cheap hardware and free software, very affordable solution
- Identifies to transmitter even without tag – Easier setup (From sensor v.1.7)
- Battery capacity up to 65535mAh (From sensor v.2.1)
Revo Bump Technology
Revo Bump is a clever technology from Revolectrix, more info here. The good part is that they use a compatible tag and store all kind of information on the tag. They also were kind to share the data-layout so I could confirm my reverse-engineered data-fields.
Usage on RC-Thoughts Jeti RFID-Sensor is even more easy than before:
- No need to write the tag with Jetibox, already done by Revo Bump controller
- All tag-values are the same
- Cycle-count is managed by Revo Bump controller, that means no cycle increase in flight by RC-Thoughts Jeti RFID-Sensor
- Usage with RC-Thoughts Jeti Tools RFID-Battery (here) is just the same as with our RFID-tags
In essence, if you already are using Revo Bump technology you do not need any other tags in your batteries!
Issues with first version
Hardware used in AlastairC’s example was a bit bulky to my taste so after reading on Arduino + RC522 type RFID-readers I found a bit smaller one. The size is also very close to Arduino Pro Mini board so it makes a tiny package overall.
Another issue was the quite difficult way to write tags for deployment:
- Change few numbers in Arduino-code
- Upload code to Arduino
- Write tag
- Repeat
All of us are not tech- or computer savvy so I got an idea to make it writable straight from transmitter via Jetibox. I would have loved to get it writable from LUA-app too but that is impossible for me since it would require access to the closed part of EX-protocol which I don’t have.
Hardware needed
You need very little components and parts:
- Arduino Pro Mini 3.3V 8Mhz (Example link to ebay)
- RC522 13.56Mhz RFID-reader/writer (Example link to ebay NOTE BELOW)
- 2.4kΩ resistor (Example link to ebay)
- Servowire and plug (Example link to ebay)
- RFID-Tags of size and format to your liking (Example link to ebay – Confirmed to work!)
- Anti-metal RFID-tags recommended! (Example link to ebay – Confirmed to work!)
Optional for easier assembly:
Note about RFID-module: Look pictures below of the sensor (The small green one). The RC522 board needs to be identical and have SPI interface. One vendor had changed the link, so this note is added, link is also updated but I cannot guarantee it to stick. You can use other SPI interfaced cards that have RC522 board too, you need to check schematic yourself.
For programming the arduino you also need a USB to TTL adapter. (Example link to ebay)
I chose the smallest RFID-reader I could find that was RC522-compatible and had a PCB. You could use ID12 or ID20-type sensors but making the whole package easy to install would be a bit harder and the size-advantage is really small.
Of course you can use the most common type of reader too, but when comparing the different readers it’s quite obvious why I chose how I did, look at the comparison, the one with wire is a complete sensor, Arduino Pro Mini is on the right:
Doing a side-by-side comparison with the most commonly used reader it becomes even more clear, complete sensor on the right:
Total cost with these components for 10 batteries and two models is around 20 USD. You just cannot call that expensive…
Little bit of DIY
There’s very little to do what comes to soldering, here’s the schematic, looks messy maybe but it’s really simple.
Here is also the reason for using the 3.3V 8Mhz version of Arduino and not the 5V 16Mhz, the RFID-sensor works on 3.3V and we wan’t to keep component-count to as low as possible for cheap and easy building.
So, the schematic is as follows:
- Arduino VCC -> RFID 3.3V
- Arduino GND -> RFID GND
- Arduino Pin 5 -> RFID RST
- Arduino Pin 10 -> RFID NSS
- Arduino Pin 11 -> RFID MOSI
- Arduino Pin 12 -> RFID MISO
- Arduino Pin 13 -> RFID SCK
- Arduino Pin 3 -> 2.4kΩ resistor AND Receiver signal pin
- Arduino Pin 4 -> 2.4kΩ resistor
- Arduino Pin RAW -> Receiver Positive
- Arduino pin GND -> Receiver Negative
NOTE: Some boards have GRN where my boards have GND. Do NOT use GRN, use GND!
If you wan’t to use Arduino Nano, read this post.
So, only 19 solder-points in total, quite easy.
Here’s what my prototype looked like:
There’s a few EC5 connectors to give you some idea of size. In the final sensor I shortened the wires and put Arduino and RFID-board on top of each other with hot-glue and some heat-shrink for protection (Leave room for air to move a bit):
When doing this you have to remember two things, there’s a reset-button on Arduino, make sure that it’s not pressed in all the time. Also make sure you have access to it even later. I have a small hole in the end of sensor and use a toothpick to press it when I’m re-programming Arduino. (Re-programming is not needed unless there are new features or updates). Also make sure you have access to four programming contact-points near the cable, you have to have access to VCC, GND, TX and RX-pins in the end of Arduino-board.
Programming Arduino-sensor
You need a few things in order to program the Arduino to work with RFID-reader and Jeti receiver:
- Programming cable (USB to TTL, look above)
- XLoader-application
- The pre-compiled Arduino file (.hex) from from my Github here.
If you want to do it with Arduino IDE-way then you need:
- Arduino software (Get the free software from Arduino.cc)
- Sensor 1.5 and up is done with Arduino IDE 1.8.0 – Please use the same!
- Correct libraries and sketch (the actual Arduino-program) from my Github here.
Easy programming sensor with XLoader (Windows only)
I have made pre-compiled hex-files of Arduino sketches to make the programming easier to you. You do not need to install the Arduino IDE, any libraries etc. All you need is the XLoader app from my server here (Exactly the same as in authors page here, only exception is the device-list, I added Jeti-sensor)
Unpack the xloader.zip and run the XLoader.exe, you are presented with small app:
Point the “Hex file” to the BatteryRFID.hex you downloaded from my github, select Device to “Jeti-Sensor”, make sure you have your TTL-adapters com-port selected and it looks like this:
Hold the sensors Arduino’s reset button pressed, now press XLoaders “Upload” button. As soon as you see the “Uploading…” text in bottom of XLoader-app release the reset-button in your sensors Arduino:
After successful loading XLoader tells you how many bytes went into board:
That’s it, you’re done!
Preparations for Arduino IDE method
After installing Arduino-software get the necessary libraries and software from my Github. (Download as zip, same as in LUA-guide here)
Extract the zip-file and you get some files and folders:
Go inside Arduino-folder, extract the RFID_Libraries.zip and you will get three folders:
These three folders needs to be copied to Arduino-software’s libraries folder. In windows that is in “My Documents\Arduino\Libraries”. Should look like this when you’re done, note the address-bar:
We’re getting closer…. Connect your USB-to-TTL adapter to your PC and go to the folder where you have the “Battery.RFID.ino” file, this is the actual application we need to put into Arduino-board:
NOTE: If you cannot put your sensor within 1 cm from your battery you have an option to amplify RFID-reading distance. Open the BatteryRFID.ino in your Arduino-app or Notepad (NOT Wordpad or word) and look for “void setup()” around line 220. Right under it is a line:
//mfrc522.PCD_SetAntennaGain(mfrc522.RxGain_max);
Remove the // from beginning so the line now reads:
mfrc522.PCD_SetAntennaGain(mfrc522.RxGain_max);
What happens is the power on RFID-antenna is set to max, this makes RFID-Sensor to work at around 3 cm when anti-metal tag is used on battery BUT you will lose reading ability when tag is right on the sensor! Keep this in mind.
Open the BatteryRFID.ino file, your Arduino-software will open. Before doing anything else we need to make sure we are using right attributes. So, we need to set a few settings via menu:
- Tools -> Boards -> Select “Arduino Pro or Pro Mini”
- Tools -> Processor -> Select ATmega 328 (3.3V, 8Mhz)
- Tools -> Programmer -> Select USBasp
You can check in the right lower corner that you have correct settings:
It’s time, finally!
Connect your Arduino to USB-to-TTL so you have the correct pin-order:
- Arduino VCC to USB Positive, usually red
- Arduino GND to USB Negative, usually black
- Arduino RX to USB TX, most often green
- Arduino TX to USB RX, most often white
Now, in Arduino-software press CTRL-U (Or select from menu “Sketch -> Upload”. You will see a progress-bar in lower right corner:
Just as it has gone to end and you will see the application information in the status-screen on the bottom:
Just when this text appears press the reset-button in Arduino, the “Done compiling” text in the upper picture will change to “Uploading” and when it’s done to “Done Uploading.” If you get errors swap the RX- and TX-pins on your USB to Arduino connection and try again.
After programming the Arduino your sensor is ready for use!
Connecting RFID-Sensor to your receiver
This is an easy one. Just as any other sensor, that means EXT-port in your receiver, you can also use an expander if you want to. RFID-Sensor is compatible with R- and REX-receivers.
Writing RFID-tags with included RFID-Battery program
In order to identify different batteries we need to write different values to the RFID-tags we put on batteries. Using Jetibox demands a bit patience, interface is not the fastest one so press a button and wait for a second before pressing again.
Put a tag on sensor (empty or Revo tag, no difference, does not work without tag), give power to receiver and update your sensors, you should see a new sensor RFID and five different values:
After that go to “Applications” -> “Jetibox” and in ther go right to “<- MX ->” and press down. You should find the RFID-Battery sensor. (I have added navigation info to pictures to make life simpler for you):
Press RIGHT and you will see the info-screen (with zero values since it’s empty tag):
One more step to RIGHT get’s you to Tag ID setting (Max ID = 999), settings are as follows:
Next is battery capacity (Max = 65535 mAh) In here you should put the battery-capacity, not the alarm-value:
Followed by cycles-count (Max = 999), put the amount of flight you already have on this battery here:
A few more, next up is the C-value of battery. It is not currently used in anything but I have ideas of automatic max-current calculation so it’s already implemented, set up as before:
Last setting is the cell-count. Put the individual battery’s cell-count. If you use two 6S batteries in 12S config it still is 6S you should put here if you use LUA-app. If you always have the same two 6S batteries as 12S and do not use LUA-app you can put 12 in here. (Max = 99).
Going right gives us the setting for automatic cycle-count. If you have charger that increases cycle-count on RCT-tags set this to OFF so sensor does not increase cycle-count in flight. If you have a charger without any RFID-integration this needs to be ON. If this is not set setting defaults to ON. NOTE: Setting is stored on the tag! Does not have any effect on Revo-tags!
Going right once more get’s us to the write-screen, press Up and Down at the same time to write the settings to tag:
You will be presented with confirmation-screen:
Now press LEFT and you will see the new values:
NOTE to Revo Bump users: While you can go through values (all zeros in start) and change them, you cannot write them to Revo tag. On writing you are presented with a warning. We are not writing anything to Revo Bump tags, ever. Revo Bump controller takes care of all values including cycle-count.
Revo Bump tag preparation
There is one thing you need to do when using Revo Bump tags. You need to set the short ID to a number. If short ID is not set by user it’s a hash-value in HEX and we do not use HEX here. The value to change is the marked with red square (picture from Revo Bump manual by Revolectrix):
So head on to your controller and change that. Changing the short ID to a number-value (I recommend starting from 1 and going up) does not change any other values or stats you already have on your tag.
Here’s a how-to in video-form:
As you can see that’s not only fast but also easy :)
Displaying values on transmitter
Now you can display the sensor-values on your main screen (DC/DS-14/16/24) and use them as telemetry controls just as any other sensors (C-value not shown but possible):
If you have a DC/DS-24 you can use the RFID-Battery LUA-app (more info here) to present an a”all in one”-screen with integrated alarms for capacity, empty battery on start and so on:
You can re-write your RFID-tags at any time. You can also change the once written values to your liking any time.
About placing tags to batteries
RFID works with radio-frequencies and as we know they don’t like metal that much. Same applies here. We are using the most inexpensive tags so they are thin and that means the “antenna” in tag is right on to metal when you fasten it on the battery. There needs to be a little bit of distance between battery and tag. This is easily done with a piece of sot two-sided tape (Ebay example here) between tag and battery.
With no battery reading distance is ~3cm, with tag straight on the battery sensor does not read the tag at all. With a piece of foam-tape reading distance is around 1cm which works fine.
Another alternative is to use “anti-metal”-defined tags, they are a bit more expensive. (Example Ebay-link here)
Thanks for the reminder goes to Onki from Jetiforum.de!
You need to test with your model and sensor so reading is reliable.
Disclaimer
Always make sure everything works as it should. Do not use faulty devices. neither RC-Thoughts and/or me are in any way liable or responsible for anything you do with your equipment or to others with equipment used as described here. You should never use LUA-apps for operation-critical functions.
If you find something that is not working or is behaving strangely please let me know. I’m a car-mechanic by training, not a programmer-geek :)
Most important thing
Is to have fun building, this will not bankrupt you in any way :)