Power Sequencer with PIC - diyAudio
Go Back   Home > Forums > Design & Build > Parts

Parts Where to get, and how to make the best bits. PCB's, caps, transformers, etc.

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
Reply
 
Thread Tools Search this Thread
Old 19th December 2004, 03:30 PM   #1
JDeV is offline JDeV  South Africa
diyAudio Member
 
Join Date: Oct 2002
Location: Cape Town
Default Power Sequencer with PIC

I plan to use the following circuit to power-up my Hi-Fi sytem. Can anybody please suggest any improvements/corrections to the circuit and software. Please take into account that I've just learned PIC's and Basic (self taught) - so the software are not optimised or the best way, but it does the job - so far.

The idee is that when I switch on the sequencer, my equipment will power-up, in sequence: CD, Pre-amp, Monoblock-1, Monoblock-2, Sub-amp and when I switch off sequencer, power down in reverse order with delays. Monoblock's are valve amps. I also want to use manual switches for switching anything on/off individually. To do this, I will 1st switch the auto/man. switch on the 12v line.

NEITHER THE CIRCUIT NOR THE SOFTWARE ARE TESTED IN REAL LIFE !!
Attached Images
File Type: gif pseq.gif (63.6 KB, 478 views)
__________________
"Be carefull who's advice you buy, but be patient with those who supply it."
From Baz Luhrmann's - Everybody’s Free (To Wear Sunscreen)
  Reply With Quote
Old 19th December 2004, 03:31 PM   #2
JDeV is offline JDeV  South Africa
diyAudio Member
 
Join Date: Oct 2002
Location: Cape Town
Default software

The software:
Attached Files
File Type: txt psu-seq.txt (1.4 KB, 59 views)
__________________
"Be carefull who's advice you buy, but be patient with those who supply it."
From Baz Luhrmann's - Everybody’s Free (To Wear Sunscreen)
  Reply With Quote
Old 19th December 2004, 07:06 PM   #3
jleaman is offline jleaman  Belgium
Banned
 
Join Date: Apr 2002
Send a message via AIM to jleaman
This looks like a neat Project. Would be good for people that have to turn the system off but also have active xovers in tehre system that have to be turned off at certian timing's..
  Reply With Quote
Old 19th December 2004, 08:31 PM   #4
diyAudio Member
 
xplod1236's Avatar
 
Join Date: Dec 2003
Location: On the couch
Send a message via AIM to xplod1236
Instead of using the manual switches to switch power to the relays, hook them up to the micro. Also hook up the auto/man switch to the micro. Then, do all the switching in software. Your software would look something like this:
Code:
'auto_man is the auto/manual control switch
main:
if auto_man = 1 goto auto
if auto_man = 0 goto manual
auto:
all the sequencing stuff
manual:
if sw1 = 1 then
cd = 1
pause 3000
else cd = 0
endif
if sw2 = 1 then
something else = 1
pause some more
else something else
endif
and so on...
You can also insert delays into the manual portion (like I did), so if you turn on all the switches at once, it will still turn your equipment on in sequence.

Quote:
stop:
The compiler will not let you use stop as a label. Stop is already reserved as a command to stop the program execution. I'm not sure about start though.

You don't even need this:
Code:
If psu_on = 0 Then Goto start
If psu_on = 1 Then Goto stop
Once the micro is given power it will start running the program automatically. You would only need to use that if the power to the micro was left on the whole time.

Something that will not work:
Quote:
main:
If psu_on = 0 Then Goto start
If psu_on = 1 Then Goto stop
If psu_on is 0 then the micro is not getting any power because that port is connected to the micro's power source.
I'm pretty sure that you meant those to be the other way around:
Code:
If psu_on = 1 Then Goto start
If psu_on = 0 Then Goto stop
That still won't work. If you turn off the power to the micro, everything else will turn off. For this to work, you need to add a switch connected to the psu_on pin. Then when you turn off the switch, the micro will still have power and will be able to shut down everything in sequence.

You could also have some fun with this and add a relay on the mains, so when the micro switches off all of your equipment, it will shut its own power off.

If you need more info about any of this stuff, feel free to ask.
  Reply With Quote
Old 20th December 2004, 04:03 AM   #5
JDeV is offline JDeV  South Africa
diyAudio Member
 
Join Date: Oct 2002
Location: Cape Town
Quote:
Originally posted by xplod1236
If you need more info about any of this stuff, feel free to ask.

Thanx for all advice.
I actually want to keep the manual switches as is, since I am an electrican, I like to have some kind of "self control"

Here are corrected circuit and improved software:

