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.

HELP Pic Programing dilemma???

Status
Not open for further replies.

crzy engineer

New Member


Hi everyone,

I have this project for school involving a 12F675..as you know this is a small 8 pin PIC. Well the project involves a SWITCH a DC MOTOR and a PHOTODIODE.....so this is the layout for the project.....when a human presses the switch for 2 sec the program starts running..if the photodiode detects light it will send back that analog signal and in return spin the motor for 10 sec and then stop...same as to detecting night/dark again sending the signal to the (M) to spin for 10 sec.

So friends this is my question....i will try and explain......how do i get the photodiode to stop "constently" sucking power (1mA) from the 9v battery when not in use. I ask this because the battery is gonna be plugged in for say a couple of days even weeks. Ok program stops..pic goes into "hibernation mode" which that takes care of the pic sucking power now how do i take care of that photodiode??

I was advised to add a program line that basically tells the pic to look at the photodiode at certain times of day this is simple 7am-8am when the sun rises and lets say 730pm-8pm.

Is this correct???









 

Hi everyone,
I have this project for school involving a 12F675..as you know this is a small 8 pin PIC. Well the project involves a SWITCH a DC MOTOR and a PHOTODIODE.....so this is the layout for the project.....when a human presses the switch for 2 sec the program starts running..if the photodiode detects light it will send back that analog signal and in return spin the motor for 10 sec and then stop...same as to detecting night/dark again sending the signal to the (M) to spin for 10 sec.

So friends this is my question....i will try and explain......how do i get the photodiode to stop "constently" sucking power (1mA) from the 9v battery when not in use. I ask this because the battery is gonna be plugged in for say a couple of days even weeks. Ok program stops..pic goes into "hibernation mode" which that takes care of the pic sucking power now how do i take care of that photodiode??

I was advised to add a program line that basically tells the pic to look at the photodiode at certain times of day this is simple 7am-8am when the sun rises and lets say 730pm-8pm.
Is this correct???

Can you upload a schematic?
 
Perhaps you could power the photodiode from a pin and turn off the power when you don't need to sample the photodiode.

If you were to implement a RTC (real time clock) to qualify when to power up and sample the photodiode then couldn't you just as well implement a calendar and perpetual sunrise/sunset algorithm and eliminate the photodiode entirely?

If you're using a 9v battery and a regulator then the regulator may well be adding to your power budget. If you could eliminate the regulator and use a 3.0v or a 4.5v battery you might improve the power budget.
 
Last edited:
Perhaps you could power the photodiode from a pin and turn off the power when you don't need to sample the photodiode.

If you were to implement a RTC (real time clock) to qualify when to power up and sample the photodiode then couldn't you just as well implement a calendar and perpetual sunrise/sunset algorithm and eliminate the photodiode entirely?

If you're using a 9v battery and a regulator then the regulator may well be adding to your power budget. If you could eliminate the regulator and use a 3.0v or a 4.5v battery you might improve the power budget.


Powering off the photodiode from a pin is not a bad idea.

Yeah a classmate came across the same thing....implement an RTC and get rid of that photodiode but as my teacher stated these were the only tools "allowed" for the PIC project as its a light sensoring device not a time driven one.

But the source could be modified and using "preferably" a 4.5v battery

thanks mike
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top