- #1
gumby4231
- 8
- 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.