Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

New to PICs

Status
Not open for further replies.

quickrik

New Member
Hi All.

I've just discovered PIC Micros. Aren't they great!

Now I'm trying to use them for something practical, like a tachometer to connect to my motorbike. I can easily handle all the programming/maths and the LCD circuity is readily available on the internet.

I'm stuck at how to get the ignition pulses from the motorcycle which is 12v into the PIC which is 5v. Sorry if this is a really silly question.

Cheers Rik.
 
most folks I know that have done this kind of stuff, use an opamp precision rectifier and buffer for the input and a ferrite clamp on transformer for the plug lead to sense the spark...
 
Lots of ways to do this:
- opamp as wolf said. use a schmitt trigger as the buffer.
- resistive divider with a low pass filter into a schmitt trigger.
- NPN as an emitter follower, a low pass filter, schmitt trigger


what is the source of your 12V ignition pulses? If it is truely just a 12V pulse train, I'd probably use the divider/filter/ST

schmitt trigger is for cleaning up the pulse and avoiding noise induced pulses. you could use a comparator as an ST if you want.

note that low pass at 2-3X your max pulse frequency is important as noise can wreak havoc on a frequency counter.
 
Most bikes these days already have a digital instruments, fed from the ECU, so although I haven't scoped it (I don't have a ocilloscope) I'm fairly sure it will be a good clean pulse, just 12v.

I afraid to admit my knowledge of electronics is really basic so I'd really appreciate a diagram and part numbers.
 
If it's a clean 12V squarewave (personally i would advice checking with a scope though), you can simply feed it directly to a PIC pin via a current limiting series resistor (try 10K or 22K), the protection diodes on the PIC will clamp it to 5V. Ensure you choose a pin with the protection diodes though, consult the datasheet to check.
 
even if its clean, I'd still use a lowpass and schmitt trigger. cheap insurance in a rather dirty environment. also, pay attention to the power supply. I'd use a diode inline before the voltage regulator to prevent battery reversal damage.
 
The last implementation of this kind of thing I have seen, was on a Go-Kart

The problem area turned out to be massive noise injected into the power supply from the engine and various inductive loads etc
The eventual cure was to power the circuit from a good quality dc-dc convertor and use a seperate amplifier for the pick-up with an optocoupler in the input of the meter board. All sorts had been tried to cure the problem, like ferrites, chokes etc etc, all had little effect because of the varying nature and harmonics in the noise. So the first thing I would do if I were you, is check the cleanliness of what you are going to power it from...

As you say, most of the modern bikes now have digital instrumentation, but unless it actually has a tacho that you are going to replace, you won't find anything to use that is straightforward in the ECU other than the odometer ticker, and that's driven off the gearbox and of no use for a tacho.
If you are lucky, perhaps your bike either has a tacho fitted, or can be as an optional upgrade, in which case you may be in luck :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top