Jump to content

[S] ProtoPowerSwitch Boosterpack (formerly AC-powered Relay BoosterPack)

Recommended Posts

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

NOTE: this BoosterPack uses high voltage (120V) AC power which is dangerous and can be fatal if not handled/packaged properly I created my first BoosterPack for the MSP430: an AC-powered AC relay. Th

As much as I like it, I would strongly discourage from making transformer-less line voltage booster packs. Imagine what would happen if someone connected hot wire to GND and plugged it to USB. Even i

Larsie, thanks for the link to an enclosure; it should work well for applications like ours provided that the chassis/safety ground exists and care is taken to ensure the metal of the enclosure is tie

Posted Images

One other thing I've considered adding but still need to figure out the cleanest way to do it would be a way to sense the zero-volt-crossing point of the AC input sinusoid. This would allow for phase angle control firing of the SCR or TRIAC to perform "light dimming" type functionality.


A small capacitor from the live wire, followed by a low pass filter (simple RC) to clean up the HF noise is usually enough when we talk of interfacing to CMOS MCUs. If you want to play uber-safe, then a couple 1N914 to ground and VCC will take care of excesses.

Link to post
Share on other sites

GastonP: Thanks for the suggested approach. I've looked around for example circuit like you've described but I haven't found one that seems to do it that way. Can you draw up a quick example schematic or point out a link to one?


What I have found is this:

Just resistors (does the MSP430 have internal clamping diodes? actually, I just noticed one of your earlier posts mentioned it GastonP, and a quick google search confirms as well that it does have clamping diode that just have to stay under 2mA)


Resistor + transistor


I'm leaning towards a board that supports optoisolation to continue enabling the board to function as both a vanilla relay/SCR/TRIAC board (with the MSP430 powered off of USB or some other low voltage, isolated supply) or entirely powered off of AC as well with the MSP430 tied to the mains. The board could probably then also support the "just resistors" approach if desired and assembled as such. However, I want to make sure I understand the method you described as well so I can have it as an option as well.



Link to post
Share on other sites
  • 1 month later...

I've been making some updates/changes to the AC-powered relay/SCR/TRIAC board, and I'm getting close to sending it out for fab. Some of the changes include:


- Added LEDs to show when the relay/SCR/TRIAC signals are turned on.

- Added zero voltage detection capability (still need to add a filter cap). I opted for an opto because the AC input ones (that use a back-to-back LED internally) eliminated the need for a dedicated bridge rectifier. This also ensure that if desired, the board can still be safely powered by an isolated power supply (e.g. wall wart) and still control AC power through the switching device, even with phase angle controlled firing for the SRCs/TRIACs

- Added terminals to provide access to unused pins (caution! shock hazard when board is powered by AC power!)

- Improved layout to ensure sufficient trace widths for high currents and sufficient clearance for elevations up to 3050m without conformal coating


I may still renumber the connectors to make it easier to track (e.g. P11 maps to J1, P12 to J2, etc).

The size is presently about 2" by 4".


Schematic AC Powered relay SCR TRIAC board v6.pdf



As always, feedback and comments are welcome.




Link to post
Share on other sites
  • 4 weeks later...

The new boards are in! Hopefully I can find some time to solder it up soon and verify the functionality. They were ordered from Iteadstudio, which was actually a better deal than Seeedstudio for this size board, plus it included 100% etest instead of 50%, and they threw in an extra board when they shipped them (final qty: 11). The build quality looks quite nice. The only problem I've seen so far is that I accidentally made a few of my vias too large so they didn't tent properly. Thus, one via doesn't meet HV clearance requirements so I may have to conformal coat that via. :)


In the meantime I've started putting together some documentation describing the functionality, configuration options, etc. since there are so many different ways this thing can be put together (including using it as a basic Relay, SCR, and/or TRIAC board wherein the Launchpad itself is isolated from the mains)



Link to post
Share on other sites
  • 4 weeks later...

I've had the parts soldered in for awhile now, but it's taken a bit to get up to speed with the code. To do phase angle-controlled firing of the TRIAC/SCR meant learning how to use the TimerA and all, so with that done, I was able to test the hardware today. I've got it all working now, but the board will need one more revision to work out a few small issues, including:


  • -Swap pins on the LDO. I changed to a TO92 for this board and managed to mix up two of the pins.
    -Swap pins for the TRIAC/SCR. I had MT1 and MT2 mixed up for the TRIAC and anode/cathode mixed up for the SCR, such that it would take more gate current than needed to turn them on. For both this and the LDO issues, I've just worked around it for now by bending some pins.
    -Fix LED assignments. Because the zero-voltage detection was a last-minute (but useful) addition to the design, when I was reassigning MSP430 nets, I didn't change the LED nets at the same time, so one of them is tied to the zero current detect input pin, where it of no use.
    -Skip P1.3 for output control, so that the built-in button on the Launchpad is freed up for use as an input.


