Presentation of ElectroDB
ElectroDB is an offline, light and open source tool that makes looking for pinouts and datasheets a child's play! With its 12,000+ components database, most of your needs will be covered!
Designed for hobbyists as well as electronic engineers, this app will avoid you the hassle of browsing the web to find the information you need for your projects.
Within the touch of a button, it will immediatly give you acces to all the knowledge you need about any component: pinouts, datasheets, features, etc.
From Arduino boards to fairly uncommon chips, this data is there when you need it the most.
Spend less time browsing and more time doing actual electronics!
ElectroDB is available on the Google Play store, for free, with no ads. Its source-code is on Github (see below).
Source-code and technical details
In this section, I will be doing a technical overview of the implementation of ElectroDB: how it works, what I used, etc.
This diagram represents the general workflow of the app:
The database scrapper
The first issue I tackled was the generation of the database. To fetch data from the biggest number of components I could possibly support, I chose to scrap the KiCad library files because:
- Thanks to the large developper community, it is often updated which means that the database should be fairly complete and error-free;
- Being open-source, there are no limitations to the usage of these files.
To use these ressources, I extracted all the information that they contained and assembled it into a universal and easy to read format: JSON. To do so, I developped an AWK script. This quite dense script parses all the files and outputs a single, structured JSON file with all the information included.
The Android app
This was my first time in Android developpement. In fact, the main reason why I started this project was to learn. Fortunatly, developping on the Android platform is quite easy with a decent Java knowledge.
The design of the app is done using Android's native UI framework, and by following Google's Material design rules. This gives ElectroDB a modern look and, more importantly, it makes it extremely intuitive to use. For a "productivity" app, this was one of the main requierements.
The dynamically generated chip images ensures that the app stays lightweight even with a huge database, and makes it very easy to update a chip.
Another interesting point is the search engine that I implemented. Finding a list of results based on word similarity is not an easy task. I implemented the Levenshtein distance algorithm, that mesure the relative similarity between character strings.
Finally, to dynamically browse the JSON database when performing a search, I used the org.json java library. Because JSON is so easy to parse (compared to other data storage formats such as XML), this library does a very good job of reading megabytes of data in a few tens of milliseconds even on less powerful phones.
The source-code for both the AWK database scrapper and the app is available on this Github repository: https://github.com/CGrassin/electrodb
To go futher
Although I want to keep ElectroDB lightweight and fast, there are several features that I am thinking on adding to the app in future updates:
- Add other tools (resistor value calculator, circuit exemples, etc.): having all these functions in one app could be very convienient.
- Enrich my DB: I could gather more information to offer a powerful parametric search. For instance: usual price, power requierements, etc.
Feel free to contact me if you want to share ideas with me!
Author: Charles Grassin