PDA

View Full Version : Processor Rebooting and garbled LCD display!!



siddharthsh
09-07-2008, 12:00 AM
Hi All,

I am trying to develop a simple digital speedometer and tachometer for my motorbike

Using the following hardware:
PIC16F877A
11.0592 MHz
16x4 LCD

THE PROBLEM:
The RPM and Speed readouts work fine, but:
1) The moment I press the horn the LCD starts to display all kinds of random garbled characters. The only option is to restart the system, which is quite dangerous and cumbersome while riding
2) Sometimes the PIC also reboots (As I am able to see the startup routine on the LCD) accompanied by the garbled images on the LCD


WIRING:
1) I am using shielded wires from the sensors
2) I have included 2 capacitors 10uF and 100pF at the 5V LM7805 power supply (power supply is common for the PIC and the LCD)

TROUBLESHOOTING DONE SO FAR:

1) Made a Diode + Resistor + Capacitor circuit, but as soon as I press the horn the PIC reboots. I also tried a 2200uF and a 1000uF capacitor but none seemed to work

2) I Made the PIC and LCD run from a separate 9Volt pocket torch light battery with the circuit power and ground both separated from the bike power and ground. Now when I pressed the horn...nothing happened, the PIC did not reboot and continued to work normally. I must have pressed the horn at least 30 times but the PIC never rebooted

3) With the PIC connected to an external battery as in #2 I also connected the GND of the PIC circuit to GND of the bike (the 12V of bike was not connected to the PIC circuit). Now when I press the horn the PIC reboots again. Upon noticing this I checked with a multimeter and found that the grounding of the bike is floating when I press the horn .i.e. when I press the horn there is a voltage difference between the negative terminal of the bike battery and the body of the bike..even though in the electrical circuit diagram of the bike it shows that the battery negative and the body of the bike are connected.

Do you know what could be happening here, and what can be done to resolve this issue?


Looking forward to your suggestions and inputs.

Regards
Sidd

MohitM
09-07-2008, 12:29 AM
Besides the caps at the LM7805, you would also need a decoupling 0.1uF capacitor at the PIC's power pins.

How is the horn connected to the PIC? Show us your circuit diagram. You could draw lines in air all day, but it won't help.

siddharthsh
09-07-2008, 12:49 AM
Point noted, I will try with the decoupling capacitor connected to the PIC power pins.
The horn is not connected to the PIC. The layout or the circuit of the horn has not been altered in any way. Its only when I press the horn this phenomenon of the PIC rebooting occurs.
Unfortunately, right now I do not have a circuit diagram.
Regards,

docel
09-10-2008, 06:59 AM
The Horn draws a lot of current from the Battery and modulates the Power lines. This is in terms of low voltage /high voltage spikes that the Micro sees as some interrupts via he port input lines or brown-out triggers via the Power bus.

The Horn also radiates an EM Radiation and will wireless-couple this energy into the Micro. This energy starts off in the Audible freq range and move off into several multiples of it , well into the microwave range.

The remedy for this with a shared Power is quite complicated and maybe unnecessary. An external power source is the simplest solution, as you have realised too! This will solve the irrelevent problem and you can better concentrate on the main project.

As an interesting aside, the Auto horn was the basic principle behind the worlds First Wireless transmitter!!!