# iSpindle Documentation ***Translation is work in progress, feel free to contribute! This translation might be out of sync with the original german one, please double check*** iSpindle (iSpindel) Documentation =================== **DIY electronic Hydrometer** ***Please consider supporting this project*** [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.me/universam) ![iSpindle in clean water](/pics/floating.jpg) ![Dashboard](/pics/Dashboard.jpg) ## Table of Contents - [FAQ](FAQ-en.md) - [Parts](Parts_en.md) - [Calibration](Calibration_en.md) - [Circuit Diagram](circuit_diagram_en.md) - [Upload FHEM](upload-FHEM_en.md) - [Ubidots scripting](ubidotsscripting_en.md) - [iSpindle Documentation](#ispindle-documentation) - [iSpindle (iSpindel) Documentation](#ispindle-ispindel-documentation) - [Table of Contents](#table-of-contents) - [License](#license) - [Principle](#principle) - [*Metacentric Height*](#metacentric-height) - [Construction](#construction) - [see Parts](#see-parts) - [see Sourcing](#see-sourcing) - [see Circuit Diagram](#see-circuit-diagram) - [see iSpindel Breadboard Mounting](#see-ispindel-breadboard-mounting) - [Drawer](#drawer) - [Configuration](#configuration) - [Test Server](#test-server) - [Ubidots](#ubidots) - [Portal](#portal) - [BierBot Bricks](#bierbot-bricks) - [Blynk](#blynk) - [Cloning the Example](#cloning-the-example) - [Using your own App](#using-your-own-app) - [MQTT](#mqtt) - [Home Assistant](#home-assistant) - [Other MQTT broker](#other-mqtt-broker) - [Graphical User Interface](#graphical-user-interface) - [Calibration](#calibration) - [Ubidots Graphen](#ubidots-graphen) - [CraftBeerPi](#craftbeerpi) - [Software](#software) - [Firmware flashing](#firmware-flashing) *** ## License > All rights reserverd, any commercial use is hereby prohibited and will violate applicable patents. *** ## Principle Powered by the thread [Alternative to the Spindle](http://hobbybrauer.de/forum/viewtopic.php?f=7&t=11157&view=unread#p170499), the idea was born to reproduce the commercially available electronic tilting spindle using low-cost components. The system is based around the use of a heeling (or tilting) cylinder, an ingenious and easy concept - you do not need any external reference (except for gravity) and the cylinder is extremely easy to keep clean. The inclination angle changes in relation to the buoyancy and thus directly in relation to the sugar content. There is an angle formed between the center of mass and the center of bouyancy depending on the density of the fluid. ![Kränung](/pics/kraengung.jpg) Therefore the idea is to place a Wifi-enable IoT device with an accelerometer and temperature sensor in a floating cylinder. The system will measure the sensors and every x-minutes it will connect to the Wifi and sends its tilt angle, temperature and battery voltage to a cloud service like Ubidots.com to store the data. With an update interval of 30min it was possible to achive a battery lifetime of almost 3 months! ### *Metacentric Height* Actually, this is the "metacentre", the cylinder will tilt as the liquid density changes in relation to its center of mass and center of bouyancy. The angle of tilt can then be measured. It is possible to trim the cylinder by adding a few grams on the bottom so that the cylinder is more upright, or on the lid, so that it is more tilted. The software calculates the Euler angle for X and Y from the XYZ acceleration values and forms the absolute angle. We compute these with the calibrated parameters to ° Plato, SG or similar by correlating to measured references. *** ## Construction ### see [Parts](Parts_en.md) ### see [Sourcing](Parts_en.md) ### see [Circuit Diagram](circuit_diagram_en.md) ### see [iSpindel Breadboard Mounting](iSpindelbreadboard_en.md) *** ### Drawer - A 3D Printed drawer is used to secure the electronics and battery inside the plastic housing as shown below. The 3D model can be found in the repository. ![Sled](/pics/Schlitten_cad.jpg) ![Assembled](/pics/assembled2.jpg) ![Assembled](/pics/assembled.jpg) Druck *** ## Configuration ### Test Server [simple test server](../tools/TestServer/Readme.md) ### Ubidots - To start, you must create a free account at [Ubidots.com](https://ubidots.com) - Next, you must go to the menu ```API Credentials``` to get a ```Token``` to be used by the iSpindle to authorize writing data to the Ubidots account. ***Write this down.*** ![Token](/pics/UbiToken.jpg) #### Portal By pressing the ```Reset Button``` the Wemos creates an access point, which allows you to make the necessary settings to configure the device. **In `operation mode` this portal is not active or accessible because the principle of this design is based on shorted possible acitve time. Basically it will wake up, send its data and deep sleep again. This takes now less than 3s which is directly related to its long life run time. > The ```iSpindel``` signals the `config mode` by blinking the LED at a 1s interval. By saving your settings or waiting timeout of 5min it will end the Portal thus AccessPoint and try to go into `operation mode`. ![Setup](/pics/configuration.png) ![AccessPoint](/pics/AP.png)![Portal](/pics/Portal.png) ![Info](/pics/info.png) > In Ubidots you can monitor the update of data unders ```Sources``` where the iSpindel will create a new device itself. In the ```Dashboard``` now you can create your nice graphs. ### BierBot Bricks The setup with BierBot Bricks is easy and for free. You will need the iSpindle Firmware `7.1.0` or later. 1. Create a free BierBot Bricks account [here](https://bricks.bierbot.com/#/register). 2. After Registration, select "Bricks" in the menu on the left (see 1 in the picture). 3. Hit the blue "Add Brick" button in the top right corner. 4. Select "iSpindel" in the popup and copy the displayed API key into your clipboard. 5. Now open the configuration portal of your iSpindel (by pressing reset multiple times, see [portal](#portal) for more info). 6. Select "BierBot Bricks" as service (see 2 in the image). 7. Paste the api key from your clipboard into the "Token/ API key" field and hit the blue save bottom at the bottom. 8. Now go back to [bricks.bierbot.com](https://bricks.bierbot.com/#/) and select "Equipment" in the menu on the left (see 3 in the image). 9. Create a new device (blue button, top right corner), select "**Fermenter**" in the popup. 10. Now assign the gravity sensor from the iSpindle to the respective field of your fermeter by **drag & dropping** - the respective target dropzone on your fermenter will be highlighted green to guide you. You can do the same for your temperature sensor, but this is optional. 11. Hite "Save". 12. To start recording, we will also need a recipe. Go to "Recipes" on the left and create a recipe. You only need to setup one (dummy) fermentation step. Save the recipe and go back to the list of recipes. Start your recipe by clicking the orange play button. **Done!** ![Bricks tutorial](../pics/ispindle_bricks_tutorial.png) ### Blynk #### Cloning the Example * For this example you will need 1800 (4x200 + 100 + 900) energy points, which allows to use the free version; * Download Blynk App: [Android](http://j.mp/blynk_Android) [iOS](http://j.mp/blynk_iOS) * Touch the QR-code icon and point the camera to the code below

