Notifications
Clear all

Data - Location, Temperature, 4G Internet ([, Camera?]) ([, OBD?])

38 Posts
4 Users
11 Likes
764 Views
(@surfer)
Member
Joined: 2 months ago
Posts: 7
Topic starter  

Hi,

 

I am thinking of using ESP32, Arduino, Raspberry Pi or similar for a project to be used in my car.

 

The features I would like to implement are as follows:

 

1) Primary goals - "need":

• 4G internet connection module (not 2G) for communication with online webserver (sending data) - requires SIM card and subscription.

• GPS module to send the location of the car to be visualized using maps via webserver.

• Temperature module to know what the temperature is. I was going to use DHT-11 but according to the comparison table below DHT-11 only measures in the range 0° - 50° C (32° - 122° F) and I need to measure at least -10° C (14° F), so I'm going to use a different module (probably DHT-22).

 

2) Secondary goals - "would like":

• Camera to take pictures of the front windshield to see snow / ice when low temperatures.

 

3) Tertiary goals - "could be awesome":

• OBD readings, maybe battery level, fuel level, RPM, speed, etc.

 

I have seen some ESP32 boards with built-in modules such as SIM card (some only work with 2G), GPS etc.

I would assume that choosing one of these boards would be beneficial in terms of battery usage and possibly price.

 

The way I imagine this system working is that the unit reads and sends data to a webserver every hour or so.

This is followed by a deep sleep to limit battery usage - though I am thinking of using a 10.000 mAh powerbank (lower mAh will also do) that is connected to a 12v port for recharging while the engine is running.

I would then be able to load a specific page on an online webserver in the browser on my smartphone and see the data (location via a map, temperature, etc).

 

For the primary and secondary goals the ESP32 and Arduino would probably suffice.

The Raspberry Pi is probably better suited for the tertiary goal due to communication with OBD - but that's for a later project.

 

Below is a list of things I believe I need to succeed with this project.

Please have a look at the list and let me know what you would suggest for modules, type, etc.

Also please let me know if I missed something.

I would also like to mention that I live in Europe (Denmark) since some boards or module have area-specific properties, like antennas, frequencies, etc.

 

Hardware:
• Processing unit: ESP32, Arduino, Raspberry Pi
• Internet: 4G via sim-card and subscription for HTTP communication
• DHT-22 (Digital Temperature and Humidity Sensor): for temperature reading
• GPS: location to see where the car is parked
• Camera: See snow / ice on front windshield
• Battery: powerbank/18650, rechargeable
• Battery Management System: recharging battery

Infrastructure:
• Webserver: webinterface, uploaded images, streaming video
• Database: data posted (DHT-22, GPS), historic data

Software:
• Programming: Arduino, Visual Studio Code + PlatformIO
• Windows Drivers, CH2102

Code:
• GetTemperature: reads value from DHT-22
• GetLocation: reads values from GPS
• HTTP POST: sends values to webserver
• Sleep: after sending data sleeps for interval

 

Comparison of temperature sensors:
https://randomnerdtutorials.com/dht11-vs-dht22-vs-lm35-vs-ds18b20-vs-bme280-vs-bmp180/

 


   
Inst-Tech reacted
Quote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1073
 

It sounds like quite the list, LOL!

This actually is along the lines of something I'm building for my car, although with nowhere as many features.  Have you started any of the design yet?

One thing to keep in mind is the temperatures you might encounter; I would suspect that in Denmark, you have similar weather to mine here in Canada. This would lead me to use the ESP32, which is rated at –40°C to +125°C.

Sounds like a fun project!

😎

Bill

 

 

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Surfer and Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6827
 

@surfer One thing I know about is Lithium batteries and cold weather. I don't know the absolute values for whatever battery you choose, but the typical warnings are, do NOT charge below a certain point as that will destroy the battery. They can be used at lower temperatures but even that has a limit and will shorten the life. Why not simply use the HUGE battery already in the car, weeks of use would have a negligible effect on it. If you plan to re-charge from the car, use a temperature sensor on the battery to disable the charging circuit until the temperature in the car is high enough.

Adding a camera might be a bit of a challenge, most camera solutions involve a supporting board like the esp32. I have a dozen or more but they are not good at doing much else. Also cameras use a lot of power as well as WiFi but I don;t know about cell.

It's an interesting project and I am curious but the cell phone aspect is very expensive in Canada so I will pass on that but we have a lot of free WiFi so I might check if I am in range where I park.

Keep us informed and good luck.

