BWSN Powerswitch Tail Demo

New video, this covers “Chapter 6 – Sleeping, Then Changing the World” with Powerswitch Tails:

This project was relatively easy. It built on the sensor boards constructed from “Chapter 5 – API and a Sensor Network”. The only change is to remove the temperature sensor and in its place put a NPN Transistor. I’m using the 2N3904 from SparkFun as provided in the BWSN Basic Kit.  This project uses the two Powerswitch Tail II’s provided in the BWSN Advanced Kit.  In the video above, I show the use of two PST2 and one PST1 which I had left over from another project.  The connections are the same.

Some helpful advice:

  • You can test your circuit without having to plug the PST into a wall socket.  If you have connected the NPN to the XBee correctly and used the Processing program provided, the light on the PST will light up.  The PST1  will also give an audible thunk as it engages the relay.
  • The PST2 will not engage the relay if it is not connected to power.  I.E. if it’s not connected to a lamp or other electrical appliance, it will not make a noise as it will not enable the relay.  BUT if under a load, it will engage the relay and make the noise.  Clear as mud?  Good.
  • The processing sketch used in this example can be downloaded from Robert Faludi’s BWSN site.  Download the “”
  • If you are using the latest Processing, the examples in the book won’t work exactly right. They changed the way the com ports get setup. Instead of setting the “mySerialPort” string, you have to choose the correct COM port from the “Serial.list()” array. See the code example below.
try {
// opens your serial port defined above, at 9600 baud
// ## (2013-Aug-27) Updated Processing, now have to
// ## select the serial port from the "serial.list" array.
// ## IE "serial.list()[X]" where X is the COM port
// ## in the array.[2], 9600);
  • There aren’t many explanations for wire the hookup’s for the PST.  After looking at the schematic’s I connected Pin 1 “+in” to the 9v input of the battery and connected Pin 2  “-in” to the collector of the NPN transistor and left Pin 3 “Ground” floating.
This entry was posted in BWSN. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s