unevolved
unevolved Dork
4/20/12 11:04 a.m.

I need some help. I'm trying to get a 5V square wave RPM signal to turn into a 12V square wave signal for a digital dash I'm putting in a Formula SAE car. I know I've seen people smarter than me pull this off with Megasquirt setups, but I can't seem to find any resources that explain in simple terms how to figure out what circuit I need to make.

Any help would be appreciated. I'd love to get this dash working for a test day tomorrow and Autocross Sunday.

Giant Purple Snorklewacker
Giant Purple Snorklewacker UltimaDork
4/20/12 11:11 a.m.

This isn't really a megasquirt guru issue - you need a basic transistor inverter supplied by a 12v source ("amplifying" the 5v signal).

EDIT: Google NPN common emitter circuit

unevolved
unevolved Dork
4/20/12 11:23 a.m.

Oh, OK. I just threw that out there as it's the only place I've seen this used. I'll start reading up on those... the electrical engineers on our team haven't been much help.

PseudoSport
PseudoSport HalfDork
4/20/12 11:33 a.m.

Is the ignition triggered by a hall sensor? If so instead of feeding the hall sensor 5V can you feed it 12V and get a 12V square wave?

unevolved
unevolved Dork
4/20/12 12:21 p.m.

Nah, it's a COP. Here's the car I'm working on:

It's got a Yamaha WR250.

Looks like a NPN common emitter is exactly what I need. Looks like I'm making a trip to Radio Shack.

AngryCorvair
AngryCorvair PowerDork
4/20/12 12:24 p.m.

is the ground clearance of the nose higher than the FSAE regulation cones?

unevolved
unevolved Dork
4/20/12 1:56 p.m.

Nope, unfortunately not. Although I feel like if we're hitting cones with the nosecone, it's time for a driver change.

Dr. Hess
Dr. Hess UltimaDork
4/20/12 2:12 p.m.

2n2222. They're like practically free.

unevolved
unevolved Dork
4/20/12 3:05 p.m.

Ha! That's what I got! Perfect. Just wired it up, time to see if I did it right.

unevolved
unevolved Dork
4/20/12 3:39 p.m.

Alright, it's not working. Tell me what I did wrong.

Here's the diagram I used.

Here's what I wired up-

Vin is the 5V square wave (verified that it's indeed 5V with an oscilliscope)

V+ is 12V constant

Vout is the (theoretical) 12V square wave output

Rc is three resistors in series that measured to 11.6kOhm

Re is a 4.6kOhm (measured) resistor that goes to ground.

Vout is coming out as a 12V constant, not a square wave. What did I hook up wrong?

Giant Purple Snorklewacker
Giant Purple Snorklewacker UltimaDork
4/20/12 4:03 p.m.

You need a forward bias - when the square wave drops to zero the transistor falls to it's inactive state. Add a 2.3v DC source to the 5v square wave to make it oscillate between 2.3 and 7.3.

EDIT: Google voltage divider network

peter
peter Reader
4/20/12 4:06 p.m.

Before I go digging too far, you sure you've got things hooked up to the right pins on that transistor? BTDT.

unevolved
unevolved Dork
4/20/12 4:20 p.m.
Giant Purple Snorklewacker wrote: You need a forward bias - when the square wave drops to zero the transistor falls to it's inactive state. Add a 2.3v DC source to the 5v square wave to make it oscillate between 2.3 and 7.3. EDIT: Google voltage divider network

Okay, that makes sense. I'll have to try that. I wire up a voltage divider for a thermistor for the water temps on this thing.

And yeah, I'm fairly confident I'm more likely to have a fundamental flaw rather than a wiring issue at this point.

Dr. Hess
Dr. Hess UltimaDork
4/20/12 4:24 p.m.

Look at the wiring diagram for the front panel LED's. I think that's about what you want. I can't find my schematics here, but I think you want the emitter grounded and a bias resistor on the base. But then, I learned on tubes and these newfangled transistors always did confuse me.

fritzsch
fritzsch Reader
4/20/12 4:25 p.m.

Oh I just learned about all this stuff! I still can't help though haha

Dr. Hess
Dr. Hess UltimaDork
4/20/12 4:33 p.m.

Yeah, look at the megamanual, or what I have on my drive as MegaSquirt V3 Main Board.doc. Dunno how it is on teh net. Anyway, about the last page, labled as "injector pulse", "warm-up" and "accel shot". All the same circuit. +12v to 330 ohm resistor to your signal point to the collector. Signal in to a 1K resistor to the base. Emitter grounded.

unevolved
unevolved Dork
4/20/12 6:44 p.m.
Giant Purple Snorklewacker wrote: You need a forward bias - when the square wave drops to zero the transistor falls to it's inactive state. Add a 2.3v DC source to the 5v square wave to make it oscillate between 2.3 and 7.3. EDIT: Google voltage divider network

I'm sorry for such a fundamental question... but how? I've got the 2.5V voltage source, how do I add it to the square wave? Just simply wiring them together doesn't work.

peter
peter Reader
4/20/12 7:24 p.m.

I think this helps...

linky

Let me process and get back to you.

unevolved
unevolved Dork
4/20/12 7:43 p.m.

Just tried 12V to 12kOhm to Signal out to Collector, Signal in to 4.6kOhm to Base, and Emitter grounded. No dice. Same configuration as what Dr. Hess recommended from the Megamanual, but with different resistor values. Should I try that same configuration with different resistor values, maybe 330 and 1k like he used?

Dr. Hess
Dr. Hess UltimaDork
4/20/12 8:36 p.m.

Hotlinked fer ya, Ag.

You leave the diode out of the circuit and attach your "signal out" between the 330 ohm resistor and the collector, where the diode was. Or, leave the diode in the circuit and you can watch it blink. Take your out signal at the non-banded (+) end.

Paul_VR6
Paul_VR6 HalfDork
4/20/12 8:57 p.m.

1k on the base and 330-1k pull up to 12v on the collector, emitter to ground

unevolved
unevolved Dork
4/22/12 1:18 a.m.

Finally got it working, and then the Dash2 died. Seriously. I was in the middle of changing some filtering settings, and it just froze and refused to respond. Reflashing the firmware would always result in a "connection error" and fail.

Never buy a Race Technology product. Seriously. This dash has never successfully been used since we bought it in 2007.

Hungary Bill
Hungary Bill Reader
4/22/12 3:13 a.m.

I'm a little late now, but if you run into something like this in the future you might want to give "Multisim" a try. Its a simulation program that'll allow you to build and test circuits. (I'm sure you can find an older version as shareware, but we use Multisim 11 for my classes)

good luck!

Our Preferred Partners
SBbguOv5CuTZjTxaFW8xG9xFI0K7QX8Wk3S8zN6aN5RH6aG3Hg8ReS8LKzMUSh7w