PDA

View Full Version : speedometer with 18f2420 for motorcycle error



AndrijaD
- 30th April 2012, 21:11
Hi.I build speedo with 18f2420 for my motorcycle and it's run perfectly on my desk. But when it connected power supply from my bike, 18f2420 lose mind and stop working.I think that I have a lot noise from power supply.Can you tell me what I can do with my power supply to get working 18f2420.I use LM2576 for my power supply.Sorry for my English.

aratti
- 30th April 2012, 21:44
Can you post the schematic of your speedo?

You surely need to filter your power supply in a better way, but good suggestions need more info from your side.

Cheers

Al.

pedja089
- 30th April 2012, 22:31
That isn't enough information that we could point problem...
Add 10nF and 100nF capacitor close to pic power supply pins. But probably power supply isn't problem, I guess that problem is in input pins, and/or MCLR pin.
Upload full schematic.

AndrijaD
- 30th April 2012, 22:54
P (http://imageshack.us/photo/my-images/855/sema.png/)edja mozemo i na srpskom.I use schematic for power supply from lm2576 datasheet.MCLR is disable.
http://img855.imageshack.us/img855/968/sema.png (http://imageshack.us/photo/my-images/855/sema.png/)

Uploaded with ImageShack.us (http://imageshack.us)

Ramius
- 1st May 2012, 02:22
Hi AndrijaD,
It sounds more like you are getting interference from the spark plug. This can be a "challenge" to eliminate. First, I would hope you have your project in a sealed, metal box that is grounded? It may be necessary to use only "feed-thru" capacitors on any wires going into or out of the box. You could also add 3 capacitors as close to pins 19 and 20 (PIC power and ground), one of which is a .1mfd, and a 10 mfd tantalum, and 100 mfd tantalum. Why 3? Simple. Capacitors are like resistors (Called Xc) to AC (noise) and since the frequency of the noise will change with the RPM, you want to make sure one of the capacitors looks like a short to ground for the noise. Other techniques and tactics is to take your wires and twist them together in the end of an electric drill so they will "shield" each other. Hope this will give you a "start". Best, Ed

aratti
- 1st May 2012, 09:38
On top of Ramius wise suggestions, please ground pin 1, which is an unused floating input working as an antenna for incoming noise. The same apply for all the other unused pins that you show in your schematic. If they are set as input then ground them if they are set as output turn them to zero, and you can leave them floating.

"Never leave input pins floating"

Cheers

Al.

Ramius
- 1st May 2012, 12:36
Thank you Al for the compliment!
AndrijaD, one other "common" technique is to make all unused areas on your board as a "ground plane". The picture below shows one of my double sided PC boards and both the top side and bottom side with all the traces (circuitry) have all unused areas as a ground. I know the picture is not great and at least you see the idea. The ingition coils and spark plugs in any motorcycle or automotive application produce what is basically a "Spark gap" transmitter much like what was used in for radio in the early 1900's. Each time the spark plug "fires" it produces an electrical spike and a lot of digital electronics see this spike as a "valid signal". Since these spikes occur at different frequencies at certain RPM you will find the same signals used to run you PIC. You can take any portable AM radio and as you get next to your motorcycle you will start to hear this noise. Again, I hope this will assist you in getting your project to be a big success! Best, Ed


6448

AndrijaD
- 1st May 2012, 16:39
I definitely must make new board.
http://img192.imageshack.us/img192/8104/fotografija0012pb.th.jpg (http://imageshack.us/photo/my-images/192/fotografija0012pb.jpg/)
http://img204.imageshack.us/img204/9237/fotografija0011x.th.jpg (http://imageshack.us/photo/my-images/204/fotografija0011x.jpg/)

AndrijaD
- 1st May 2012, 17:13
Just one more question.Whith power supply is better.Switch(lm2576) or linear(7805)?

pedja089
- 1st May 2012, 17:37
Switch...
You should defiantly make double side board.
And use ground plane, on both side, and lot of vias between top and bottom plane. And use SMD capacitor, you can put them closer to pins. Traces form oscillator pins to crystal short as possible...
By the way nice bike and project :)
Check your PM inbox.

Acetronics2
- 1st May 2012, 20:39
Hi, AdrijaD

I've been using a '2520 aboard my lawn tractor as RPM meter, temp checker, Hour meter and servicing spy ...

enjoy ...

Alain

PS : AND I ride a Kawasaki Triple .... :tongue-new:

Ramius
- 2nd May 2012, 01:38
Really nice project Alain!
Very professional and very well designed! AdrijaD, did you notice how Alain incorporated .1 mf as well as 100mf (and other size) capacitors in his design? This is a great way to handle EMI (Electro-Mechanic Interference) / RFI (Radio Frequency Interference). As for your question about using a 7805, yes, a non-switching regulator is easier to filter the DC out. You also may wish to look at the LM123 or LM323 as the case is grounded so it is "shielded". Best, Ed

AndrijaD
- 6th May 2012, 16:10
Can I connect hall sensor directly on pin rb0 or not?

Tobias
- 7th May 2012, 04:06
I make alot of electronics for motorsports, mainly drag racing. The noise environment is unbelievable. One thing that is good to do is optically isolate as much as you can for inputs if you think you are dealing with noise problems. Use twisted/shielded wire as much as you can too. Keep wires from running parallel to other wires as much as you can.