Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Hints for designing the PIC 18F452 based motor pump

Status
Not open for further replies.

viveklengade

Member level 1
Joined
Mar 19, 2005
Messages
39
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,286
Activity points
1,674
please tell me the hints for designing the PIC 18F452 based system.
 

Re: PIC 18F452

What do you think under "designing the PIC 18F452 based system."?
 

Re: PIC 18F452

basically i am designing the circuit which dose following functions
1. Over volatge protetction
2. under voltage protetction
3. over load portetction
4. dry run portection
5. measuring the total run time of pump
6. preset on/ off of pump
 

Re: PIC 18F452

Ok, you are working on serious project and unfortunately I can't help you. Sorry.
 

Re: PIC 18F452

Hello viveklengade,

You are asking for too much, without giving enough information. It makes it difficult for us to give you good information.

You need to outline the design first, and break it into 'sections'.

First, what type of pump (motor), what power supply, and is it mission critical? For example, a small DC pump, a 3-phase city water supply system, medical dosing pump...?

Then, what sensors are you going to use? Any sensor can be interfaced to a microcontroller in some way, but some are easier than others.

The software is probably the easy part for this type of thing. C would be my language choice, BASIC probably would do as well for this. Assembler might be needed only if the thing is really critical. But then you need to talk to your insurers as well...

Sort out the basics, then try asking for more 'specific' help and we'll see what we can do.

Best wishes,
FoxyRick.
 

Re: PIC 18F452

Hi FoxyRick.
basically i want to design the general purpose system for the motor(pump) in the farm. which include
1. Over volatge protetction
2. under voltage protetction
3. over load portetction
4. dry run portection
5. measuring the total run time of pump
6. preset on/ off of pump

i am using the I2C, for serial EEPROM 24c04 and RTC DS1307, lcd display 8*2, and 4 keys. tell me is this suuficient or i have to give some more info.
thanks and regards,
vivek lengade
 

Re: PIC 18F452

Hi Vivek,

Your parts look OK for the microcontroller side of things. There is plenty of sample code around for using the display, and i2c code for the RTC and EEPROM is simple enough. If you pick the right compiler, it will have these functions built-in, so you can concentrate on the logic of the problem rather than the interfacing details.

Can I ask, is this a 'project' you have been given, or is it a real commercial design? Since you have not given any information about what sensors you will use to detect 'over voltage', 'run dry', etc. I will assume you want to talk about the software side of the design. Your sensors then will simply give a 'signal' that is connected to the PIC's pins.

Is the control circuit going to be battery powered? It makes a difference to how the code is written to conserve power.

For the software side, most of the time your PIC will just be waiting for some stimulus it needs to act on:

1. Programmed Timer (preset turn on or turn off)
2. Manual Override? (User pushes a button for on or off)
3. Problem Stimulus (voltage, overload, dry)
4. Keep track of Run Time (and update EEPROM periodically)
5. User presses a button on the control panel (run the user-interface code)
5. Update the display if needed

There are two ways to do things like this, you can either have the PIC execute an endless loop that continually checks (polls) the sensor input pins and the current time, and acts if anything has changed. The other is to use the interrupt pins for the sensors inputs, so that the PIC automatically runs some code if there is a change.

Your PIC is going to be very underworked in this design, I think. But that's OK.

I would use the interrupt method. That way, you don't have to worry about a problem condition (eg. run dry) being missed if your code is doing something else at the time.