p.s. Keep in mind that the 18650 might be the most counterfeited product out there. Find a reputable source (NOT Amazon). 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@surfer)
Member
Joined: 2 months ago
Posts: 7
Topic starter  

@dronebot-workshop, Thank you for your comment 🙂

 

It might seem like a long list at first glans - probably because I went into so much detail.

 

It actually boils down to the following (give or take):

 

1) Every hour (or other interval) gather data and send it to an online server using 4G / 5G connection (WiFi is not available outside).

2) The data will consist of temperature reading and GPS location.

2B) Bonus: From 5 AM to 8 AM (a couple of hours before leaving for work) it might also include a photo of the windshield to show snow/ice that needs to be removed before the car is drivable (takes extra time).

3) Sleep to conserve battery then wake up using interval and repeat. 

 

As a software developer it is easier for me to start with the easy stuff - programming each of the aforementioned features - I will share the files so you can download them:

https://wokwi.com/projects/390289078155451393

 

Please note that for some reason the "sleep" feature of virtual ESP32 at wokwi.com does not work (not sure why) - It should probably work with the real hardware and lower battery consumption significantly (down to uA units).

 

Since the are no performance requirements for this project I may change the programming language from C to MicroPython as it an easier language to do the programming in. (I am not a C nor Python developer but will hopefully succeed anyway)

 

I use the virtual platforms (wokwi.com, tinkercad.com) since I do not have the hardware at the moment and need to do some research before purchasing the right (compatible) hardware.

I actually attended an IoT/ESP32 course and as part of the course we were given a starterkit which happens to include an ESP32 and a DHT-11 (range 0°C to 50°C) which should suffice for a part of the project.

 

And it does indeed seem that the ESP32 is the correct choice based on the local environment which is well within the -40°C to +125°C range (probably -5°C to +30°C).

 

I will keep you posted with updates.


   
ReplyQuote
(@surfer)
Member
Joined: 2 months ago
Posts: 7
Topic starter  

@zander, Thank you for your suggestions 🙂

 

I have intentionally chosen not to use the car battery just in case the voltage drops below a threshhold and the car will no longer start.

Sometimes I do not use the car during the weekends which would drain the car battery needlessly.

 

By using an external power source, such as a powerbank, I avoid any car battery related issues.

The temperatures in Denmark are usually probably in the -5°C to +30°C range which should be safe.

 

We have pretty good mobile internet infrastructure in Denmark that supports 4G and 5G and it's cheap (if you ask me).

The minimum subscription gives you about 5 GB data for about $4 CAD per month.

You can also get subscriptions with 100 GB data for about $20 CAD per month.

