Jump to content
Sign in to follow this  
mr_bob

Msp430 Time based relay controller

Recommended Posts

Hey guys,

 

I have a project that I'm working on and one part of it deals with the programming of a chip.

 

What I want this to do is keep track of time (12 or 24 hour format) and atleast day of week.

I think I can do this with the rtc_calendar but I'm not sure.

 

The overview of what i want to do is set up a controller so that I can turn on and off lights and a few peristaltic pumps a certain times of day and only on certain day of week. The lights need to come on for 8 hours every day we as the pumps only need to run for maybe 1 or 2 mins every few days.

 

I just really want to know if this is possible with this line of micro controllers and if someone can point me in the right direction

to code that would help me piece something together.

 

Sorry if I sound clueles but i pretty much am when it comes to coding. I can build electronics just not program them.

Thanks in advance

Share this post


Link to post
Share on other sites

I don't see any reason why this would not be possible. You will need a crystal oscillator to track the time (or if your after long term accuracy maybe use ac mains frequency?). Only real issue is the interfacing. To my knowledge all of the msp430 range is all 3V so you'll probably need a transistor/optoisolator and a 5V/12V supply for the relays unless you can source some 3V ones.

 

I don't have any code examples I'm afraid, but the general gist is to use TimerA with a 32kHz crystal oscillator to fire interrupts at reasonable intervals (1second works well). You'll need some code to handle this and keep track of /set the time via a switch. You'll probably need at least 2, otherwise incrementing hours to change the day would be a pain. If date is not an issue a simple modified 24 hour clock with some form of visual display should suffice, some examples of one must be about here somewhere.

Then all you need is to set output ports high/low depending on the time.

Share this post


Link to post
Share on other sites

Yes, this is do-able.

 

Certain MSP430's have RTC peripherals inside of them. If you program them up right, they will do exactly what you are asking.

 

What processors do you have on hand?

Share this post


Link to post
Share on other sites

the ones I have are the 2231 and the 2211 I believe. Its the standard chip in the 1.4 version of the launchpad.

 

I have no problem ordering new chips if need be.

 

 

I had a feeling i was asking it to do something easy but i just got to reading everything and got confused. is there an easy book out there on coding in c??? like c programming for dummies??

 

 

 

Thanks in advance

Share this post


Link to post
Share on other sites

Thank you to everyone who has posted.

 

I think my best bet at this point is to get one of the books listed , prolly the msp430 directed one, and start there.

 

as far as the relay goes i think what im going to do is get a 12v source and regulate that down to the 3 volts that the msp430 needs and then use a transistor to switch the 12v to the relay.

 

Also while im working on my 7 week day timing i think im going to set up a push button timer to have lights come on when pushed and stay on for 8 to 12 hours and then i can push another button and it will dose my ferts.

 

this is all for a fish tank in case you guys havent figured that out

 

 

but thanks everyone for the help. if anyone has any tips for either situation i'd love to hear them

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...