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.

PIC circuit help

Status
Not open for further replies.

ric355

New Member
Looking for a bit of help understanding why my circuit behaves the way it does. I've built an electronic speedo which uses a hall effect sensor and outputs the speed via a multiplexed 7 segment arrangement. There is also an LCD in the system for other functions.

What I have found is that unless I put series resistors on the power pins of the 18F4420 (270 ohm), then int2 fires constantly. int2 is where my hall effect sensor is connected. This results in the system giving me a huge speed reading all of the time. The reason I took out the resistors were twofold: Firstly, I've been trying to get the segments reasonably bright, and secondly I've never come across any circuit diagram for a PIC showing the need to have resistors on the power pins like that. I put them there in the first place because the chip was running too hot long before I got to the point in the project of using 7 seg displays. But I think the reason the chip was getting hot back then was because I was driving LEDs off the output pins without any current limiting resistors (which now of course I have).

I've found that when I connect my scope to try and understand what is going on, the problem goes away as soon as I connect the fly lead to ground i.e. the speed returns to zero, but I still can't get a reading via the hall effect sensor when that happens. But if I put the resistors back on the +5v pins (there are two sets of power pins on this chip) then everything works as it should.

Can anyone explain what electrical properties are causing my problem and what I should do? Afraid I'm not able to post a full schematic at the moment.
 
Hai., Welcome to the site
the power supply for the PIC taken from an automobile needs lot of filteration to avoid spikes and noise. if you can watch the dc ona scope you observe these thiings. the sereis resistor is patially helping as a limiter and filter

you try to condition the VCC to the chip before anything else.
 
I assume that the power supply regulator outputs 5V to the PIC. As noted by MVS Sarma, a car's electrical system is a noisy place. One thing to try is to run the project from a separate battery. That way you can see if the noise is coming in though the power supply leads or via the connection to the Hall effect device.
Afraid I'm not able to post a full schematic at the moment.
A diagram would really help. Even a scan of a piece of paper with scribbles on it will do. :D
 
ric355 said:
Can anyone explain what electrical properties are causing my problem and what I should do? Afraid I'm not able to post a full schematic at the moment.

Unfortunately without a full schematic it's not really possible to offer any meaningful advice (and you need to post one showing ALL components) - but it's most likely that you have made a fairly basic error?.
 
At the moment the project is only built on a breadboard, and is therefore not currently being subjected to electrical noise of the vehicle - although the point is taken that this will need to be dealt with.

The supply is being delivered via a mains powered adaptor set at +5v. I intend to use a 7805 to get it working in the car itself (as part of a circuit to smooth out the noise) but haven't reached that stage yet.

Will try and get a circuit diagram sorted out for posting.

Thanks for the help so far and for the welcome :) .
 
For the time being the int2 plulse may be conditioned using perhaps an opto coupler and the power supply suitably decoupled. using an inductor for Vcc decoupling in addition to decoupling capacitors is not uncommon.
 
ric355 said:
The supply is being delivered via a mains powered adaptor set at +5v.

These power supplies are not regulated in any way, they often output a couple of volts higher than specified under no load. You should set the voltage to about 9 volts and include a regulator circuit to get the +5. If your PIC is getting hot the first place to check is the power supply.
 
I agree. I suspect the so called 5v from that power brick is the culprit. Have you measured the voltage?
 
don't ever do anything else
and first of all have a 7805 on board your micro board
and then give aroud 8VDC
you will be safe
 
Mike said:
I agree. I suspect the so called 5v from that power brick is the culprit. Have you measured the voltage?

Yes - it measures 5.19v. It's a supply with a variable voltage setting, so I think it already has proper regulation on board. I've just checked the output on the scope as well and it is totally smooth.
 
SYE said:
These power supplies are not regulated in any way, they often output a couple of volts higher than specified under no load.

And the rest - I've seen a 6v wall wart giving out 10+ volts under no load
 
ric355 said:
Yes - it measures 5.19v. It's a supply with a variable voltage setting, so I think it already has proper regulation on board. I've just checked the output on the scope as well and it is totally smooth.
What does it read across the PIC power pins without the resistors in series ?
 
ok - how about putting the resistors on but measure the other side of the resistor to ground. Also measure the voltage across your power supply with nothing connected
 
picbits said:
ok - how about putting the resistors on but measure the other side of the resistor to ground. Also measure the voltage across your power supply with nothing connected

Nothing connected - 5.20v
Across the resistor measures 0.88v
At the pin side of the series resistor measures 4.31v to ground
 
Sounds like it could be a regulated supply already then.

I'd still seriously consider using a 7805 in there and driving the 7805 with a 9-12 volt source. For testing purposes you could even use it on your car but I wouldnt leave it on there long term (use an LM2940 for car use)
 
ric355 said:
Yes - it measures 5.19v. It's a supply with a variable voltage setting, so I think it already has proper regulation on board. I've just checked the output on the scope as well and it is totally smooth.
If you think that the output is regulated, you shouldn't add series resistance. Microcontrollers imply large changes in load current. That current produces a voltage drop accross the resistor and the supply voltage (Vdd) will not be constant.
Did you place the probe on the Vdd pin? What is the signal like?
 
All said, if the current of all LEDs is to flow thro the PIC it might get hot (even in sink mode) In the sink mode this current may not be measurable on the Vcc line but the Vdd line will be indicative. the datasheet may say that each pin may sink xx mA but perhaps may not all at the same time.
if the case is such, it is better to to have buffer transistor or IC like ULN2003.
the O.P may also analyze his/her needs in this perspective.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top