Page 1 of 24

Megasquirt FAQ, writeup (Updated 30/10/09)

PostPosted: Thu Jan 01, 2009 4:22 am
by tw2
Small update 30th October 09, just added a couple of pics and updates some of the install knowledge. Please note there are more up to date wiring diagrams at this stage which have not been loaded. They will be up in the next few months once they have been finished and confirmed to be as correct as possible.

This is a work in progress which is coming along nicely. I am continually adding info as I find it. The basic knowledge in the first section is hopefully enough for anyone like me who had no idea, make an informed decision about whether this is the right system to use on their car. It would be fantastic if people with more experience than me ie those who have actually used it could PM me any info they have so I can include it also. All this info applies to the gen 2 st185 since that is what most people probably are driving and any extra st165 info which is different can be added also. I am by no means an expert and do not guarantee any of this info is correct. Please PM any corrections that need to be made.

Some old progress of my project can be found in my project thread here ... c&start=75
The first 6 pages are my turbo ordeal, megasquirt starts half way down page 6.

What is it?
It is a full standalone ecu system. You will need to do this if you plan to upgrade your fuel system (ie bigger injectors) or you just want control over your fuel and ignition settings. The stock ecu has not adequately been hacked like nissan, honda people etc and at this stage cannot be chipped and burned with new fuel/ignition maps. Megasquirt is a DIY ecu and as such is a fraction of the cost of a full plug and play standalone of the likes of wolf3d v500, link g4 storm, AEM, nemesis, tec3 etc etc. Megasquirt can be purchased from in a complete assembled form for ~$100 more or in a cheaper kit set. I recommend only getting the kit set if you have some decent soldering and electronic skills. You will easily spend $100 on a proper soldering iron and other tools to make it only to find you have done something incorrect somewhere and cannot work out what it is- I have read more than one story like this where people have ended up forking out twice as much after they needed to purchase another one or have repairs done.

One final thing to consider is using a Honda ecu. These can effectively be full standalones with the correct know how and hardware. They require a Honda ecu, modified distributor and tuning hardware. It will not be discussed anymore here other than to say there is more than one cheap option available for the 3sgte however I found that in my part of the world this option was going to be more expensive than megasquirt and less straight forward.

What is required?
To sucessfully use megasquirt on the 3sgte you will need
1) A fully assembled megasquirt II kit (megasquirt I only allows fuel control, not ignition also)
2) An alternative ignition system (explained later)

option items
3) Additional sensors
4) A megasquirt loom instead of cutting up your stock loom
5) A second loom if you can get/want one so your car can be returned to the stock ecu in the future
6) A stim device (this simulates a car engine: you plug it into your megasquirt to test it and play around with the features)

Hidden costs?
Megasquirt looks fantastic when you look at the assemled unit price online and then compare to other full plug and play units. However there are a lot of costs which are not immediately obvious.
1) The stock ignition system will not work and so add $30-200 to find acceptable components from a local wrecker or new parts
2) Once you have done that you will find out the stock leads will not work. Professionally made hybrid leads can cost up to $300, or factor in the cost of some new Ford or GM leads to convert yourself
3) Many people do not consider the cost of tuning which is required whatever ecu you get, minimum- wideband O2 sensor $200 and some way to monitor knock ie "$10 knock phones" for a street tune or $500++ for dyno time and a professional tuner
4) Some of the stock sensors are difficult to use and some GM replacements may be necessary. The stock air temp sensor is located in the AFM unit and a replacement GM one will be required when you remove the AFM.

What is required of you?
A lot of time and effort understanding how the system works. This system is not cheaper than a full plug and play standalone when you account for the time and effort you will need to put in to understand and use it. You will need to construct your own loom and make small changes involving soldering among other things to the megasquirt unit depending on what features you require. You will need to install new igniton components reliably in your engine bay. A lot of time will be required to calibrate megasquirt to correctly read the stock sensors or new ones. Creating a base map will also require a bit of work especially if you are using non-stock injectors which you cannot find a base map already.

