Notifications
Clear all

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

38 Posts
4 Users
11 Likes
921 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7084
 

@surfer Cool, I too am interested in both the ESP32 OBD device plus the temp monitor. I have added it to my list of projects. Thanks!

Don't want to use a Pi in the car, that needs a much bigger battery bank. A PICOW or ESP32 can do the job.

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


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

@surfer Ok, back to your project. After a quick look at your requirements and your Wokwi link I see a few areas of concern.

A Pi 3, 4, 5 is definitely a problem power wise, if the ESP32 can do the job it is much less power hungry.

Test just the GPS with a 1 hour sleep, my concern is the GPS with no power for an hour might take longer than you think to 'find out where it is'.

Off the top of my head I don't recall which model of esp32 offers deep_sleep in the uA range unless you are talking CHIP vs Devboard. I have been involved in many discussions about low power as I am designing a game camera that needs to be battery operated. You will need to spend a LOT of time researching this. Also, what chemistry is that 10,000mAh power bank? If it's a Li-Ion, I had one from Anker and I recently had to scrap it as it started to swell. LiIon is the MOST dangerous, followed by LiPo and the LiFePO4 is very safe also available in 18650 form factor. Here is a link to a proper charger for the LiFePO4 and LiIon. Here is the charger I use for all cylindrical batteries. This charges, tests, discharges for capacity measurement and does storage charge LINK If you go the route of LiPO, I don't recall how to charge the small bags, but the big RC batteries use this charger LINK

These might seem expensive, but compared to using a cheap model that burns down your car or house they are a bargain.

I will slowly replace my 18650 LiIon with 18650 LIFePO4. A little less power per cc but SAFE.

You need to figure out how you will recharge the Power Bank. A USB charger inserted in the car 12V adapter is a start, but if the Power Bank is depleted, you will only be able to put in 1A (1,000mA) so it will take 10 Hrs. If you can get a really good USB2 charger then 2A so cut 10 hrs in half, and if the 12V adapter can handle it maybe a USB-C at 3A will reduce the charge time to 3 hrs and a bit.

Now here is the catch that trips up most people. You need a battery board (UPS) that allows charging while discharging. This is the second most counterfeited product, and due to the technical wording I doubt you will even get an honest answer in Denmark. I recently saw a video where a fellow took one of those boards and reworked the PCB traces etc to make it correct. Ther are real UPS boards, but they cost many times more than the $5 Aliexpress fakes.

I am not aware of any ESP32 UPS boards, but there are several PICOW UPS setups, and also Pi Zero UPS boards. My favourite boards are ESP32, PICOW, and Pi ZERO 2 W.

Good luck and have fun.

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


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

Sorry for the late response - life got in the way of fun 🙂

 

@dronebot-workshop Wow, 500 KM a year is nothing - I believe the insurance companies in Denmark expect you to drive a minimum of 10.000 km - 15.000 km ("included" in the minimum package).

 

LoRa was also something I thought about as a solution but believe a SIM-card solution is probably better in my case.

 

Your approach of using OBD to read the battery voltage might actually be a good idea.

I was doing some research on using the car battery as a power source for the ESP32. Some people commented that during some events (ignition etc.) the voltage could spike beyond the 12 - 15 volts and possibly reach 160 volts for a very short time.

I am not sure what I spike like that would do to the ESP32 - but at the same time the car is made up of many low voltage components which I do not believe can handle a spike like that..

I am however looking forward to video on the safer alternativ - using OBD with ESP32 🙂

 

@zander I looked up the capacity of a new battery for my car and it's at 44,000 mAh which also is plenty.

It should be enough to last from friday afternoon to monday morning where it gets recharged - maybe also in the weekend.

 

In regards to our conversation about batteries the "guarantee" og quality comes from both requirements from the government and reputation of companies.

The government has strict requirements even if a company simply imports batteries then responsibilities are imposed upon it.

In theory you should be able to purchase batteries from any Danish that will ship to your address and preferably from a name brand and not the discount variants.

