12V Tractor Battery supply: Losing Power Supply

AI Thread Summary
The discussion focuses on powering a camera mounted on a tractor using a 12V battery while addressing the challenge of preventing the camera's battery from draining when the tractor is off. A Raspberry Pi 4B is currently used to control a servo that turns the camera on and off, but concerns arise about the camera switching to its battery when the tractor shuts down. Suggestions include using a microcontroller or Arduino for easier implementation, as well as exploring a UPS system to manage power during shutdown. Alternative solutions involve using a relay and capacitor setup to push the camera's power button automatically when power is lost. The conversation emphasizes the need for a reliable method to ensure the camera remains operational without excessive battery drain.
gumby4231
Messages
8
Reaction score
0
TL;DR Summary
I'm mounting a camera apparatus on a tractor. Once the user turns the key and shuts the tractor down, my system will lose power. I'd like to run a servo when the tractor is turned off.
I want to mount a camera on the front of a tractor(Sony RX0M2, similar to a gopro). The camera will eventually be used for image processing. A PQ-12 micro linear servo (see here) will be used to turn the camera on/off. It is being run by a Raspberry Pi 4B. All components in this project will be powered by the 12V tractor battery. I have the raspberry pi running my python code to control the servo at startup. I did this by editing the crontabs in the linux terminal. Thus when the tractor turns on-> Pi starts up->Servo extends/retracts pushing the camera power button-> Sony turns on.However, when the tractor turns off the situation is more complicated. The camera will begin to use its own battery once the power source is removed. I would prefer the camera not drain its battery everytime the tractor is turned off. It would mean the tractor would have to run for 5-10mins next startup just to charge the camera back up to a battery level where it can operate.I need some way to press that power button on the camera once the system power source is removed. I need to:a) sense the battery is off. Maybe I could use a small microcontroller? A relay?b) Something that charges up while the system has power and can temporarily power the servo during discharge. Perhaps a capacitor. Perhaps a secondary battery? But then again If I do use the Servo ill need a PWM signal. Would the PI zero work here. I think ill need something small since It'll need to be powered during this discharge time also.Note: I think the Pi 4B can probably run code at shutdown but my assumption has been that this would be after a shutdown prompted by the user in GUI, not by shutting down the Pi via removing the power source. Perhaps this is an erroneous assumption.
 
Engineering news on Phys.org
Looks like you need a small UPS with additional battery.

Pi shutdown can be easily initiated by an interrupt (if you base the UPS on a chip like tps2115 it will generate it for you when switching to battery power).

Why Pi if something Arduino based will be much cheaper and much easier to implement? (No need to properly shut down the system, even if just unplugged it is ready to go next time you plug it in, raspbian can easily die).

Somehow I feel like you trying to scratch left ear with a right leg - doable with a lot of effort, but there are much easier ways. Why mechanical switch and servo? Why not Pi with its own camera?
 
  • Like
Likes sophiecentaur and berkeman
@Borek I was considering switching to an Arduino or some other microcontroller for the system shutdown reason. I'm quite new, what is a UPS?

The Camera is being used for image processing. This camera was chosen because it is capable of 1000 fps, though the camera choice is not set in stone. We have tried to use the raspberry pi camera but the picture quality is limited for our application.

Concerning the mechanical switch/servo, I haven't hardwired a switch to the cabin because a) the camera is expensive and I don't want to mess it up and b)
my partner wants the process to be fully autonomous. We tried to turn it on via software but it didn't quite turn out.
 
Uninterruptible Power Supply.
 
Does the camera have an IR remote? Arduino or similar micro-controllers can drive an IR LED to simulate a remote control.

Backup power could just be a few hundred or thousand uF capacitor.

Are you using raspberry pi for something other than pushing the button?

BoB
 
Regardless of what type of controller you use, you need to make it able to power itself down. Upon startup you can cause a relay to latch that will power up your controller. It stays latched even after you switch the ignition off. However, set your controller up to sense when the ignition switch goes off. At this point it tidies things up, shuts the camera down, then activates another relay to delatch the first one, thus powering itself down. There may be simpler ways with semiconductors and one relay or no relay at all, but in your case I would do what you are comfortable with.
 
  • Like
Likes gumby4231
@rbelli1 No IR remote. It does have Bluetooth connectivity, which enables the mobile app to turn the camera on/off and take photos. At the moment the Pi is simply controlling the servo.
 
How about without the the Raspberry and servo?
Use a SPDT (Single Pole Double Throw) relay, resistor, capacitor, and parts from a "chime" type doorbell.
This will push the button every time the power turns On or Off. Be aware that it does not sense whether the camera is already On or Off, it just pushes the button.

Camera Control.png


Operation:
  1. Power (+12V) is Off. Relay N.C. (Normally Closed) are closed. Capacitor is discharged.
  2. Power On. Relay N.C. Open, N.O. (normally Open) Close. this applies power to Res., Cap., Doorbell.
  3. As Capacitor charges, current flows thru Doorbell causing plunger to hit Camera Button.
  4. When Capacitor is charged, current stop. Doorbell plunger is retracted by spring.
  5. Power shuts Off. Relay switches, closing N.C. contacts.
  6. As Capacitor discharges, the current flows thru Doorbell causing plunger to hit Camera Button.

The Resistor (100 Ohm) and Capacitor (470uF) values are initial guesses. You will have to try different values to get the needed timing. The values will interact to some extent.

Oh, and be sure to wire the Capacitor with the correct polarity as shown. They really stink if you get them backwards, and they don't work any more.

Have Fun! And let us know how it turns out.

Cheers,
Tom
 
  • Informative
Likes gumby4231
Back
Top