Why wont the stock ignition system work?
Quite simply- it will, just not very well. Megasquirt does not have the appropriate hardware/software to decode the stock cam angle sensor. The 3sgte distributor has a 24-1 trigger wheel. This means it has 24 teeth and 1 tooth is missing so this can be read by a sensor so the ecu knows where the engine is and what it is doing. It also has a crank angle sensor included in the distributor. Megasquirt cannot read the stock signal very well due to (noise) electronic interference and so an alternative is required. People have used the stock system but find that it idles poorly and they get a lot of misses and very poor acceleration. There has been some talk of better ways to decode this signal properly but the alternative ignition systems are cheap enough that it isn’t really an issue except if a proper plug and play megasquirt is developed someday.

This thread is a work in progress also destined to be a writeup on using the stock system- ... ge=1&pp=30

What to use instead?
There are many many options but the most common is to use a distributorless ignition system from the likes of Ford EDIS (electonic distributorless ignition system) or general motors GMDIS. I personally have attained the parts to use Ford EDIS from a wrecker. It cost ~US$50. You will require-

1) the coil which is actually two coils in one unit. Each one drives two cylinders. Although it would be pointless, the coil can be taken from EDIS V8's also since they use two 4 cylinder coils although you cannot use the ignition module from the V8 so you might as well get it from the same 4 cylinder car as the rest of the components.

The coil I picked up.

2) the EDIS 4 ignition module Here is a sample part number 89FB-12K072-AC The first 4 digits indicate the year of the car and model and so are not important. The second group of numbers indicates the module and should match. I am unsure of the significance of the last two digits. EDIS was used in many 6 cylinder vehicles so obvously avoid these, V8's and carburator models also.
This is the best resource I have found with this info. I have saved the whole website incase if ever goes down. ... uneed.html

The EDIS4 ignition module.

3) the trigger wheel sensor

A VR sensor.

4) +/- optional trigger wheel- you will need a trigger wheel but they can easily be purchased in a variety of formats from among many others. The come in many physical sizes and with different timing. The Ford ones are commonly a part of the flywheel and so are impractical to use for this application.

EDIS came out on vehicles from around 87-95 although many "1996-1997" cars from the 95 production year also have it such as the 96 Mondeo I got mine from. Beware of alluminium EDIS ignition modules as these will not work. Also obviously avoid carbs' from the earlier models as these will definitely not work. Mondeo's sierra's escort's are all good donor vehicles. Part numbers for brand new components from a variety of manufacturers can be found in the megamanual and complete packages can be purchased from ebay and other MS websites. ... uneed.html

The whole lot. Try and take as much of the wiring pigtail as possible. The VR sensor uses a standard electrical connector so you can take one from other parts of the engine if need be. The ignition module and coil have unique connectors as far as I could see.

If you are happy with all the info above then the next step is to read everything here under megasquirt 2
And finally after you understand the general principles of megasquirt you need to purchase all the necessary hardware.

PostPosted: Thu Jan 01, 2009 4:22 am
by tw2
This post will hopefully contain wiring and installation info specific to the 3sgte in the near future. Please PM me anything useful.

How to mount a trigger wheel
A lot of this info can be found at and similar sites.

This is something which pays to be done carefully as you have the opportunity to destroy your crank bearings and require a bottom end rebuild. Excessive weight and an unbalanced crank should be avoided at all costs. Use as little material to get the job done properly and ensure it is fully semetrical.

For the 3sgte you can consider welding a hollow wheel around the outside of the crank by tacking it, using the crank wheel centre bolt with a flat trigger wheel, making a custom mount or drilling/tapping holes into the crank pulley if you are brave.

To mount a flat wheel you will need to bring the crank bolt out from the recess of the crank pulley. This can be done with a properly lathed balanced steel spacer or simply with a correctly sized stack of washers. The crank bolt will need to be replaced with a longer one to make up for the length lost by the spacers. It needs to be of the same grade to take the correct torque.