You should be able to purchase Philips, Sony, LG and others without worry.

 

If you are not satisfied with the product you can return it to the webshop and get all your money back (including the shipping expense to your address) but you do pay for shipping the returned items.

 

Thanks for the heads up about the GPS - in light of this information I think I will consider an approach like this:

* Wake up ESP32.

* Try to get signal and allow up to 10 minutes (or up to 30 mins) for gathering data.

* If GPS does not respond within the interval it should just send temperature and "0.0,0.0" as GPS coordinates.

* Sleep

Since this is not a time-sensitive project a delayed GPS reading of a stationary car is acceptable.

 

I would probably be using a ESP32 DevKit which I hope has deep sleep.

There are also different tests that show various low power consumptions like 0.05 mAh (50 uA) in deep sleep.

 

Yes I would have to look into the whole battery/charging situationen - it's never easy 🙂


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

@surfer What you need if a charger is involved is called a UPS, that eliminates any surge.

Since the return shipping will far exceed the cost of the batteries I will continue with Amazon that pays shipping both ways especially now that I can test the capacity of the batteries (after the first test of simply weighing them)

Let me know if you can get anywhere that 50uA figure. Also check if that is a dev board or just the chip.

Good luck.

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


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

@zander Thanks - will do 🙂


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1711
 

Hi @surfer,

  I hope you don't mind if I point out one of my own brief studies, as I notice your 'power cycling' approach has similarities with an article I wrote a while ago.

https://forum.dronebotworkshop.com/?wpfs=davee%20rtc

This refers to a different microcontroller, but with some adaption might work with the ESP32.

In a nutshell, it uses a separate RTC chip, to power up the microcontroller, and removes the power from the microcontroller when it has serviced its wake up session. Hence, microcontroller current draw when it is 'sleeping' is effectively zero. Note the microcontroller is not put into a 'sleep' state, but is completely de-powered, and then rebooted on each power up.

The leakage current whilst de-powered was less than the resolution of my general-purpose multimeter, but this will depend on the specific MOSFET chosen.

This obviously requires the RTC chip, plus a MOSFET as extra parts, which cost me about $5 when I prototyped it, whilst using the ESP32 clock would use built-in capability. I can see pros and cons to both approaches, some of which were discussed at the time in this forum ... I only offer it as a something to consider ... not a magic solution.

-------

As for powering from a car battery, then clearly any supply will need to filter out spikes, etc. I note that some cars disconnect vehicle electronic devices whilst the starter motor is being operated, which maybe the most likely source of major spikes. Perhaps some research into this side of vehicle wiring would be profitable, as components like radios, computers, etc. must cope with the same issues. Of course, this would deprive the circuit of incoming power for a few seconds, each time the engine was restarted. With 'old style' internal combustion engined cars, this would normally only be once per journey, but with hybrids and other fuel saving systems that start the engine many times per journey, this might be more problematic.

--------

Best wishes, Dave


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

@davee @surfer Indeed a wake up circuit will save battery life, however in this case it may cause more problems than solve. First of all a GPS is involved, and completely depowering it will cause it to go into a 'find me' state upon powering up. If that algorithm is well coded, it will only take a few minutes, but if poorly coded could be hours. The second point is the car is likely going to be started thus charging the battery long before the battery runs out of power. Obviously, that is just a SWAG until a full 24 hrs of use is measured for power consumption. 

As a Ver 1 I would just use the builtin esp32 sleep routines and if more power saving is needed then consider using an RTC.

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1711
 

Hi Ron @zander & @surfer,

   I tend to agree that if the car battery is involved, the power consumption becomes less important.

However, if the power consumption is critical, then some experiments, measurements and calculations to find the optimal solution becomes more important.

