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.

ttl switching 12V supply

Status
Not open for further replies.
I decided to change PIC, i'm now using a 16f77, it's a huge 40 pin thing, but it's the only other one I had. Anyway, it works a lot better now. It doesn't reset as often, however, I noticed that the regulator gets super hot, and then it resets, anyway to prevent that?
 
ptewright said:
I decided to change PIC, i'm now using a 16f77, it's a huge 40 pin thing, but it's the only other one I had. Anyway, it works a lot better now. It doesn't reset as often, however, I noticed that the regulator gets super hot, and then it resets, anyway to prevent that?
What type of regulator do you have, something like 7805? Make sure you have those small 100nF Caps there.
 
Jay.slovak said:
ptewright said:
I decided to change PIC, i'm now using a 16f77, it's a huge 40 pin thing, but it's the only other one I had. Anyway, it works a lot better now. It doesn't reset as often, however, I noticed that the regulator gets super hot, and then it resets, anyway to prevent that?
What type of regulator do you have, something like 7805? Make sure you have those small 100nF Caps there.

Yeah, I'm using the LM7805C. From L.Chung's diagram, I switched C1 from 470uF to 33uF, because that's all I had, and I'm using a 100nF for C2 as you suggested. The rest is the same as that last diagram. The motor doesn't seem to run for more than 4 minutes. The regulator heats up after that, then the PIC keeps on resetting.
 
ptewright said:
Yeah, I'm using the LM7805C. From L.Chung's diagram, I switched C1 from 470uF to 33uF, because that's all I had, and I'm using a 100nF for C2 as you suggested. The rest is the same as that last diagram. The motor doesn't seem to run for more than 4 minutes. The regulator heats up after that, then the PIC keeps on resetting.

I would suggest the 7805 is overheating, causing the output voltage to drop as it shutsdown.

I presume you're feeding the motor from the 5V rail?, this is causing excessive dissipation in the regulator - try fitting a good sized heatsink on the 7805, or powering the motor from the unregulated supply (depending what voltage it is).
 
Nigel Goodwin said:
ptewright said:
Yeah, I'm using the LM7805C. From L.Chung's diagram, I switched C1 from 470uF to 33uF, because that's all I had, and I'm using a 100nF for C2 as you suggested. The rest is the same as that last diagram. The motor doesn't seem to run for more than 4 minutes. The regulator heats up after that, then the PIC keeps on resetting.

I would suggest the 7805 is overheating, causing the output voltage to drop as it shutsdown.

I presume you're feeding the motor from the 5V rail?, this is causing excessive dissipation in the regulator - try fitting a good sized heatsink on the 7805, or powering the motor from the unregulated supply (depending what voltage it is).

What does the "5V rail" mean? I'm feeding in 12V to the motor as shown in the diagram. I already added a heat sink to it. If I use a 12Vdc adapter that plugs into the wall, is that regulated or not?
 
ptewright said:
What does the "5V rail" mean? I'm feeding in 12V to the motor as shown in the diagram. I already added a heat sink to it. If I use a 12Vdc adapter that plugs into the wall, is that regulated or not?

The 5V rail is the output of the 7805, but if you're feeding the motor from the 12V input that can't be the problem.

Assuming it's connected solely as the diagram shows?, the current demand from the regulator by the PIC should be VERY low - no more than a milliamp or two?.

This wouldn't cause the regulator to get hot! - which makes me suspect the regulator may be oscillating. A 470uF on the input is rather too high to be effective, you really need a smaller capacitor - I usually use something like 10uF on both input and output, as close as possible to the pins of the regulator. But as suggested, 0.1uF is commonly used - if you have access to a scope, test the input and output pins of the 7805 and see if it's clean!.
 
I think that I finally solved my problem, it seems that the PIC was resetting because of current spikes from the motor. I tried sticking capacitors and diodes pretty much everywhere, it didn't really work.
Then I decided to swith the red and black leads from the motor. Instead of having the black wire of the motor connected to the drain of the mosfet, I now have it connected to the 12V supply. The red wire of the motor is now connected to the drain of the mosfet.
This seems to have solved the problem, although the motor is now running in the reverse direction. Is that an issue? (The motor is part of a pump)

Thank you everyone for all your help!!!
 
This wiring can help or even solve your problem.
 

Attachments

  • mycircuityz.gif
    mycircuityz.gif
    7.4 KB · Views: 530
eblc1388 said:
This wiring can help or even solve your problem.

This is exactly what I'm doing.
Is there a way to save some variables in the program just right before it resets, for example if I had a count value. The if the program resets, I just check what that count value is, and I'll know where to pick up from there?
 
ptewright said:
eblc1388 said:
This wiring can help or even solve your problem.

This is exactly what I'm doing.
Is there a way to save some variables in the program just right before it resets, for example if I had a count value. The if the program resets, I just check what that count value is, and I'll know where to pick up from there?

If it's reseting you have a problem! - you should fix the problem rather than try to bodge round it. The circuit as you have drawn it doesn't show what the PSU is like - I would suggest a far larger electrolytic on the input of the 7805 (1000uF?), plus small caps on it's input and output.

There's also no way to know when a reset might occur, so you don't know when to save the variables, or even if it will complete saving them?.

You previously mentioned the 7805 was getting hot, you now seem to have ignored that?, is it still happening?.
 
Nigel Goodwin said:
If it's reseting you have a problem! - you should fix the problem rather than try to bodge round it. The circuit as you have drawn it doesn't show what the PSU is like - I would suggest a far larger electrolytic on the input of the 7805 (1000uF?), plus small caps on it's input and output.

There's also no way to know when a reset might occur, so you don't know when to save the variables, or even if it will complete saving them?.

You previously mentioned the 7805 was getting hot, you now seem to have ignored that?, is it still happening?.

I've added some 100nF caps on the input and output (ie. in parallel with the existing ones). Is that what you meant? I tried numerous combinations of capacitors, the current configuration seems to work best. The regulator does not heat up anymore.
A reset rarely occurs, but it would be nice to know if one occured. Do PICs have non-volatile memory for storing variables?
 
ptewright said:
A reset rarely occurs, but it would be nice to know if one occured.

So you have gone from PIC always resetting to rarely occurs. The problems just vanished in thin air.
 
eblc1388 said:
ptewright said:
A reset rarely occurs, but it would be nice to know if one occured.

So you have gone from PIC always resetting to rarely occurs. The problems just vanished in thin air.

The problems were reduced little by little with all the suggestions in this forum. Shortening up some of my wires also helped!!! Thanks a bunch :p
 
ptewright said:
Jay.slovak said:
ptewright said:
Do PICs have non-volatile memory for storing variables?
Yes, it's called Data EEPROM Memory :)

Do you know how to access the eeprom in c code?

Your C compiler should have I2C functions built in, they will explained in the user manual - if not you could always write your own?, but you may as well use assembler to do it anyway?. Or get a better compiler?, I don't do C, but from what I've seen I2C support is commonplace.
 
Nigel Goodwin said:
Your C compiler should have I2C functions built in, they will explained in the user manual - if not you could always write your own?, but you may as well use assembler to do it anyway?. Or get a better compiler?, I don't do C, but from what I've seen I2C support is commonplace.

oh it's called i2c, i'm using MPLAB, it has an i2c example, i guess that I just need to follow that then....awesome!!! :wink:
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top