Alternatively a mount similar to pit_celica's can be used to bolt the wheel to the crank using the original crank bolt which will only lose a minimum amount of its in contact threaded length. I cannot see exactly what pit_celica's looks like under the wheel but I would think a design like this could easily be made by someone with a lathe/tig welder. If the trigger wheel bolt holes were elongated, the wheel could be rotated slightly relative to the crank similar to adjustable cam gears.


To answer my own question, it is usually a better idea to use the crank to mount a trigger wheel than use the distributor to give you a cam angle signal to be converted to crank angle. The reason being it seems is because the cam rotation resonates somewhat and it gets worse with higher rpm. It fluctuates either side of the real crank rpm which of course will lead to extra problems. The most reliable way therefore seems to be the crank method. As a bonus you get to seal up the stock distributor hole and have a bit more room, no more leaking distributor seals.

This site has some very good pictures ... GTE-03.htm
This shows the Tec3 crank wheel mount and VR sensor mount on an mr2.

How to mount VR sensor
Obviously the VR sensor needs to be bolted to the engine somewhere as engine movement relative to the chassis will alter its position otherwise. The bracket should be very rigid and resistant to vibration. Being adjustable both in an angular plane around the trigger wheel and towards and away from the wheel is an excellent idea as it allows you to fine tune the sensors location. The VR sensor should be 0.75 -1.5mm from the trigger wheel. Washers can be used to alter these distances as well.


When mounting the whole lot have the engine at top dead centre. As long as it is at TDC it doesn't matter what rotation the trigger wheel missing tooth is in relation to the crank. It also doesn't matter where the VR sensor is. All that matters is that while the engine is at TDC the VR sensor reads 9 teeth (ie 90 degrees) ahead of the missing tooth. There is additional info on setting it up including the software settings here ... _index.htm and in the megamanual. If you buy a premade megasquirt II it will already come configured for EDIS.

Spark plug leads
I do believe pit_celica had his professionally made by magnecor for $300. I have also read of people simply using the stock ford ones and swapping the boots from the 3sgte ones to make them weather proof. This is moderately difficult. An easier approach is to crimp the ford coil ends onto the 3sgte leads. This means you have a 100% stock spark plug lead which seals the head correctly and functions as stock. Unless you have the $20-150 tool to crimp them, I suggest taking it to a qualified auto electrician and pay a few $ to have it done right.

How to wire megasquirt to the stock harness
This can be done in other ways also ie- make a jumper cable between megasquirt and the stock harness. It is also possible to get a second stock ecu, gut it and stick megasquirt inside it, solder the connections correctly internally and have a fully plug in system should you decide to revert back to stock for any reason. You can also make an entirely new harness using the kits sold by vendors such as DIYautotune.

It is important to realize that there are many wires throughout the engine loom which go to/from the ecu or the engines sensors but not necessarily to both the ecu and sensors. For example the 12V power supply to the idle up valve does not come from the ecu but goes through the loom. Cruise control is another system whereby the throttle body switch wire travels through the loom to the cruise control ecu but will not go to megasquirt once installed. The point of this pararaph is to state that making a new loom from scratch is fairly complicated and is not covered in the wiring diagram although if you use the BGB it should be easy to work out exactly what you need to give consideration to. It will take a lot longer and making sure other systems still function will be challenging.

From my research the easiest option is to cut the stock ecu plug off the loom and use a pre-made 18" loom using the DB37 plug to wire into it or make a patch harness (DB37 is the style of plug megasquirt uses ie 37 pins)

Here is a basic schematic of megasquirt from the megamanual.

Here is the wiring for EDIS showing its 2 wire interface with megasquirt.

Here is the stock ecu pin outs for a 1990 st185 taken directly from the BGB.

They can be matched up quite simply. I have made a list of the supposedly stock pins/wires with their colours and basic function. I have tried to match this to the megasquirt schematic above. I do not know if this is 100% correct.