I make no predictions as to which approach is optimal ... I was merely suggesting an approach that effectively eliminated all power drain by the microcontroller during the 'sleep periods'. Whilst I am sure some commercial products successfully use the 'sleep' type modes, the 'gossip' I have heard from various sources, covering various different microcontrollers and manufacturers over a rather long period, has typically suggested, that it can be more difficult to implement than the data sheets suggest. Hence, I always recommend that a solution is prototyped, and measurements taken, before finally deciding upon a strategy.

-----------------

In addition, rebooting the processor for each 'wake' period, may reduce the chance of soft data errors due to single event upsets (SEUs) causing a significant loss of data, etc., thereby reducing the need for watchdog timers and so on. Of course, the RTC may suffer a failure, including an SEU, but its limited complexity should make it less vulnerable than a microcontroller.

-----------------

As for GPS, I haven't used any of modules, but my GPS wristwatch, which is powered down when not in use, usually finds a fix within a minute or so if it is outside, and its design is over 10 years old, and the actual watch is nearly as old, so I would hope contemporary modules could do at least as well as that. Although the watch is powered off between uses, it clearly holds some data from its last fix, as a starting point for the next one, so perhaps some care is needed when choosing or connecting a GPS module to ensure it is not doing a completely 'cold start' each time. Another are that may benefit from some further research!

Best wishes and good luck, Dave


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

@davee @surfer If the GPS is connecting that fast then it is powered. Yes, storing the last fix helps as that gives the search a better starting point. The actual start-up time will need to be measured under real-world conditions. I have owned many GPS units starting when they were just big bricks with a B&W display of Lat/Long so I am quite familiar with their capabilities. Speaking of GPS, the OP will need to use some sort of GPS antenna unless the device is placed well forward on the dash. Do not be fooled by watch-like devices seemingly working inside buildings. GPS signals are weak and easily blocked as are any RF signal by building materials. Those watch like devices simply 'fake it' until they get a new signal. Inside a car is a really bad location, to get a signal it has to have a window exposed to the general direction of the transmitters and the signal will bounce around inside the metal cage that a car is unless it's a fibreglass car.

I am trying to make the point that as Dave said you need to prototype all of this, there is much more than meets the eye.

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1711
 

Hi Ron @zander and @surfer,

   The oldie watch I referred to, is a well-known (in the market, about a decade ago) Garmin model for running (outside only), etc., and its battery life is around 8 hours max, when new, so I don't think there is much room for faking. I agree, GPS indoors is completely 'hit and miss' at best. It occasionally takes a little longer to do a first fix from power on. It is usually fine in the car, as is my mobile for Google Maps, providing it is at, or above, the bottom of the windscreen line.  Near floor level inside the car is too well shielded for GPS, and certainly not reliable. Obviously, different vehicles will have different characteristics, and any 'metal cavities' may form effective shields. A lot depends on how essential it is to have 'flawless' data reception.

As with all projects, when trying to do something 'new', be prepared to prototype and adapt to reality a step at a time.

Best wishes, Dave


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

@davee It also depends where you are relative to satellite coverage. I am probably further north than almost everyone on the forum so when I left a GPS in the south facing window for several hours without getting a GPS lock that latitude plus a few trees could explain it. I have had some GPS units work reasonably well in the car as you suggest as long as it is above the dash line, and I have had others not work at all in the car which is why they sell magnetic GPS antenna mounts for cars. As far as battery backup, here is a picture of a very popular GPS board. Notice the teensy tiny battery top left corner.

IMG 8208

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1711
 

Hi Ron @zander,

    GPS is another thing I claim NO special experience about, but your mention of South facing window, etc. and high latitude suggests you might be thinking of the geostationary satellites used for TV transmissions, etc., which are always directly above the same point on the Equator of Earth, as briefly described in https://www.esa.int/Enabling_Support/Space_Transportation/Types_of_orbits

For these satellites, then it would be normal to have a roughly South Facing dish, assuming you are in the Northern hemisphere, and not close to the Equator.

------------

GPS satellites fly in a dynamic pattern, intending to provide roughly the same coverage to any point on the Earth. In this case, the 4 or more satellites 'visible' to a stationary receiver on Earth, at any given time, are continually changing. e.g. https://gssc.esa.int/navipedia/index.php/GPS_Space_Segment provides some illustrations and says:

