Community Highlight: How InfluxDB Enables IoT Monitoring of Gas Station Tanks
By Caitlin Croft / Jul 30, 2020 / InfluxDB, Community, IoT, Developer
I recently spoke with Alex Skrivseth, the Operations Manager at The Shed App, and discovered how he’s using InfluxDB to monitor the current levels of gas and diesel at various gas stations. Simply by extracting IoT sensor data, he has been able to provide valuable previously inaccessible data to fuel truck drivers.
Caitlin: Tell us about yourself.
Alex: I live in Bonners Ferry, Idaho and I’ve worked in construction my whole life. About a year ago, I completed an online Python bootcamp. I learned about Django, the Python web framework. Since then, I’ve gotten into learning more about technologies. I’ve built a few simple apps and found the process to be pretty cool. I have some previous experience with SQL databases. One of the apps I built helps me at work. It keeps track of the temperature inside of a wood-drying kiln for me. That way I don’t have to physically check myself!
As I want to learn more about coding and various technologies, I started going to more meetups. I met Jacob Marble at the Sandpoint Tech Meetup in Idaho and he’s currently the Cloud 2.0 Storage Tech Lead at InfluxData. I hadn’t heard of InfluxDB, the purpose-built time series database, until meeting Jacob. After meeting him in person, I reached out to him on LinkedIn to learn more. He was gracious enough to meet with me. We discussed how to build a career in the tech industry. He also showed me what he was currently working on, and I thought it was super cool. He mentioned that there is an open source version and a paid version. He encouraged me to test out InfluxDB and to see if I could benefit from using it.
Caitlin: How did you get connected with the gas tank truck drivers?
Alex: My friend Jake works within the community installing security cameras, setting up networks, and other IT work for local businesses. Jake was already connected with a fuel tank truck driver and was already providing the driver with a way to understand tank levels at one gas station using PuTTY and making a series of requests. The driver asked Jake if it was possible to better understand the current levels of the large fuel tanks at various stations and Jake put him in contact with me. Jake asked me to build an app, and he is paying me to keep it updated. By extracting IoT sensor data from the tanks, I’m currently monitoring nine gas stations in Idaho and Montana all within a 2-3 hour radius of Bonners Ferry, Idaho.
Caitlin: Tell us about the challenges the truck drivers were facing.
Alex: Let me provide you with an overview of the basic operations of a gas station. You have the company who owns and runs the gas station, like a Shell or Chevron. Another company provides the large gas tanks, and then there are the truck drivers who fill all of the gas and diesel tanks. These tanks can hold 20,000 gallons of gas. Some tanks are as small as 5,000 gallons. There are at least three different parties involved, and they don’t communicate with each other. I discovered that for the most part, gas stations assume the drivers will come and fill up the tanks when needed. I also learned gas stations can run out of gas in just three days if they aren’t refilled.
The tanks are manufactured by companies like Veeder-Root. It turns out that a lot of these tanks have sensors built into them. However, many are quite old and there isn’t an easy web interface for people to understand the data. Any data coming from the gas tanks isn’t shared with the drivers; it turns out that it’s only accessible to the gas stations, not the drivers. I’m assuming the stations have a little display panel inside which they can read, but once again, they don’t openly share this information with the drivers. It seems like they only share the information if and when a driver or dispatcher calls and asks for an update.
Prior to my app, the drivers would have to rely on data provided to them by a dispatcher. First, the dispatcher connects with each individual gas station to understand their needs. Next, the dispatcher informs the drivers every week or every few days how much fuel they have to load up.
Caitlin: Tell us about the IoT monitoring solution you built using InfluxDB.
Alex: My friend Jake realized that he was able to hook up a small device to each fuel tank locally which reads the current levels locally. The device varies depending on the gas tank brand and model. For the older tanks, which only have serial ports, Jake is using SysLINK SL-800 IoT Gateways to read the fuel levels. For some tanks, he’s using Lantronix UDS-1100 to enable machine-to-machine (M2M) communication. Some of the more modern tanks have TCP built-in with a web interface.
I was able to make a Telnet request to his device. I use the Python client to write the data to InfluxDB. I built a custom app for local truck drivers who cover nine specific gas stations. There are three different trucking companies who service the nine stations. It seems like the truck companies have contracts with specific gas station companies. For example, the same truck company services all of the Chevron stations in the region.
My custom app fetches the data from every gas tank at the gas stations and enables the drivers to check the current level of every tank. This way the drivers can check the app to see how much gas they should bring. For example, knowing they only need to bring 3,000 gallons of regular gas versus the max amount they could bring is invaluable to the drivers.
We’re monitoring several Conoco gas stations, a few Chevron stations, some 76 gas stations, and other locally owned gas stations. The gas stations have a weird relationship with the drivers. It seems like the stations leave it up to the drivers to fill the tanks. There is a certain level of trust across the board.
Before building my app, I learned that gas tank drivers would refill every tank every two days with the same amount of gas or diesel. I discovered that keeping one gas station properly filled can keep a gas truck driver busy full-time. I’ve been tracking gas station data in my own app for about six months, and I started using InfluxDB about a month ago.
I’m currently collecting metrics from every tank every ten minutes. On average I’m collecting 576 metrics from every station. Granted, for some stations, I’m collecting more metrics as they have more tanks. Many gas stations have three tanks: regular gasoline, premium gasoline and diesel fuel. Some stations also have a fourth tank for dyed diesel fuel, which is used for off-road vehicles, farming tractors and other large equipment. Some of the large gas stations have up to seven tanks; these stations have backup tanks of regular gasoline.
"The truck drivers love it! They love that they can check the app for current gasoline and diesel levels. It's more accurate than what the gas stations can provide."
The drivers no longer have to rely on gas stations providing the right information to the dispatchers. The process with the stations and dispatchers can take hours of back-and-forth. Now the drivers are able to immediately check the website themselves, and it only takes 5 minutes.
I’ve created a dashboard where I can see all nine stations. I’ve also set up permissions so specific drivers can only see data related to the gas stations they refuel. According to Google Analytics, the drivers are checking out the data about three times a week.
Dashboard available to truck drivers:
- If the tank is below 1,000 gallons, the level will show as red.
- If the tank is below half, the level will show as yellow.
- If the tank is above half, it will be displayed as green.
<figcaption> Dashboards displaying various types of fuel for designated gas stations</figcaption>
<figcaption> Dashboard for designated gas stations</figcaption>
Caitlin: Were there any interesting observations in the data?
Alex: I was shocked to learn how quickly gas stations will run out of fuel if the drivers don’t come to refill. I was surprised by how few people actually use premium gas. For example, for one of the stations we’re monitoring, they go through on average 30,000 gallons of regular gasoline per week. They only use around 4,000 gallons of premium gasoline per week. I was also surprised by the lack of communication between the stations and gas tank drivers. The stations just assume that a driver will always show up with enough fuel.
I also noticed something interesting about the refuels. From the charts, I can immediately tell when the driver refills the tank because the graph immediately shoots up vertically. The interesting part is often a few hours later, I can see the volume of fuel increase a little. It seems like the drivers will refill to the maximum and if they have leftover fuel in the tank, they will come back a few hours later and top it off. It’s like they’d rather make a second trip so they can empty out their truck tanks.
<figcaption> Fuel tank refills</figcaption>
I love InfluxDB because it’s easy to tell when something is off. I’m already able to detect patterns for each tank. For example, it’s easy to tell the difference between daytime and nighttime. Usage rates flatten in the evening and through the night. Then you can see fuel levels lower quicker in the morning as people start their day.
It is also interesting comparing weekday and weekend data. It seems like the usage rate of gasoline does not change if it’s the weekend. However it is clear that more diesel is purchased during the week. A lot less diesel is purchased over weekends.
Caitlin: Do you have any future plans to extend your usage of InfluxDB?
Alex: It seems like larger stations own the trucks, and the truck drivers work directly for the gas stations. So I’m assuming they also have their own monitoring systems as well. It would be great to market this tool to a refueling company and share this technology with more stations. It is possible that some stations already have the infrastructure in place which monitors gas tank levels for them. Nonetheless, I think it could be fun to collaborate with them.
I’d also like to expand into other local gas stations. I’d like to connect with more stations and truck drivers to help them. While it would be great to work with larger oil and gas companies, I also think it could be fun to help smaller gas stations that don’t have the infrastructure set up to monitor their tanks. I’m still figuring out how it all works, but I’m excited to see what else I can do with this app.
I’m still learning tons, and once I learn more, I’d like to start using InfluxDB at home. I’d like to start learning more about home monitoring. For example, I’d like to start tracking moisture levels of my plants. You can find me on LinkedIn and GitHub.
If you’re interested in sharing your InfluxDB story, click here.