PCM Diagnostics & Tuning HP Tuners | Holley | Diablo
Sponsored by:
Sponsored by:

TPS for switch on off?

Thread Tools
 
Search this Thread
 
Old 04-14-2018, 12:43 PM
  #1  
TECH Enthusiast
Thread Starter
 
ElQueFør's Avatar
 
Join Date: Dec 2011
Posts: 531
Likes: 0
Received 3 Likes on 3 Posts

Default TPS for switch on off?

I want to control a switch or relay with a certain TPS % threshold. Is this possible? A Hobbs switch for boost is my backup option but I'd really like to explore the possibility of of using TPS to switch a relay on or off instead.


I'm going to add a fluid pump to the T56 hybrid I finished a month or so ago and I'm playing with ideas on how to control it. I don't want a toggle, except for maybe a manual override, I'd rather automate the process. A Hobbs switch will do the trick. But is it possible to control switches/relays with TPS????

As some of you know, the vehicle is a mutt but here are the relevant details as I can think of them now.

90 GMT400, LQ4, S475, T56, 3 bar SD 411 PCM.
ElQueFør is offline  
Old 04-14-2018, 04:21 PM
  #2  
TECH Senior Member
iTrader: (25)
 
truckdoug's Avatar
 
Join Date: Nov 2013
Location: Portlandia
Posts: 6,330
Received 526 Likes on 356 Posts

Default

If you're good with Arduino boards you could do it. Tps output is a .5 to 4.5 volt output.

Ms3pro or Holley dominator might have an output you could configure to do that. Hp tuners does not.

Or you rig a microswitch on the throttle cam itself.

Lots of ways to skin thatcatt
truckdoug is offline  
Old 04-14-2018, 07:59 PM
  #3  
TECH Addict
iTrader: (32)
 
brandon6.0's Avatar
 
Join Date: Dec 2009
Location: Glennville, GA.
Posts: 2,294
Received 21 Likes on 18 Posts

Default

Nitrous micro switch sounds like the best and easiest way. Just read the tps with your software and make bracket for trigger around tht tps%.
brandon6.0 is offline  
Old 04-14-2018, 10:50 PM
  #4  
TECH Enthusiast
Thread Starter
 
ElQueFør's Avatar
 
Join Date: Dec 2011
Posts: 531
Likes: 0
Received 3 Likes on 3 Posts

Default

Right on, thanks guys.

Might need to revisit some of my arduino experience from the flow bench and see how involved controlling it that way will be.

I have no experience with these microswitches. Do they have to be for nitrous setups? I get a few electronics catalogs in the mail. All Electronics is one. They have all kinds of weird eccentric stuff. I wonder if there is something in there that might work.
ElQueFør is offline  
Old 04-16-2018, 08:48 AM
  #5  
TECH Senior Member
iTrader: (25)
 
truckdoug's Avatar
 
Join Date: Nov 2013
Location: Portlandia
Posts: 6,330
Received 526 Likes on 356 Posts

Default

any of those little microswitches sold on sparkfun would work.

https://www.sparkfun.com/products/9506

i'm sure everyone from nitrous kit makers to pinball machine manufacturers buy from the same place
truckdoug is offline  
Old 04-16-2018, 09:53 AM
  #6  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 104 Likes on 87 Posts
Default

Would take ~5-6 lines to do it with an arduino.
JoeNova is offline  
Old 04-16-2018, 07:23 PM
  #7  
TECH Enthusiast
Thread Starter
 
ElQueFør's Avatar
 
Join Date: Dec 2011
Posts: 531
Likes: 0
Received 3 Likes on 3 Posts

Default

My limited Arduino experience is just with that injector flow bench.


Joe, you're obviously good with Arduino, I saw your flow bench! Care to help with the code? I haven't even thought about it yet really.
ElQueFør is offline  
Old 04-16-2018, 07:29 PM
  #8  
TECH Addict
 
pdxmotorhead's Avatar
 
Join Date: Oct 2016
Location: PDX-OR-USA
Posts: 2,497
Received 475 Likes on 365 Posts
Default

If your running the pump just to cool the transmission, a contact temperature switch on the tranny would be an option.?

If your trying to turn the pump off when running hard, a RPM switch would work maybe?

Combination of the two?
pdxmotorhead is offline  
Old 04-16-2018, 08:18 PM
  #9  
TECH Enthusiast
Thread Starter
 
ElQueFør's Avatar
 
Join Date: Dec 2011
Posts: 531
Likes: 0
Received 3 Likes on 3 Posts

Default

Hmmm I'm liking all the ideas that have been suggested. I have options on how to do this which I likey!!!!

Yeah main thought is on hard pulls I want it to start spraying lube at the headset gears since the oil rushes towards the back of the case for a split second.
ElQueFør is offline  
Old 04-17-2018, 12:30 AM
  #10  
TECH Resident
 
NSFW's Avatar
 
Join Date: Jan 2018
Posts: 814
Received 117 Likes on 89 Posts
Default

Sounds like you might also want an accelerometer to turn the pump on. And throttle, and a temp sensor... sense all the things! Maybe 50 lines of Arduino code?
​​
NSFW is offline  
Old 04-17-2018, 07:13 AM
  #11  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 104 Likes on 87 Posts
Default

Originally Posted by ElQueFør
My limited Arduino experience is just with that injector flow bench.


Joe, you're obviously good with Arduino, I saw your flow bench! Care to help with the code? I haven't even thought about it yet really.
Should be easy.

Declare the analog input and digital output with variables.

Inside the loop, just do an IF analoginput > X, digitalWrite relay HIGH, else digitalWrite relay LOW. X will be somewhere between 0 and 1023 for the analog input.

