Author Topic: Relay switch connected to microcontroller Power Up Power Down Circuit  (Read 3135 times)

0 Members and 1 Guest are viewing this topic.

Offline DaveHardyTopic starter

  • Regular Contributor
  • *
  • Posts: 103
I'm in the process of creating an imbedded design.  I need to power up and power down this circuit via a momentary push button switch so that the mains are cut off to basically everything associated with the circuit.  I am using an atmel atmega 328p microcontroller.   

What is a good way to go about this?  I know that some of the bigger relays require around 25ma to power them.  Also, what is a good way to keep the processor in sleep mode without mains power? 
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Relay switch connected to microcontroller Power Up Power Down Circuit
« Reply #1 on: March 09, 2013, 05:47:08 am »
For the push button power switch, look at the circuit referenced in this post.

So far as keeping the processor in sleep mode goes, that's software controlled, obviously.  You'll need to shutdown everything except the signal that tells your MCU that mains power has returned.  See the attached schematic snippet for how I did this for a project.  Note that the MCU is powered from the 3V button cell when the primary power source is absent.  An LTC4412 OR-ing controller IC handles the switch over between the two power sources.  It doesn't sound like your project will be battery powered while it is sleeping but it will still have a similar signal that tells it that it needs to be in low power mode.

The LPM signal goes to the MCU's INT1 pin, which is a high-priority interrupt.  When the interrupt is triggered, in the case of my project, I just set a global variable based on the pin's value.  My project is completely interrupt driven so the main() function is nothing more than a state machine that keys-off of that variable (and some other conditions) and controls the MCU's sleep mode based on it.

I can post my project source if you're interested.  It's not my best effort (I kind of hacked it out over a weekend) but it sounds like what I did is going to be very similar to what you are going to do.  In my case I kept the RTC enabled but you might not need that.
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: Relay switch connected to microcontroller Power Up Power Down Circuit
« Reply #2 on: March 09, 2013, 06:23:33 am »
  I know that some of the bigger relays require around 25ma to power them.
You can consider using latching relays. These magnetically latch to either the ON of OFF state and you only need power to pulse the coil to change the switch state. In eaither state, the relay uses zero power.
 

Offline DaveHardyTopic starter

  • Regular Contributor
  • *
  • Posts: 103
Re: Relay switch connected to microcontroller Power Up Power Down Circuit
« Reply #3 on: March 10, 2013, 10:41:12 pm »
Thanks for the responses.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf