As everyone knows, it is necessary to maintain your car every year. But do you realize that this also applies to the bicycle? This is often overlooked, but at Mansystems we have been focused on finding a solution. The result is an IoT solution that makes your bike a smart bike and works with Mendix.
The Smart Bike
First of all, we looked at the possibilities of turning a regular bicycle into a smart bicycle. According to various internet sources and bicycle repairers, the following definition for a smart bicycle has been formulated: a smart bicycle is a bicycle that collects data from its environment through sensors, links it with a Mendix application, and then analyzes this data.
Several companies have already come up with ideas to make cycling smart. For example, the company FlyKly has designed a smart bicycle wheel that fits most ordinary bikes. In addition, there are also smart bicycle locks from iLockit and Nokē ; smart bicycle lighting has also been developed by Revolights. What all of these devices have in common is that they can be paired with a smartphone application.
Recently, Gazelle started implementing the SafeDrivePod (SDP) in its bicycles. This device ensures that the phone is blocked during cycling. That way the bike is also made 'smart'.
In addition to smart bicycle wheels, bicycle lighting, SDPs, etc., there are also concepts where bicycles can be rented through an app. oBike and MoBike are companies that rent bicycles through customers utilizing an app to scan the QR code on the bike and paying for the time they use the bike. When a customer is done cycling, they can simply put the bike in a public place and lock it. Via Bluetooth, the app recognizes that the bike has been locked and closes the bike session.
At Mansystems we do not want to reinvent the wheel. We want to be creative and innovative. By talking to bicycle makers, colleagues, friends, visiting bicycle fairs, and holding brainstorming sessions, new ideas have been gathered to make cycling smart. We collected 10 new ideas and narrowed them down to the top 3. These top 3 ideas are based on the degree of use of Mendix; the more we use Mendix, the better the platform comes into its own.
Measuring the energy requirement
In most bike computers that display a speed indicator, an indication of the calorie consumption is also displayed. However, these devices can not see if you are going against the wind, biking up a slope, etc. We want to tackle this problem by putting sensors on the bike that measure these types of variables.
"Calculate the calorie consumption by measuring the air resistance, rolling resistance, speed and weight."
An anemometer can, for example, measure the wind speed. If you know this, a better calculation can be made on the amount of energy needed to get from A to B with the given resistance. The same applies to the slope, for which you could use a gyroscope.
This data is forwarded to a Mendix application in which the calculations take place.
Limiting the cycling speed of Speed-Pedelecs
Speed-Pedelecs are electric bicycles that are allowed to cycle up to 45 km / h. They are covered by the moped law. Because users of these speed pedelecs find the regulations too dangerous for this bike, a solution has to be found.
"Using geofencing and object detection can influence the speed of a speed pedelec."
One solution may be that speed pedelecs are allowed to cycle 45 km / h, but that they could be automatically limited in the city- this can be achieved with the help of geofencing. The digital delineation of an area and if, for example, a bicycle is located within that area, would result in a signal to limit the motor speed.
In addition, sensors could be used to detect objects in front of the cyclist such as other cyclists, pedestrians, pets, etc. The bicycle can also be limited when it detects an object moving in front of it. Do you want to catch up with three children who are cycling to school with your speed pedelec? That is not very safe with 45 km / h. Thus, you could automatically limit the bike to a speed of up to 15 km / h faster than the object to be overtaken.
Smart bike maintenance
As was already touched on in the introduction- just like with cars, it is important for bicycles to be maintained. Electric bike users are already notified when their bike needs a maintenance check, but what about regular bicycles? Some bicycle repairers send an email to the bicycle user about twice a year to indicate that their bicycle needs maintenance repairs. Yet, this does not happen on the basis of use. By means of GPS and sensors we can ensure that this maintenance is done on the basis of use.
"By using a maintenance template and measuring average air humidity and number of kilometers of maintenance notifications."
We can keep track of the distance with three-point measurements in the KPN network and we can measure the air humidity and temperature with sensors. We send the data to a Mendix application which will then provide relevant notifications.
We have opted for smart bicycle maintenance- this idea allows Mendix to come into its own and is easy to achieve in the time given.
A Marvin board with an air humidity, temperature sensor, and a Mendix app is soon to be created. The nice thing about the Marvinbord is that there is already a LoRa chip in it, this way we only need to pair a sensor with the corresponding code. The Marvin sends the data from the sensor over the LoRa network to the Mendix application, the data is then stored and analyzed.
Sensor, Marvin and a power bank
What do all these terms mean? Marvin is a developer board for those who want to quickly build prototypes for IoT solutions and work together with Arduino. This is an advantageous due to Arduino’s large developer community that can assist users if they come across any issues. In addition, with the Arduino IDE, you are capable of adding your desired code on the Marvin. LoRa is a Long Range, Low Power IoT connection that has been specially developed to exchange small amounts of information between devices and systems. Finally, we have Mendix, which is a RAD tool that allows you to model and build applications for web and mobile.
The Marvin initially sends the data to the LoRa Developer Portal. Here the posts are saved and then forwarded to a self-filling web address. In our case that is / rest / PRS_MarvinDataService / SetMarvinData. This is a REST endpoint that we have created in Mendix.
To test our endpoint, it is not necessary to use a working device- Postman is a program that can send requests to test an endpoint.
We then use NgRok to set up a tunnel between our local development environment and the internet. This is not necessary for Postman, but NgRok keeps track of all requests which helps with the development of the application.
NgRok command line interface
Keeping NgRok requests
Now that that is working, we can set up the Mendix application. A page with the most recent information and two pages providing location and sensor data. The application can be found at https://smartbike.mxapps.io
The result is an Internet of Things (IoT) solution that is mounted on the bike. This way a smart bike can be crafted from a regular bicycle! With this solution, the number of cycled kilometers is recorded and the humidity and temperature are measured. Notifications are displayed in the Mendix application when the bike has traveled more than 400 kilometers or when the temperature of the bike's environment is lower than 10 degrees.