4 lines of code.

Don't quote this because I don't have the IDE in front of me so I'm going off top of my head, and it depends on which board you're using)

Code:
Relay = D2;

void loop() {
TPS = analogRead(A1);
if (TPS > 950) {digitalWrite(relay, HIGH)} else {digitalWrite(relay,LOW)}
You'll have to experiment with the number. 0 to 1023 is 0V to 5V. TPS operates closer to .5V - 4.5V.

You can make the code more complicated and set mine/max TPS amounts and then convert to a TPS % from there, but it just creates extra lines that basically do nothing but make it easier for you to understand your own code.
JoeNova is offline  
Old 04-17-2018, 07:16 AM
  #12  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 104 Likes on 87 Posts
Default

and I forgot the } at the very end. I can't edit posts.

Also, you can skip the variables all together and just do.

[CODE]
void loop() {
if (analogread(A1) > 950) {digitalWrite(D2, HIGH)} else {digitalWrite(D2, LOW)}}

2 lines.
JoeNova is offline  
Old 04-17-2018, 07:23 AM
  #13  
TECH Fanatic
 
TrendSetter's Avatar
 
Join Date: Dec 2004
Location: Florida
Posts: 1,874
Received 446 Likes on 338 Posts

Default

you're going to want some hysteresis in the code.
i have exactly what youre asking for, i use it to activate my boost controller and fuel pumps. i can post some code snippets tonight
TrendSetter is offline  
Old 04-17-2018, 07:35 AM
  #14  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 104 Likes on 87 Posts
Default

Originally Posted by TrendSetter
you're going to want some hysteresis in the code.
i have exactly what youre asking for, i use it to activate my boost controller and fuel pumps. i can post some code snippets tonight
They'll help with a runaway relay in this situation, but not completely required.
JoeNova is offline  
Old 04-17-2018, 09:42 AM
  #15  
TECH Fanatic
 
TrendSetter's Avatar
 
Join Date: Dec 2004
Location: Florida
Posts: 1,874
Received 446 Likes on 338 Posts

Default

its important for when you are part throttle and it keeps switching back and forth between the on and off state.
analog signals can be noisy so you want some form of filtering in there, or a hysteresis. i like it for when I pedal it a little it wont turn my pumps/boost control on and off, it keeps them on until i let off completely
TrendSetter is offline  
Old 04-17-2018, 12:32 PM
  #16  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 104 Likes on 87 Posts
Default

I had problems with a runaway relay when using it for water/meth. When you crossed the threshold for the relay but stayed within a couple of KPA, the relay would just buzz. A full hysteresis isn't needed, just a simple gap between activation/deactivation thresholds. If TPS > 700, HIGH, if TPS < 650, LOW.
JoeNova is offline  
Old 04-17-2018, 02:38 PM
  #17  
TECH Fanatic
 
TrendSetter's Avatar
 
Join Date: Dec 2004
Location: Florida
Posts: 1,874
Received 446 Likes on 338 Posts

Default

in this context, that's what hysteresis is, homey
TrendSetter is offline  
Old 04-17-2018, 04:52 PM
  #18  
TECH Fanatic
 
TrendSetter's Avatar
 
Join Date: Dec 2004
Location: Florida
Posts: 1,874
Received 446 Likes on 338 Posts

Default

i pulled this out of my fuel pump controller i use in my truck.

Code:
#define MAPTHRESH  325 // raw 0-1023 analog in
#define MAPHIST     150 //  1 bar = 328, 1.4 bar = 461

#define TPSTHRESH   450  // raw 0-1023
#define TPSHIST     150

#define MAIN_DELAY_FASTER	10
void loop() {
	//  100hz loop
	if ((millis() - lastMil10) >= MAIN_DELAY_FASTER) { //run this every 10 ms (100hz)   
        mapRaw = analogRead(A0);
        tpsRaw = analogRead(A1);
        
        //mapV = (5000/1023) * mapRaw;  //convert to mv
        //tpsV = (5000/1023) * tpsRaw;
        
        
        if ((mapRaw > MAPTHRESH) && (tpsRaw > TPSTHRESH)) {
            // fuel pump/bc not on, but the map and tps thresholds have been exceeded
            //Serial.println("fuel pump on");
            digitalWrite(FUELOUT, HIGH);
        }

        if ((mapRaw < MAPTHRESH - MAPHIST) || (tpsRaw < TPSTHRESH - TPSHIST)) {
            //Serial.println("fuel pump off");
            digitalWrite(FUELOUT, LOW);
            
        }
		lastMil10 = millis();
	}
}
TrendSetter is offline  
Old 04-17-2018, 08:14 PM
  #19  
TECH Enthusiast
Thread Starter
 
ElQueFør's Avatar
 
Join Date: Dec 2011
Posts: 531
Likes: 0
Received 3 Likes on 3 Posts

Default

You guys are awesome.

I just checked to make sure I have a few perf boards and all the rest of the goodies from my last arduino go round and I do.

Just ordered up another Arduino board for this project. I'm going to leave the other one dedicated to my flow bench.


Do you guys have a favorite enclosure for these? I'll need one for both of these Arduino projects. My flowbench Arduino board is still just pinned in to a temporary breadboard
ElQueFør is offline  
Old 04-17-2018, 09:12 PM
  #20  
TECH Senior Member
iTrader: (25)
 
truckdoug's Avatar
 
Join Date: Nov 2013
Location: Portlandia
Posts: 6,330
Received 526 Likes on 356 Posts

Default

man i'm gonna have to get up on this arduino stuff. looks like i'm missing out on fun.
truckdoug is offline  



All times are GMT -5. The time now is 08:54 AM.