******************************************
'***************************
' Power Sequenser: Ver.1.1
' -----------------------------------------
' PIC16F628
' JdeV 20-12-2004
'***************************
' Control Lines
'--------------
Symbol psq_on = PORTA.0 ' Take this pin HIGH to START sequencer
Symbol cd = PORTB.0 ' Output - switch CD ON
Symbol preamp = PORTB.1 ' Pre-amp
Symbol amp1 = PORTB.2 ' Amp1
Symbol amp2 = PORTB.3 ' Amp2
Symbol subamp = PORTB.4 ' Sub-Amp
'
' Software Defines
'-----------------
CMCON = 7 ' Turn comparators off
TRISA = %11111111 ' Set PORTA pins as digital inputs
TRISB = %00000000 ' Set PORTB pins as digital outputs
OPTION_REG.7 = 0 ' Enable PORTB internal pullup resistors
'
' Initialise all ports
'---------------------
psq_on = 0
preamp = 0
cd = 0
amp1 = 0
amp2 = 0
subamp = 0
'
' Main
'-----
main:
If psq_on = 1 Then Goto powerup
If psq_on = 0 Then Goto powerdown
'
powerup:
cd = 1
WaitMs 3000
preamp = 1
WaitMs 3000
amp1 = 1
WaitMs 3000
amp2 = 1
WaitMs 3000
subamp = 1
Goto main
'
powerdown:
subamp = 0
WaitMs 3000
amp2 = 0
WaitMs 3000
amp1 = 0
WaitMs 12000
preamp = 0
WaitMs 2000
cd = 0
Goto main
End
'
'End
'---
******************************************
Attached Images
File Type: gif pseq.gif (72.2 KB, 309 views)
__________________
"Be carefull who's advice you buy, but be patient with those who supply it."
From Baz Luhrmann's - Everybody’s Free (To Wear Sunscreen)
  Reply With Quote
Old 20th December 2004, 04:30 AM   #6
diyAudio Member
 
xplod1236's Avatar
 
Join Date: Dec 2003
Location: On the couch
Send a message via AIM to xplod1236
Quote:
Originally posted by xplod1236
You could also have some fun with this and add a relay on the mains, so when the micro switches off all of your equipment, it will shut its own power off.
See attached circuit

You would need to modify the code like this:
Code:
'power (relay) would be pin RB5

' Initialise all ports
'---------------------
power = 1   'turns on mains relay

Main:
power = 1   'to make sure its on
'your other code

powerup:
power = 1   'just to be safe
'your code...

powerdown:
'your code...
power = 0
End
You would need a momentary switch on the mains to temporarily give the circuit power. Then the micro will switch on the mains relay and keep its power on. Upon powerdown, the micro will release the relay and shut off its power.
Attached Images
File Type: gif pseq.gif (75.6 KB, 274 views)
  Reply With Quote
Old 20th December 2004, 04:54 AM   #7
JDeV is offline JDeV  South Africa
diyAudio Member
 
Join Date: Oct 2002
Location: Cape Town
Quote:
Originally posted by xplod1236
You would need a momentary switch on the mains to temporarily give the circuit power. Then the micro will switch on the mains relay and keep its power on. Upon powerdown, the micro will release the relay and shut off its power.

That's actually also a good idee. I initially planned on using a "centre off" switch for "auto/man" because I also want to incorporate a remote control later when I get to learn more on programming IR stuff with the PIC. For that I would need permanent power for the IR receiver and whatever when in "standby" mode.
__________________
"Be carefull who's advice you buy, but be patient with those who supply it."
From Baz Luhrmann's - Everybody’s Free (To Wear Sunscreen)
  Reply With Quote
Old 29th March 2005, 09:55 PM   #8
JoshK is offline JoshK  Canada
diyAudio Member
 
Join Date: May 2004
Location: Toronto, ON
I've been kicking around a similar idea for my system when I happened upon this thread. Would love to hear about your progress and hopefully success!

I haven't programmed in Basic for nearly 18 years, but as the name implies it is basic and reading this thread was enough to get my brain running. Since I am pretty much a DIY newbie, the idea of PICs always seemed elusion and scary, but this together with the schematic makes me what to build it!
  Reply With Quote
Old 30th March 2005, 05:01 PM   #9
JDeV is offline JDeV  South Africa
diyAudio Member
 
Join Date: Oct 2002
Location: Cape Town
Quote:
Originally posted by JoshK
Would love to hear about your progress and hopefully success!
Actually used it for quit awhile , still not finalised in a neat enclosure
Got sidetracked with other project, so must also still develop the IR remote control section.
PIC's are great fun and got endless applications. I also used them for a digital volume control with the PGA2310 + LCD display on pre-amp.
__________________
"Be carefull who's advice you buy, but be patient with those who supply it."
From Baz Luhrmann's - Everybody’s Free (To Wear Sunscreen)
  Reply With Quote
Old 30th March 2005, 05:03 PM   #10
JoshK is offline JoshK  Canada
diyAudio Member
 
Join Date: May 2004
Location: Toronto, ON
OK, stupid newbie quesiton but how do you upload the code to the PIC or controller?
  Reply With Quote

Reply


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
40A 250V Schottky Power Diodes- Has anyone use in Power Amp to replace Diode Bridge? dtm1962 Solid State 10 15th September 2011 07:38 PM
LTspice tool for power amp power supply component evaluation andy_c Software Tools 2 23rd August 2009 05:10 PM
Power transformers versus amplifier output power..what is your option? destroyer X Solid State 38 9th May 2009 05:23 PM
Amplifier 3000 Wats Rms Power + Smps Higcht Power Bestiality MARAVILLASAUDIO Class D 1 5th November 2004 04:06 PM
power output calculations, rated power and required power output metebalci Tubes / Valves 7 22nd February 2004 05:49 PM


New To Site? Need Help?

All times are GMT. The time now is 06:55 AM.


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

Content Relevant URLs by vBSEO 3.3.2