Wiring Diagram's Download

st185 Wiring Diagram
pit_celica's wiring diagram
pit_celica's 2nd wiring diagram in .dwg format

This first wiring diagram is entirely made up by me. Please help with any corrections. I made it using the BGB electrical diagrams, the megamanual diagram above and what I think is common sense. Please PM all corrections or better alternatives to things. It is my third and last attempt before trying it myself to find any corrections the hard way. A basic principle behind my diagrams is to use wires already in the stock harness which have now become redundant. Examples are stock AFM wiring, MAP sensor wiring, cold start injector wiring etc etc. Since these items can now be removed the plugs/wires are there to be used for new purposes such as air temp sensor, edis etc. Obviously this means it cannot be returned to stock but certainly makes the installation a lot easier, cleaner and stock reliable.

The second diagram was kindly made by Sam (pit_celica) who is running a gen 4 caldina 3sgte and would be better for anyone without a gen 2 st185 ie st165/205 or using a different generation engine. It has all the megasquirt, edis and all stock electrical connectors labeled so you can work out how to do it yourself. Simply match the megasquirt and edis names with the same name of the apropriate plug. This way wire colour etc is irrelevant.

The third diagram is in .dwg format which is similar to CAD etc, you can download free dwg viewer here

Extra 3sgte wiring info
The idle up valve we use is not a stepper motor. Gimpster was kind enough to explain how to use megasquirt to control this function. You will need PWM add-on to the V3.0 megasquirt board or otherwise this comes already installed on the V3.57 board.

"Quick overview of how the stock idle control valve works. Our IAC's arent stepper motors. It gets a constant +12V when the keys on, and with no input it rests in the "center" of its adjustment. The ECU has two lines, ISO and ISC. O = open and C = closed.

Assuming you're using the PWM idle kit and install it per the MegaSquirt Assy manual, you will hook it to the "ISO" pin at the ECU plugs to pin 30 on the DB37. ISC you will put on a high quality 40ohm / 50 watt resistor. I highly reccomend using a quality metal body/heatsink'd resistor for this. At this point the MS will be "fighting" the close side and you'll tune your idle accordingly. This is exactly how the V6 IAC works, and my old V6 car idles great!"

Please note: the alltrac BGB uses the tags RSO and RSC instead of the ISO/ISC as found in the mr2 BGB.

This is the wiring diagram from As you can see pin 2 is used in the later boards for reducing noise using shielded wire. All connections to and from both the EDIS ignition module, the VR sensor and the tacho should be done with properly grounded shielded wire. This will reduce any electrical interference and ensure good quality signals.

Air temp sensor
You will need a new air temp sensor to run with MS. An open element GM style sensor is ideal. Without running new wires the best thing I can come up with to easily wire it in to the stock harness is as follows
- use the map sensor wiring since it will no longer be there
- tap the ground of the sensor into the brown E2 sensor ground wire of the stock MAP sensor
- use the red and white PIM wire as the signal wire
- remove pin 15 from the IG1 connector in the footwell as the PIM wire also goes to the stock boost gauge on the dash which will no longer work anyway. I do not know if the gauge would interfere with the wire at all but just to be sure.
- obviously use these wires on the ECU end to wire to MS accordingly. The ground will already be taken care of ie pin 19 on the DB37 harness going to E2 and the red and white PIM wire will need to go to pin 20 on the DB37 harness.
- the AFM wiring would be perfect also except that it is located a long way from the intake manifold. The EGR temp sensor would also be great for those with non-JDM cars who do not care about emissions.

Our stock tacho will not work with EDIS since we are now using two coils instead of one. The following circuit as can be found in the megamanual is the solution.
Taken from

The two wires from the coils are the outside wires on the 3 connector plug which goes from the EDIS ignition module to the coil pack.

