
Lumpy
Canada
Asked
— Edited
Hey All,
Trying to work this MPS Gas Cap into my R2 project.
I want to use it as a fail safe switch in case R2 makes a break for it.
I want to use it in reverse of what it is advertised for. Basically I want R2's power to be on when the "plug" is in and shut off if the "plug" is pulled.
I've tossed it together on my bread board and it does run at 5V no problem.
I'm thinking of somehow linking it to the EZ-B ADC port. Somehow read the port to sense what state it is on (Plug in or out). From there I have a Dimension Engineering R/C relay that I can patch into my main power source for R2.
If R2 takes off I want to be able to grab and pull the plug triggering the relay open.
Does this sound doable?
Thoughts? Suggestions? Beer?
Kris
Yes, that Picoswitch you linked to is only capable of 1A @ 24VDC. Here's a 60A Automotive Relay that should work well.
That's what I figured. I think I have some surplus relays with harnesses out in the garage. I take a looksie tonight.
So on the output side of the switch I'm left with a ground wire. What should I do with it?
Just tie it back til you know everything works.
Got Everything working last night.
Basically the MPS Gas Cap is powered and monitored by ADC0. Relay is controlled by D8.
ADC0 Port: 0V= Power On / Relay On 5V=Emergency Stop / Relay Off
(3) Scripts control the MPS Gas Cap for physical emergency shutdown and reset.
(2) Scripts are for voice command for emergency shutdown and reset.
Not sure if they are the most efficient scripts but it's working smoothly.
Critical Stop Main script monitors the ADC0 port. If the key is pulled it runs Critical Stop 1 script and ends. If all is well it continues to monitor and loop.
Critical Stop 1 changes the state of the relay and executes Critical Stop 2 script and ends.
Critical Stop 2 monitors the ADC0 port for the key to be replaced. Once the key is replaced it ends and re-starts Critical Stop Main script.
I have (2) voice commands setup to work as well.
R2 Emergency stop - Executes All Stop 1 script and turns relay off. It also shuts down Critical Stop Main script.
R2 Emergency Stop Reset is to re-activate. It then checks to make sure the physical key is in place, turns the relay back on, and starts up Critical Stop Main script. If no key is inserted it continues to loop and wait for its insertion.
Sorry to bore the hell out of you all with this. This is a crucial item for my 200+lb droid.
My file is now up on EZ-Cloud.
If anyone has any suggestions on merging / optimizing the scripts PLEASE let me know.
Kris
P.S. - I'm working on adding a video. Stand By!
Awesome!
A quick vid of the MPS Gas Cap in action!
You can see the relay in the middle green LED going on/off.
Very creative!!!
Thanks DJ!
I'm trying. Starting to learn the power of scripts. Next up will be the personality script.