Other changes are either component swaps (e.g. using a 39k pulldown on the zero-volt detect worked, whereas the 660k I designed in was too weak to do any zero-voltage detection at all) or they are minor changes I'm considering, such as:


  • -Allow separation of the 3.3V and 24V regions via jumper. This provides the ability to (for example) use a common isolated wall-wart or USB power source to drive both the MSP430 and lower voltage, higher current relay coils, essentially making for a "normal" relay Boosterpack
    -Possibly add holes in the corners for mounting...?
    -Ensure adequate keepouts for compatibility with the second set of pins for the 40pin C2000 Launchpad
    -Switch to a more standardized relay footprint; the only reason I picked the one I did was because of a typo in Mouser's part spec that made me think the coil current was lower than it actually is.


Despite of all those small changes I need to make for the next revision, it was quite satisfying to see the microcontroller gradually dim a lightbulb by adjusting the phase angle triggering of the SCR and TRIAC.

Link to post
Share on other sites
  • 3 months later...

I've made some more changes to the board, implementing everything indicated in the previous post, from including mounting holes to providing compatibility with the 40-pin launchpads. I've also cleaned up a lot of the code and set it up as relatively simple a library of functions to help manage things like the phase angle firing of TRIACs/SCRs.


The picture below shows several configurations of the board which can be built from the current board design:



The attached PDF provides details on the construction of each. It shows a range of options from developer-friendly versions that are USB-powered with optocouplers and MOVs to minimize risk of damage to hardware (and people) while testing, to cost-optimized prototypes powered directly from AC power (intended to precede customized high volume production for appliances, etc.).

Pictures of the boards Nov2012.pdf


I didn't include a picture of it, but I also populated one of the boards with 40 pins and a transformerless power supply, and then connected it to my Stellaris Launchpad to confirm that it could provide enough power. I haven't delved into programming the Stellaris yet, but it should be just as capable of driving the relays/TRIACs/SCRs. To be thorough, I also hooked it up to my Arduino with jumper wires to confirm that I could power it as well.


I'm thinking I'll take one more run at the board, because I found that I can easily support MOSFETs in the TO220 footprint by adding one extra hole (the TO92 pinout is already compatible with MOSFETs). Since I can't really fit in a good, fast driver for the MOSFET, it is not really useful for PWMing (I observed 500us turn-off times with my initial tests), but it will be good for a silent DC switch or used as a level shifter (driving higher voltage outputs).


In the meantime, I'm playing with TI's touchpad library and hardware to add it as a demonstration control mechanism for applications such as light dimming/flashing, motor control, etc.

Link to post
Share on other sites
  • 1 month later...

Are you still working on this board?  I think it may do what I need.


I am thinking about combining these three:

1) Spirilis Launchpad

2) Ethernet boosterpack

3) Your Boosterpack (or one similar)

...using "stackable headers" to mount the ethernet boosterpack on one side of the launchpad and your boosterpack on the other.  The reason for using two different boosterpacks is that I want to be able to swap out the network side. For example, replacing ethernet with a wifi board (or perhaps bluetooth) in places in my house where I don't have wired ethernet.


What I am doing is making internet accessible light switches, where I just telnet in to my MSP430 and run some commands to turn a lamp on or off.  This would be part of a home automation system which I could log into from anywhere in the world.


I have the code for ethernet written, and I have switched a lamp on and off from a relay on a breadboard before.  I am not sure what you are talking about though with TRIACs and MOSFETs and stuff... I am more into the programming side of things and am a beginner at electronics.  However I can learn.

Link to post
Share on other sites

Hey Matt/Nytblade,

I'm definitely still working on these boards, about to send out another order for newer boards with the changes I referred to previously to support the use of MOSFETs. If those work out, I plan to buy in larger quantities and finally get something up on the 43oh store.


Believe it or not, I was already actually considering sending you something to work with. I've been keeping up with your Youtube videos and I when I saw the one where you controlled a light with a generic dual relay board, I thought "he sure could use what I'm working on....I need to hurry up and make it available"


The documentation I'm working on is geared toward the layout for the final version, but if you're ok with a one-off from the most recent board set (which should not be a problem, as the differences are only in the variety of options during assembly and not the operation), I can send you a populated board to your spec. I'd guess at this time 2x TRIAC, 2x relay board, without a transformerless AC supply, would meet your needs...?  That way you have the option to try both relays and TRIACs and experiment a bit.


A good summary of the differences between the TRIAC & Relay can be found here: http://electronics.stackexchange.com/a/16648


As far as turning them on/off, the relay will be the simpler one because you just toggle a pin on the device. To turn on the TRIAC (without resorting to non-isolated approaches), you have to detect the zero volt crossing signal, then send a brief pulse to turn it on; if you try to turn it on continuously, too much power gets dissipated in the gate resistor (as the gate is driven by the 120Vrms through a resistor and optocoupler). However, one benefit to going the TRIAC route which was not mentioned in the link above is that if you are powering incandescent lights, you can delay the gate trigger, exposing the lightbulb to only a fraction of the sinusoid every time, which dims the light in a controllable way. 