* Enjoy the app! #### Using your own App * If you want to use your own App or modify the example the Virtual Pins are defined as follows: 1. V20 - Temperature withouth unit; 2. V30 - Battery without unit; 3. V1 - String Tilt in degress; 4. V2 - String Temperature degress `C or F or K`; 5. V3 - String Battery `Volts`; 6. V4 - Gravity; ### MQTT * You can configure the MQTT broker (server) in the configuration page. #### Home Assistant * There is a check box to make iSpindel integration automatically in HomeAssistant using Mosquitto #### Other MQTT broker Each value transmitted bu iSplindle is sent on its own topic. Topics are : * ispindel/```Devices' name```/temperature * ispindel/```Devices' name```/tilt * ispindel/```Devices' name```/battery * ispindel/```Devices' name```/RSSI * ispindel/```Devices' name```/gravity *** ## Graphical User Interface ### Calibration > In order to convert the measured iSpindle angle to degrees Plato (°Plato), density (SG), or other units, it is necessary to first calibrate the sensor by making several reference measurements of sugar water of known gravities. These reference measurements can then be converted to a mathematical function which is stored for later measurements and display. Since each self-assembled iSpindle will have different measured values, each device must be individually calibrated after assembly or reassembly to yield accurate measurements. A detailed procedure is below. [Calibration Procedure](Calibration_en.md) ### Ubidots Graphen - [Plato Formula](Calibration_en.md#forumla) ### CraftBeerPi [CraftBeerPi](https://github.com/universam1/iSpindel/issues/3) *** ## Software ### Firmware flashing [Firmware flashing](Firmware_en.md) ***if you like it, let me know*** :beers: [![Donate](https://www.paypalobjects.com/de_DE/DE/i/btn/btn_donate_LG.gif)](https://www.paypal.me/universam)