These are the standard part specs used in the tacho circuit if you purchase them locally.
2x Diodes Inc Standard 400V 1A, 1V @ 1A, 5µA @ 400V
1x DIODE ZENER 18V 1W 5%, 18V @ 14mA 1W, 20 Ohm @ 14mA, 1.2V @ 200mA, 5µA @ 13.7V

When ordering from DigiKey make sure you order the idle up valve resistor at the same time.

It makes the most sense to make the circuit in the engine bay and then run one shielded cable through the firewall into the cabin to the tacho. An alternative is to cut the plug off the ignitor loom. The black wire goes directly to the instrument cluster for the tacho and means you do not have to run any additional wires yourself.


So I am sure everyone has worked out that once this is removed there is going to be a 27mm hole in the head for crap to fly in and oil to fly out. One option I was persuing was using a 5sfe distributor plug from toyota however it came in 37mm and so will not work for the 3sgte unfortunately.

This is a picture of how Bill Strong solved this problem on his 4age.
As you can see the distributor is on the side in these engines but the hole is filled with a rubber freeze plug (rubber on the inside).
They can be purchased in a variety of unexpanded and expanded sizes so they can exactly match the hole before tightening. Make sure they are definitely oil resistant but beware they can pop out. I will not use one unless I make a metal brace using the 2 distributor bolt holes to ensure it cannot come out.

Metal expansion plugs can also be used such as on most engine blocks. The size of these needs to be a very accurate match. They are supposed to be very slightly bigger than the hole they are filling so as to be a tight fit. It is a good idea to use locktite when inserting them. This is a good resource for freeze plugs. Always use brass ones. ... index.html
I am currently working on another of my own indestructible solutions.... which as of now consists of a 27mm brass freeze plug (do not use other materials). It fits the hole perfectly with some force required to get it in. More info on this is located further into the thread.

Here is the MS unit itself with db37 plug and MAP sensor port

