If I only had a Brain! - Page 6 - diyAudio
Go Back   Home > Forums > General Interest > Everything Else > The Moving Image > DIY Projectors
Home Forums Rules Articles diyAudio Store Gallery Wiki Blogs Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Thread Tools Search this Thread
Old 15th September 2005, 12:42 AM   #51
diyAudio Member
Join Date: Dec 2002
Location: VA
Ok... looks like Im only going to be able to do 2 independent fan control circuits with 1 controller... the PIC16F876 only has 2 hardware PWM generators that run independently in the background without need for software generated PWM signals.... Oh well... I guess I could add another controller to generate the PWM signals for the other 2 fan circuits then send the duty cycle for each fan to it serially....

Maybe next version.
  Reply With Quote
Old 11th October 2005, 02:34 PM   #52
diyAudio Member
Join Date: Dec 2002
Location: VA
Ok Time for an update.

I had quite a bit of time to work on this project this past weekend, and I now have a working prototype in my development environment. I need to assemble everything onto a circuit board, and try it out in the projector.

I decided not to use the Hardware PWM on the controller for fan speed at this time, I may use it later on (in the next release)

The software was pretty easy to write, although a bit more complex than just waiting for a timer to expire/etc.

Basically in the 1st release the P-Brain has 5 states:

Unpowered - No power applied to the controller (unplugged)
Shutdown - Power applied, but in an off state
Booting - Powered on, and booting the projector
Running - Normal running mode
Shutting Down - Powering down the projector

The software moves through these various states depending upon inputs like the power button/motion detector/etc.

From the unpowered state, the only possibility is to transition to the shutdown state. In this state the brain waits for the power button to be pressed. If it detects a power button press, it transitions to the Booting state where it attempts to boot the projector. If the boot is successful, the controller enters the running state, where it begins to look for motion/etc. If the power button is pressed while in the running state, the controller enters the shuttingdown state, and shutsdown the projector, then enters the shutdown state.

Im setting the initial motion detection timeout to be 3 hours, so if the controller doesnt see any motion for 3 hours, it will shutdown. A warning beep sounds for 2 minutes before the shutdown will occur.

Im setting the initial Max Projector On Time to 6 hours... this means that no matter what, the projector will shutdown after 6 hours, unless someone physically hits the power button to make it stay alive... (Im thinking of incorporating a keep alive button instead of multiplexing this functionality on the power button)

During projector boot, the controller will start the fans, then waits for motion to be seen from the motion detector (motion detector test), once it detects that the motiondetector is working... it then energizes the lamp ballast using a 120v solidstate relay. It then uses a photoresistor to look for light coming from the projector lamp. If it sees light, it enters the running mode, if it doesnt see light, it goes Idle for a while, then tries to spark the lamp again. If it cant get the lamp lit within a specified timeout period (Lamp still too hot to spark/etc), it gives up, and shutsdown.

During shuttingdown mode, the controller turns off the lamp, and lets the fans continue to run for 40 seconds.

Maybe next weekend Ill be able to do my first "In Projector" tests, but so far all is working great in my development environment.
  Reply With Quote
Old 11th October 2005, 09:40 PM   #53
tjh is offline tjh  United States
diyAudio Member
Join Date: Dec 2004
Location: RI, USA
Sounds great Luca! Can't wait to try this out for myself. One thing though: do you think 40 sec is enough for the fans to be left on for? I know that at least on my friends rear PJ tv the fans run for at least a minute, maybe two (I'll double check on that).
6/12/06: Redesigning everything, finally putting in the Ushio S400DD.
  Reply With Quote
Old 11th October 2005, 10:42 PM   #54
diyAudio Member
Join Date: Dec 2002
Location: VA
Good question...

I arbitrarily picked 40 seconds. I think once its actually in the projector, and I can do real world tests Ill pick a real value. The aim is to cool the bulb off as fast as possible, so that It will start up again quickly if need be.

This first version will be pretty basic, just the main power control functions (Lamp/Fan/Motion Detector). I want to eliminate the jitters I get everytime I turn on my projector due to the fact that I may forget its on... fall asleep... leave the house... etc. In the next version I plan to add more sophistication... (Temp sensing, fan speed control, bulb life counter, etc) It would be cool to be able to lower the fan speed and only raise it if things get too hot...
  Reply With Quote
Old 11th October 2005, 11:20 PM   #55
diyAudio Member
Join Date: Dec 2002
Location: VA
I Think I may need to step up to a PIC16874 to get enough I/O (without adding additional hardware) to handle this thing. I still want to add an LCD, and at least a 6 key keypad.
  Reply With Quote
Old 12th October 2005, 08:34 AM   #56
diyAudio Member
Guy Grotke's Avatar
Join Date: Sep 2004
Location: Vista, CA
Default muxing with keypress period

One thing you do have to take into account: You can't change states because of the number of times a button is pressed, since one "human press" may be seen by the microprocessor as hundreds. (As the contact is being made or broken.) So you have to debounce the button-press by requiring the input signal to remain in the pressed state for say 100 milliseconds. As long as you are doing that, why not also check for a much longer button-press? Then you can use a 100-2000 msec button-press for on/reset timeout, and a 2000+ msec button-press to begin the shutdown sequence.

The user would hold down the "on/off" button until the light went off, so he would have instant feedback that he pressed the button long enough.
  Reply With Quote
Old 12th October 2005, 06:21 PM   #57
diyAudio Member
Join Date: Dec 2002
Location: VA
Debouncing is built into the button press logic. The software will only detect one button press per button press.... even if the user holds down the button, or the button bounces.

