DIY Automatic DashCam shutoff when parked at Home

SwapFile

Learning to Drive
General User
Joined
May 3, 2020
Messages
20
Reaction score
34
Location
Minnesota
I've got a DR900S-2CH with B-124X. The setup works well on weekdays, but I noticed that if I come home and park in my garage on a Friday and I don't go anywhere on Saturday I need to remember to flip the battery off unless I want a dead DashCam Battery on Sunday. A dead battery on Sunday is annoying for short grocery store trips where the battery won't have time to recharge.

I'm lazy, and I couldn't find any commercial solutions, so I decided to build a device to automate shutting my dashcam off when I park at home.

First, I did some testing to figure out if I needed to actually flip the B-124X off (which would likely involve soldering inside the unit) or if I could simply disconnect the dash cam from it.

The B-124X itself has about 76.8 Wh of capacity. I took measurements over a few days and found that the onboard bluetooth & CPU consumes approximately 90mA @ 3.3v, which seems reasonable given the CPU (STM8L151) and Bluetooth (CRS 1010) datasheets. That means that a B-124X left on with no Dashcam hooked up will drain its own battery in about 10 days.

That also means that after a 3 day weekend, you would still have close to 70% of your capacity left, which seems acceptable to me.

Next, I grabbed an ESP32 feather and made a prototype with one input (car accessory power, via an optoisolator) and one output (a low side fet switch on the dashcam power).

Whenever the car accessory power turns on, it immediately turns the dash cam on. Whenever the car turns off, it wakes up and tries to connect to your home wifi. If it succeeds, it sends you an email, and then goes to sleep for an optional delay time, before waking back up and shutting your dashcam off. If it fails, it leaves the dashcam powered and goes back to sleep.

Here is the code:

You can tap into accessory power from the B-124X dashcam output plug. It's the pin between the two plugs the stock harness uses. There are places that sell a 3 wire output harness but it can be hard to find, if you are already ordering parts you may just want to buy precrimped wire and add it to your factory plug.

To properly deep sleep, an ESP32 feather needs to be powered by a modified USB cable, cut the data lines, and tie D- to ground with a resistor. You also will want to cut the ground wire to avoid a ground loop, you want the ESP32 to ground through the camera, not the camera to ground through the smaller USB cable. The USB cable can plug directly into the B-124X.

The Sparkfun ESP32 thing can in theory deep sleep a little better, but no matter which you use, the power consumption will be eclipsed by the Blackvue's Bluetooth that is always on, so it really doesn't matter much. I'd use whatever you have on hand.

This device is still a work in progress, but I thought others might find it useful if you want to build your own. Mine is currently disassembled as I rebuild it into a cleaner version.
 

Vortex

Making Videos
Observer
Corgi Lovers
Advanced User
Lifetime Premium Member
Joined
Jul 19, 2012
Messages
20,099
Reaction score
48,561
Location
Washington State
What a great idea! I've heard of tons of people asking for a solution like this and I love that you're building one. Please continue to document your build process and sharing how things go. :)
 

SwapFile

Learning to Drive
General User
Joined
May 3, 2020
Messages
20
Reaction score
34
Location
Minnesota
I think the device is done, if anyone wants to build their own, let me know and I can help source parts. I don't really want to go into production on these, but if someone else does that would be great.

I added a web interface to adjust the settings so people don't need to hard code their settings.

Here is a video showing it in action.

Schematics are on the github page, along with code and comments:
 

Attachments

sdrawkcaB

Defender of Light 📶
Advanced User
Lifetime Premium Member
Joined
Mar 6, 2018
Messages
5,644
Reaction score
11,246
Location
Here
Could this work for any dashcam that utilizes Power and ACC voltage to switch between driving and parking mode, such as the Viofo A119 v3? Could it be used with a dashcam that does not have an extended battery module like the B-124X?
 

SwapFile

Learning to Drive
General User
Joined
May 3, 2020
Messages
20
Reaction score
34
Location
Minnesota
This should be able to be used with any dash cam, it just needs 3 inputs (B+, Accessory, and Ground) and it provides one switched 12v output. The 5V USB power could be pulled from B+ with an adapter, I used USB power because it was quick and easy and already there on the B-124X. In practice you'd probably was a 12V to 3.3V regulator and power the CPU directly to keep efficiency high.