And everything you will need
Top right is 30ft of shielded wire for signals (shouldn't need more than 10ft), followed by the megasquirt assembled unit if you buy it complete, then is my trigger wheel and spacers which will depend on the setup you choose, bottom left is the GM air temp sensor with pigtail, above that is the db37 loom to splice into the stock engine harness and finally a serial cable at the top (db 9) for tuning and usb adapter if you do not have a computer with a serial port.

PostPosted: Thu Jan 01, 2009 4:23 am
by tw2
Calibration, setting up and tuning info can hopefully be created here.

Sensor calibration
There is info on this both in the tech articles in the megamanual, at and there is also a page in the megamanual somewhere specific for toyota coolant sensors. If you replace the stock temperature sensors with GM ones megasquirt is already calibrated to them. Otherwise you can use the stock toyota one - in this case the toyota one is so close to the GM one that calibration is not required.

You will need to find a new air temp sensor to use for the manifold air temp when removing the AFM. This is because the stock air temp sensor is contained in the AFM unit and used in conjunction with the AFM readings for the stock ecu to calculate fuel requirements. The new sensor must be installed somewhere right before or after the throttle body for the most accurate readings. The cold start injector port is a nice location. Basically any area of the intake manifold which receives a decent amount of flow will suffice. The open element GM unit will most likely not require calibration as MS also should be set up for this sensor already.

To calibrate a temperature sensor you simply use a multimeter to measure the resistance across the terminals at different known temperatures. Get some ice, room temp water and boiling water and a thermometer. Enter them in.

PostPosted: Thu Jan 01, 2009 6:57 pm
by pit_celica
I'll be happy to give you any information you may need about my Megasquirt II setup. If you need any pics, please let me know. For the wiring, I'm currently in the progress of cleaning mine, so, this is the time to post your questions you may have about wiring.

Good luck with this write up!


PostPosted: Thu Jan 01, 2009 9:19 pm
by Jason88AllTrac
Also, for those who don't like to go junkyard hunting for their EDIS parts: ... oductId=17

I would like to see how others have mounted their trigger wheel and sensor on the 3S, if you have pictures that would be great.

PostPosted: Fri Jan 02, 2009 7:56 pm
by pit_celica
here are mine :



I've used the Eletromotive Tec3 crank adaptor hub and a custom machined adjustable 36-1 gear on ebay like this one : ... .m63.l1177

I've mounted the sensor with a custom bracket (this bracket may seem poor quality but it is adjustable in any way).

PostPosted: Fri Jan 02, 2009 8:50 pm
by pit_celica
Here is a completly done MS system on a GT4 3SGTE, take a look at it :

His home website :


PostPosted: Sun Jan 04, 2009 3:44 am
by tw2
Thank you pit-celica. If you could send me any info on the actual installation that would be excellent. A rough list of which wires on the loom to where would be very helpful and I would happily write it up.

Did you use the stock loom and cut it up?

I saw the ebay link you had, sold a 2" trigger wheel. Would you happen to know if a wheel that small would be compatible? I would like to mount it on the distributor instead.

Also what size wheel did you use on the crank? Any balancing problems? Thanks heaps.

PostPosted: Wed Jan 07, 2009 6:58 am
by tw2
I just finished a rough draft of the wiring diagram which hopefully isn't too incredibly wrong. I did everything I could work out but there are a few gaps which only someone who has done it can probably fill in. It can be downloaded in excel spreadsheet form from the link at the end of the second post under the large lettering.

Please PM any changes, you can email me corrected copies of it also.

PostPosted: Wed Jan 07, 2009 2:26 pm
by Pechin0351
Hey Pit_Celica
You said "I've used the Eletromotive Tec3 crank adaptor hub"
Is that from the Supra trigger wheel kit, or the Universal generic one? Or did they make one for us once upon a time and then change their minds? Thanks

PostPosted: Thu Jan 08, 2009 12:20 am
by pit_celica
I'm using the electromotive tec3 kit for a MR2 turbo 2nd gen 3SGTE. Look at the electromotive website, you'll find it. The hub fit perfectly in the crank pulley, but the bracket didn't fit for my VR sensor and the trigger wheel isn't a 36-1 setup.

So, I bought a universal 36-1 wheel (link posted above) and I built a custom adjustable sensor bracket.

The trigger wheel was machined to be able to bolt it on the hub and to have some radial adjustement on the wheel.

tw2, I'm currently making a wiring diagram like yours. I will send it to you when it will be done!


PostPosted: Thu Jan 08, 2009 1:23 am
by tw2
pit_celica wrote:tw2, I'm currently making a wiring diagram like yours. I will send it to you when it will be done!

Thanks, much appreciated. After that I will tidy the whole page up a bit so anyone can follow it in a nice logical order. I am fairly sure I got most of what I got correct when I compared it to a mk1 mr2 who wired in a similar way since toyota seem to call all their wires similar things between models.

PostPosted: Thu Jan 08, 2009 5:05 am
by ___Scott___
This doesn't apply directly to 'squirting a 3SGTE, but here is a link to the write-up I did for mounting a trigger wheel when I converted to EDIS8 on my Camaro: ... lation.htm

It may give someone ideas how they may approach that project on their car.

Notice that my VR sensor is mounted a lot like the one pit_celica showed above. It works well.

PostPosted: Thu Jan 08, 2009 5:47 am
by tw2
Thanks thats really helpful. The crank and trigger wheel looked right at home in the kitchen. One thing which has confused me a little is when the manual says have the VR sensor 90 degrees (9 teeth) in front of the missing tooth at TDC, does it mean position 1 or 2 in the picture?

Nearly every photo I have seen of a mounted sensor/wheel they are at random positions.


PostPosted: Thu Jan 08, 2009 6:07 am
by ___Scott___
tw2 wrote:does it mean position 1 or 2 in the picture?

Position 1.

That means mount the sensor in a position most convienient for your application. Then the crank is rotated so that it is at TDC. Then attach the trigger wheel to the crank pulley so that the VR sensor points to tooth 9, position 1 in your pic.

The randomness you notice is due to mounting the VR sensor in a convenient location.