And some carriers go nuts and offer you 2000 GB (that's 2TB !) for about $34 CAD.

 

Plus when you have a subscription our carriers can usually give you a "data sim-card" for a device (smartwatch, tablet etc.) along side your normal card.

 

My challenge is finding a SIM module that supports 4G - As mentioned I saw a module that only supported 2G.

 

Thanks for the heads up regarding the 18650 batteries - If I choose one of those I will look for a reputable source.

 

I will keep you posted with updates.


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1073
 

@surfer In my project, I only want to grab a few parameters from the OBD port, so I was planning on using LoRa for the communications. I'm only interested in monitoring the car while it is parked, which in my case is for 99% of its life (I barely drive 500km per year).  My biggest concern is keeping track of my battery voltage; since I drive so rarely, I always have to boost it!

Ron is correct about the cost of mobile here in Canada; we can't get those 3-dollar-a-month data-only plans as they have in the US. Your rates sound attractive as well. In your case, that would seem the best route, especially with the video requirement.

You could swap your DHT11 for a DHT22; it can go down to -40C (or F, it's the same temperature) and is also more accurate. 

😎

Bill

 

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Inst-Tech reacted
ReplyQuote
(@surfer)
Member
Joined: 2 months ago
Posts: 7
Topic starter  

@dronebot-workshop, One of the reasons I considered the Raspberry Pi was the OBD hat that is has which I assume would make it easier to communicate with the ODB.

 

But then I saw this guy who developed a companion board for the ESP32 giving it access to the OBD:

He sells the board from his website.

 

I wonder if a battery meter connected to the car battery would simplify your project?

Maybe something like this with LoRa instead of Bluetooth:

 

I don't know if using the OBD is required but it may be more complicated.

 

Having said that - I am interested in the ESP32-OBD combination and would like to know more about it. 🙂


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6827
 

@surfer The car battery is the equivalent of a power bank of 80,000 to 120,000 mAh. That should last quite a while but so should 10,000 as long as the temperature stays in the usable zone.

You need to check what the temp ranges are for the battery chemistry. It will probably be Li-Ion so it can't be charged below 0C and should not be used (discharged) below -20C. You are probably safe on the discharge side, but at risk on the charge side. I would use a temp sensor to control the charge circuit.

I can't find a simple data sim (Bell or Rogers), they probably have them but intentionally discourage their use. My car has an option for it (I said HELL NO) and it's $35 for 5 GB. I use a 3rd tier phone provider for both my wife and I. I upped my plan to 10GB when we were travelling across Canada, but I just checked and if I want to reduce it the cost is the same for 5GB and a slightly lower cost gets me 1GB so I will leave it as is for now. My wife has a very small plan that costs $15. Both are unlimited voice, and text.

Cellular is very expensive in Canada unless you know about these 3rd tier companies (owned by the first tier, same towers, 4G not 5G). We have no need for cell internet, we have 1GB wireless at home and lots of free hot spots around town.

It sounds like you know already who sells real 18650 batteries, or at least how to tell the good from the bad. If so, tell the rest of us as many members here have been ripped off. Even Amazon has fakes. I spoke to the Canadian company that sells just batteries, and long story short, the less expensive batteries he has in stock he will NOT guarantee the capacity of, but when he gets the good ones I stock he will for about 3 or 4 times the price if not more.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6827
 

@dronebot-workshop Maybe think about a 'maintenance charger', NOT a trickle charger. It has to be smart enough to stop trying to charge once full and allow it to self-discharge to at least 90%. I had one for my ATV just to make sure it would start after a night of -30C and the battery being exposed to the wind.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@surfer)
Member
Joined: 2 months ago
Posts: 7
Topic starter  

@zander , The Danish Consumer Agency, Tax agency and similar agencies can be quite fierce in Denmark, meaning Danish companies don't mess around as much as online or international companies.

 

As a consumer in Denmark we have a 14 day periode (by law) where you as a consumer can return any product bought online (in Danish webshops) should you not be satisfied with it.

We also have a 2 year / 24 month period where you can complain about any product you bought and companies get 3 tries to fix the problems, replace the product or money back.

 

By buying locally instead of Amazon you are protected as a consumer and companies will be fined should there be issues with safety or if products are fakes/knock-offs.

 

International companies (Amazon, etc.) probably just have a disclaimer stating that they are not responsible for the products even though they sell them and profit from them.

 

It naturally helps to buy known brands since the companies behind the products also want the public to know that their products are quality products.

Their products will of course cost more than what you can find on Amazon - So do you want to go for the price or quality?


   
Ron reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6827
 

@surfer Wow, that's great consumer protection. Do you have the name of the Danish battery manufacturer? The fakes I speak of have Sony, LG, NCR on the labels, but any 10 yr old knows how to print a fake label.

When you have the time, please post a link to one of the Danish manufactured batteries so I can see if it's worth the price plus shipping.

BTW, who pays shipping for the returned items?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1073
 

@zander Yes, that's obvious, but as I have nowhere to plug it in, it's not too helpful!

I was, however, considering a solar charger.

This post was modified 2 months ago by DroneBot Workshop

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6827
 

@dronebot-workshop Ok, sorry I assumed a typical Canadian house, garage, driveway with outdoor GFCI receptacles and as long an extension cord as needed. In northern Ontario where the winter often got down to -30C overnight I keep my RV powered up with a 150ft extension.

Just shows me why I should be careful of assumptions.

What about solar? That might be an idea for a project, especially for the Canadian audience.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1073
 

@zander LOL, I just edited that to say that ("great minds think alike" or "fools seldom differ" - one of those).

We do have outlets, but they turned them off decades ago. When I lived in Edmonton, everyone plugged in their car, and I also had an inline coolant heater and a battery blanket.

But we have drifted off the topic, and I don't want this thread going the way of the "Python" discussion that became a list of old-age ailments(which, believe me, I could contribute to. My arthritis is so bad today that I can hardly move).

So, let's get back on track and assist Surfer.

@surfer OBD is also easy to do with an Arduino or ESP32, in fact, I was considering doing an article and video about it.

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6827
 

@dronebot-workshop For some reason we all have outlets here (about 400 parking spots) for free!

Do you have an OBD project in your list of future projects? I think that would have broad appeal, I have a device that plugs in and tells me all kinds of stuff.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 1 / 3