If was using it without a battery pack I'd want to add a low battery voltage check so that it won't keep the camera running and drain your battery further if the battery is low. Right now it only looks at if the car is running, your location and time (a shutdown countdown when the car turns off with your home Wi-Fi in range).
 

SwapFile

Learning to Drive
General User
Joined
May 3, 2020
Messages
20
Reaction score
34
Location
Minnesota
Here are some nice high res shots of the B-124X if anyone wants them for reference.

I'm 5 days into another battery test, and I'm realizing the unit may last longer when turned on with nothing connected than I expected. I forgot how flat the discharge curve on LiFePO4 batteries are, the pack started at ~13.85 fully charged, within a day it was down to 13.28, and now 4 days later it's still at 13.28.

I'll keep the test running until I get useful data, or the rest of the parts for my dashcam install arrive. As much as I like running tests, I'd rather have my Dashcam in my car, and I think I have enough data already to say it lasts "long enough".

Side effect of the flat discharge curve: The bluetooth battery gauge becomes almost completely inaccurate after a few days of being "on" with nothing attached to the pack. The gauge seems to re-adjust pretty quick after you start charging it and using it with a dashcam attached, and I don't really look at it unless I'm troubleshooting something, so I don't consider it a major concern.
 

Attachments

Last edited:

SwapFile

Learning to Drive
General User
Joined
May 3, 2020
Messages
20
Reaction score
34
Location
Minnesota
Note: If you look closely, you will see a hidden microUSB debug port that is behind the case sticker. I don't think its actually USB, the pads are labeled differently, I probed it but didn't see anything on my scope. I didn't want to dig too deep into it and risk breaking anything so I left it alone, but it is a good place to start for future probing. Maybe it's for provisioning the software, and it expects external power? I'd need to map the traces before doing more.
 

SquirrelMaster

Likes Unicorns 🦄
Security
Corgi Lovers
Advanced User
Lifetime Premium Member
Joined
Dec 3, 2015
Messages
3,839
Reaction score
9,078
Location
Liberal California
Note: If you look closely, you will see a hidden microUSB debug port that is behind the case sticker. I don't think its actually USB, the pads are labeled differently, I probed it but didn't see anything on my scope. I didn't want to dig too deep into it and risk breaking anything so I left it alone, but it is a good place to start for future probing. Maybe it's for provisioning the software, and it expects external power? I'd need to map the traces before doing more.
Considering its proximity to an stm8 microcontroller, I'd guess its connected to the SWIM interface.
It's used for programming and debugging the MCU. Data, reset, and power pins.
 

SwapFile

Learning to Drive
General User
Joined
May 3, 2020
Messages
20
Reaction score
34
Location
Minnesota
That would make total sense. I've never worked on the STM8 series, mostly been doing STM32 stuff with SWD debugging. Bottom line, it's not an extra serial interface leaking any immediately useful data (unfortunately).

I've got an expansion battery pack on the way, I might crack that open and take a few pictures of the insides when it arrives, but I expect it to be pretty boring, just a pack of batteries and maybe some protection.
 

SwapFile

Learning to Drive
General User
Joined
May 3, 2020
Messages
20
Reaction score
34
Location
Minnesota
B-124E disassembly pictures attached:

Update on the B-124X "on with no camera connected" test (readings taken daily at 7am):
Tuesday 13.85v
Wednesday 13.28v
Thurs-Sat - Forgot to check, but likely no change
Sunday 13.28v
Monday 13.26v
Tuesday 13.27v
Wednesday 13.26v
Thursday 13.26v

I just did another today mid day reading and got 13.25, so its possible it's nearing the end of the flat discharge curve. I'm planning on installing this system in my trunk over the extended weekend, so if I don't get any major drop off by Saturday I'm just going to hook up my Dashcam as a load and see how long the remaining battery lasts under load to estimate the remaining capacity. When full on my workbench bench, I was getting 19:30 hours before the camera shut off.
 

Attachments

SwapFile

Learning to Drive
General User
Joined
May 3, 2020
Messages
20
Reaction score
34
Location
Minnesota
Friday at 7am, after 10 days of being on with no dash cam plugged in, I switched over to a discharge test. The pack lasted lasted 13 more hours.

Assuming at full it would have lasted 19:30, that means 6:30 hours of battery was spent in 10 days of being idle, or a burn rate of ~3.3% of total capacity per day. Plenty good for me!
 

Discord Server

Latest threads

Forum statistics

Threads
85,156
Messages
1,294,409
Members
21,475
Latest member
theodore1972
Top