The satellites in the GPS nominal constellation are arranged into in six equally-spaced orbital planes with an inclination of 55 degrees in relation to the equator. Each plane contains four “slots” occupied by baseline satellites. This 24-slot arrangement ensures users can view at least four satellites from virtually any point of the planet.

I think the problem with 'normal' (i.e. vertical, flat glass) windows, is that they face in a particular direction, be that South, North or somewhere in between. Hence, at a particular time, one or more of the satellites that would be 'visible' outside the building, are effectively 'behind' the window, so that their signal must pass through the building structure, to reach the receiver inside the building. Of course, many common building materials attenuate the signal, and the resulting signal strength may be too low to be noticed by the receiver.

This implies that over a period of time, a North facing window would be no different from a South facing window ... they will both be affected in the same ways by surrounding objects, like trees, etc. Of course, at any one moment, the positioning of the satellites, may favour the South facing window, but at a different time, the North facing window may be favoured.

Of course, other objects visible from the windows, such as trees, hills, other buildings, etc. will further reduce the opportunities for a satellite to be in 'direct view', especially when the satellite is near the horizon of the receiver.

----

I haven't checked, but I suspect the tiny battery on the board you are showing is used to power a tiny static RAM which remembers data from the last fix. Providing the receiver has not been transported a large distance (perhaps more than hundreds of miles?) since the last fix, this stored data provides a much better starting point for the receiver to find the satellites, and hence reduces the time needed for the first fix when it is repowered.

------------------------------------

Of course, it is to be expected that a proficient antenna on the roof of a car would be better at receiving signals than an antenna on the inside of the vehicle, and it might include an amplifier to boost the signal, but if it was my project, I think I would start with some tests using an internal antenna, hoping that an external antenna was not needed.

--------

Best wishes, Dave


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

@davee That was my point, a battery is needed to allow the GPS to do what I call a 'smart start', otherwise it would as did mine when new take hours.

As to the satellites, yes I confused the different types of satellites. It is not relevant to this discussion.

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


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

@davee Both of us are showing our age. You mentioned 4 satellites. I knew there were more, but when I looked it up I was shocked. The answers are for US only GPS, I am right now seeing 13 and with all the other (5 total) GPS systems enabled on my tracker I am seeing 48. I think they are as follows USA(13), Russia(8), China(18), Japan(0), and Europe(9)

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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1711
 

Hi Ron @zander,

  I think we are 'on the same page'! An event worth celebrating!!

  It will be obvious to you, but in case anyone else reads it, my comment about the battery was to emphasise that it is only retaining some static data; NOT keeping the GPS receiver constantly working. This is in contrast to the way many people who rely on their phone for navigation (Google Maps, etc.), who probably leave the GPS function active 24x7. Of course, their phone will get connected to a charger at frequent intervals, so the constant current drain is more acceptable.

PS I see we have crossed in the post again. I mentioned 4 satellites, as I think the minimum that need to be received 'simultaneously' for a 'reliable' fix is 4. In a clear view position, you would expect to see more than that, but some may be at angles that increase the errors. My understanding is that some clever maths calculates not only the position, but also an estimate of the error (or uncertainty) in that position, given the available data, etc.

Strictly, only the US system is called GPS, and the reference I listed discusses the 'full' GPS set having 27 satellites at any one time, although there are more than that for spares, special purposes and so on. Of course, the 27 or so satellites are distributed around the World, so only a small subset will be 'visible' at any one time.

The generic name for the technology is GNSS (global navigation satellite system), and in addition to GPS, there are Russia's GLONASS and Europe's Galileo, and China's BeiDou. Japan and India also have systems, although I am not clear how effectively they cover the entire World. Clearly, you have one of the more systems that can receive multiple systems.

 

Best wishes and take care my friend, Dave


   
ReplyQuote
Page 2 / 3