So then you have a loop that simply looks for the user pressing a button (that's a low-priority event compared to the sensor inputs) and acts accordingly (runs user interface).

The interrupts would be for:

1. A sensor input (check which sensor caused it, act accordingly)
2. Timer interrupt (1 second pulse from yout RTC - check the time and act accordingly, maybe update a clock on the LCD)

That makes things quite easy. You can have a table of user-entered start and stop times that is checked against the current time every second (on the Timer interrupt). Also in that code, you can check for things like "is it time to update the EEPROM?" etc.

Is this the sort of help you are looking for?

I've recently designed something quite similar to this, although much more complicated and with more inputs and outputs, to control my garden lights and pond pumps and heaters.

Cheers,
FoxyRick.
 
Re: PIC 18F452

viveklengade said:
basically i want to design the general purpose system for the motor(pump) in the farm. which include
1. Over volatge protetction
2. under voltage protetction
3. over load portetction
4. dry run portection
5. measuring the total run time of pump
6. preset on/ off of pump

i am using the I2C, for serial EEPROM 24c04 and RTC DS1307, lcd display 8*2, and 4 keys. tell me is this suuficient or i have to give some more info.
thanks and regards,
vivek lengade

18F452 is an overkill for this application. Use an 28 PIN or 18PIN device.

1. When you have EEPROM inside the PICmicro, there is no need to use external SEEPROM unless you want to store large amounts of data.
2. The RTC can be realised using TMR1 with a 32768 Hz crystal.
3. Over & under voltage protetction can be realised by detecting the mains voltage.
4. Over load portection can be done by sensing the motor current (jammed rotor, etc).

Rest is in software.

Cheers

Ravi
 

Re: PIC 18F452

ravimarcus said:
18F452 is an overkill for this application. Use an 28 PIN or 18PIN device.

1. When you have EEPROM inside the PICmicro, there is no need to use external SEEPROM unless you want to store large amounts of data.
2. The RTC can be realised using TMR1 with a 32768 Hz crystal.
3. Over & under voltage protetction can be realised by detecting the mains voltage.
4. Over load portection can be done by sensing the motor current (jammed rotor, etc).

Rest is in software.

Cheers

Ravi

Yes, 18F452 is overkill.

Your points 1 and 2, while not incorrect, might not be appropriate for this situation. The run hours of a motor is important, and should the PIC be swapped out for a firmware update, or be reprogrammed, or die, the flash memory might be lost, thus losing the current run hours. I would use the EEPROM myself for this.

Keeping the RTC in software is easy even without the 32768Hz crystal. I have one running with an accuracy of better than 1 second per month after simple initial adjustment. However, if the power is lost, the time needs to be re-entered for the timed operation of the pump and this might not be appropriate for the application. The addiditon of an external, battery or supercap powered clock eliminates the potential problem.

If the pump operation is non-critical or the whole circuit is power-protected, then your suggestions may be appropriate, and would certainly save cost and circuit complexity.

Cheers,
FoxyRick.
 

Re: PIC 18F452

FoxyRick said:
Your points 1 and 2, while not incorrect, might not be appropriate for this situation. The run hours of a motor is important, and should the PIC be swapped out for a firmware update, or be reprogrammed, or die, the flash memory might be lost, thus losing the current run hours. I would use the EEPROM myself for this.

What if the EEPROM were to die ???

Keeping the RTC in software is easy even without the 32768Hz crystal. I have one running with an accuracy of better than 1 second per month after simple initial adjustment. However, if the power is lost, the time needs to be re-entered for the timed operation of the pump and this might not be appropriate for the application. The addiditon of an external, battery or supercap powered clock eliminates the potential problem.

32768 Hz crystal is to have a RTC running in battery backed up mode where the current consumption is low.

Cheers,

Ravi
 

Re: PIC 18F452

thank you for giving the lot of interest in my project.
basically i am final year student.this is my college project. sponsored by one local company. if i am able to complete it, then it is commercially launched.
there is one more thing on and of timer. schedule. that is for week and some times for the months. so i preferred to use eeprom. as am i using the RTC i can use its internal NVram for also storing the data. other than this when type of motor is changed the dry run current and all other data will change so i think for EEPROM and RTC.
 

Re: PIC 18F452

hi guys
i started working on PIC 18f452. but i want to know that is any body used on chip adc? if yes how he is used the same for an application?
 

Re: PIC 18F452

viveklengade said:
hi guys
i started working on PIC 18f452. but i want to know that is any body used on chip adc? if yes how he is used the same for an application?

The code is the same as 16F877 with a bit of modifications. You can check with the data sheet.

Cheers

Ravi]
 

Re: PIC 18F452

Here is Microchip's example. I hope that will help you.
 

Re: PIC 18F452

hai

for all your requirements u need just an ad conversion
but the inputs itself different.
with help of timer and adc u can do adconversion in
certain time interval one by one
 

Re: PIC 18F452

hi guys !
i am facing new problen now a days.
i write a prog for I2c write it works fine,i write prog for I@c read it work fine, but when io write combined prog of write and read it is not working . plz help me.
 

Re: PIC 18F452

hi guys, talking about PIC 18F452 based project, I would like to ask something. How to build a programmer ( a circuit that use to write program into PIC 18F452) ?
I would like to buy an universal programmer but am afraid did not have the money to do so. So i am building one myself but there isnt any nice site which provides the schematic for making my own PIC 18f452 programmer.

Please help.
 

Re: PIC 18F452

You can try proteus simulator from labcenter electronics. It will greatly reduce your time and money to design and troubleshoot your circuit.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top