The only problem I face is interpreting a button press within the context of the current state of the controller.

For example:

In the shutdown state.... the button press signifies: Enter the Booting State.

In the Booting state... the button press is ignored.

In the Running state... the button press signifies: Enter the Shutting Down state (start shutting the projector down)

In the Shutting down state... the button press is ignored.

I have realized though... that I need more states! For example... there is a Running Near Shutdown Because of No Motion Detected State... and a Running Near Shutdown Because of Max Time On Reached State.... I also need to determine what the button press means in each of these states.

In otherwords... if the projector is getting ready to shutdown because it hasnt detected any motion for 2 hours and 55 minutes... and you press the POWER button, that should reset the Motion Counter.


If the projector is getting ready to shutdown because it is nearing the Max Time On Timeout... and you press the power button, that should reset the Max Time On Counter AND the Motion Counter.


If the controller is just in the Normal Running mode... and you press the Power Button... the projector should shut down.
  Reply With Quote
Old 13th October 2005, 09:22 AM   #58
diyAudio Member
Guy Grotke's Avatar
Join Date: Sep 2004
Location: Vista, CA
Default human factor issues

I think you are making the user interface too complex: In some states, pushing the button means "shut down". In other states it means "extend running time". So the user would have to know which state the projector was in before deciding to push the button. He would also have to remember what the button press does in that state. Another thing to think about: What if you need to visit the kitchen or bathroom near the end of the timeout period, but you want it to keep running? You would have to stand there and wait for it to change to the "timing out soon" state before you could push the button!

This is why I suggested one type of button press should always mean "shut down", and another type of button press should always mean "extend running time". You can implement that with two buttons, or one button using the button-down time.
  Reply With Quote
Old 13th October 2005, 05:50 PM   #59
diyAudio Member
Join Date: Dec 2002
Location: VA
Well when the controller is nearing a shutdown due to lack of motion detected (5 minutes before shutdown), it beeps 2 times in succession (beep beep.... beep beep... beep beep) it does this for the remaining 5 minutes of the timeout. When the projector is nearing shutdown due to Max Time On limit reached, it beeps 3 times in succession during the last 5 minutes of the count down. So all the user needs to remember is (2 beeps wave an arm to trigger the motion detector... 3 beeps, get up and hit the power button).

Everytime motion is detected the motion timeout counter gets reset, so you really have 3 hours since the last motion was detected before the projector will shut down, so getting up to go to kitchen should trigger the motion detector, and unless you spend 3 hours in the kitchen you shouldnt have anything to worry about.

Currently the Max Time On timeout is set to 6 hours Im thinking of changing the Near Max Time On beeps to start say 10 minutes before shutdown, and yes... if you went to the bathroom say 11 minutes before the max time on limit was reached, and spent 12 minutes in the bathroom, you would come back to a shutdown projector.

I added the Max Time On feature because someone made a comment "Well what if the dog keeps pacing back and forth triggering the motion detector, the projector could stay on for ever!" So with the Max Time On timeout even if this were the case (great dane pacing back and forth for days), the projector would shut down after 6 hours no matter how much motion is in the room unless someone physically pressed the power button.

Maybe what I will do is force the user to Press and Hold, the power button to shut down, and a quick press will reset the Max Time On counter, so if you were planning to say go to the store quickly for more beer... and didnt want to shut the projector down, you could give the power button a quick press before you left to ensure that the max time on timeout would not expire before you got back, but no matter what state the projector was in, Press and Hold on the power button causes shutdown (unless the projector is already shut down)

So basically the revised interface would be:

In shutdown/standby Press, or Press and Hold causes the controller to enter the Booting State

In booting state Press is ignored, Press and Hold causes the controller to enter the Shutting Down state

In Running state press resets the max time on counter (and the motion timeout counter), Press and Hold causes the controller to enter the Shutting down state (no matter whether the projector is near any timeouts)

In ShuttingDown state, press and Press and Hold are ignored.

  Reply With Quote
Old 13th October 2005, 09:12 PM   #60
diyAudio Member
Guy Grotke's Avatar
Join Date: Sep 2004
Location: Vista, CA
Default sounds perfect

With those state transitions, press-and-hold always means "shut down". and press always means "on" (except during shutdown state when you can't turn the lamp back on immediately). I think that will be very easy for everyone to understand.

I don't worry about automatically shutting down, but I have a different problem with my projector: It just has a lamp switch and a fan switch, but you also have to turn on the video-to-vga converter box, the sound system, and the satellite receiver box (or select the DVD player). It all ends up being too many settings for my wife to want to bother with, so she just uses the standard TV. (And she is a Veterinarian, so she is not stupid.)

If I built a microprocessor-based master controller, I could then have one button for "turn everything on with satellite input", one button for "toggle between satellite & DVD player", and a third button for "turn everything off". The master controller could learn the remote controller sequences for each of the devices, and then use IR to drive them.
  Reply With Quote


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help my brain hurts kendt Pass Labs 13 14th January 2007 12:57 AM
Point my brain somewhere Madmike2 Pass Labs 26 6th August 2005 06:04 PM
HELP! my brain is melting lolojr1 Everything Else 17 30th January 2005 04:14 PM
Music and the Brain Prune Everything Else 0 2nd January 2005 01:12 AM
Our Music And Our Brain mrfeedback Everything Else 3 22nd June 2003 06:25 PM

New To Site? Need Help?

All times are GMT. The time now is 12:09 PM.

vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Copyright 1999-2017 diyAudio

Content Relevant URLs by vBSEO 3.3.2