If you message me an address, I can assemble and ship one to you. I've also put together some software functions to make it easier to operate so I can send you that as well.  


Also, keep in in mind component height clearances. You may want more than the typical 11mm spacing between boards provided by the standard headers. I know the relays I designed for are more than 11mm tall (usually more like 15mm to 19mm), and I believe the typical ethernet port is also slightly more than 11mm.



Link to post
Share on other sites

Well my plan is basically this: to have a power strip with an IP address.  There are a lot of potential uses for it.  I would like to be able to connect to my power strip over the internet and toggle things on and off remotely.  Lights are a simple example (good for a youtube video demonstration), but I also have some old computers I need to sometimes powerup / reset remotely.


Mainly though I am interested in learning - phase angle firing sounds cool to me (dunno, definitely sounds impressive :smile:  - I have just started learning about TimerA as well.


Looking at your diagram you are using P1.1 on the launchpad? What are the others being used?  I am just wondering if there will be any conflicts with the ethernet boosterpack (pinout)?  Actually it would be better if you don't solder the headers then I can try to come up with some way to make the boosterpacks compatible.  I was thinking of mounting one boosterpack on one side of the Launchpad and another on the other side.  Hmmm maybe this double-boosterpack idea is not as easy as I thought...


Worst case I can just use one of the Wiz820io modules I have separately from the whole boosterpack thing and it won't be an issue.  I just think it is something other people might want on their projects for home automation if they could somehow combine the two boosterpacks.  On the other hand, maybe I am uncommon by having ethernet jacks in a few different places in my house.

Link to post
Share on other sites

Presently the schematic uses P1.0 as input for the zero volt crossing signal (if you wanting to use a TRIAC), and P1.4, P1.5, P1.6, and P1.7 are used to control each switch. Given that the Ethernet Boosterpack schematic uses P1.5, P1.6 and P1.7, that will only leave P1.4 and P1.0 unless an alternative pin mapping is used. Knowing this in advance, Aside from the LEDs (which can just remain unpopulated), the only other place those pins go are to through-hole resistors to drive the optos. Since this is just a prototype I can just wire the resistors directly to other available pins instead.

Link to post
Share on other sites

I am interested in the "variety pack" with the TRIAC.  This article I just read was pretty good to explain to me how dimmers work.


I also came up with a Plan B for having it IP addressable, which is to use an FRAM Launchpad with the SimpleLink wifi module on the RF headers.  I don't know how TI fits a wifi software stack in 16KB of memory but I guess I will find out when it arrives.  Wifi actually makes more sense than Ethernet, and with this simplelink app I supposedly I can configure the wifi on the Wifi board from my phone.  I could then connect to it through my home wifi network and control it.


The pinout on the FRAM board is different than the Launchpad, and it has 12 pin headers instead of 10 pins but I think the spacing between the two headers is the same as the normal Launchpad.  I am not sure about how I'll code the timer part.  The farthest I have gone with the TimerA is a timed blinking of an LED from the timer interrupt, so I have a lot to learn there too.


How are you controlling the dimmer and such in your testing?  With the Launchpad button?


Here is sort of what I was thinking as the steps of my setup... perhaps you can tell me if this makes sense:

1) program fram board with usb cable

2) disconnect fram board usb from computer (for safety of my computer)

3) connect wifi board to fram board

4) connect your board to fram board

5) connect ac to your board

6) plug ac plug into surge protector/ power strip

7) press switch on surge protector to power up fram board with wifi booster and your booster

8) synchronize simplelink wifi with home network using TI's smartphone app (would only have to do this the first time I believe, thanks to fram storing the login info)

9) connect from my computer over telnet to the board and press numbers to toggle your booster relays/triacs


I don't mind doing the soldering of parts on the board - actually it would be educational.  If you can give me a bill of materials and instructions of what goes where I can order the parts and actually would only need the bare pcb.


The wifi stuff is something I would actually do after I got it working in the "normal" way. If you have any code/instructions, I would definitely like to see it. My email is matthew@cashdollar.org

Link to post
Share on other sites

(sorry for the delay in responding; the kids were sick last week and there was quite a bit to respond to!)


Assuming you avoid the transformerless AC power supply capability of the board (which I recommend to keep things safer while still in development, and there would need to be a power budget analysis to see if it is feasible)...
You should not need to disconnect the USB from the computer, because all the high voltage traces/planes are optoisolated from the microcontroller (and thus from any USB connected devices as well). I mention that because I occasionally found it useful to keep it connected for debugging purposes. Also, if you disconnect the USB from the computer, then prior to step six you will need to plug in a USB charger/power supply to the Launchpad and power strip.
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.

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.

  • Create New...