OpenSprinkler 2.0s Thanksgiving Promotion: turkeyday8

This is a special note that we are offering a Thanksgiving promotion for OpenSprinkler 2.0s: use coupon code turkeyday8 to get 8% off regular price. The coupon is only valid on the four days of Nov 27 to 30. The coupon can be applied in the ‘View Cart’ link. If you are thinking of getting an OpenSprinkler 2.0s, either for yourself or as a gift for friends, there is no better time than this! 🙂

Introducing SquareWear 2.0 — An Open-Source Wearable Arduino

This is a long delayed post. I am glad I finally finished making a video for it, and it’s time to introduce SquareWear 2.0 — an open-source, wearable Arduino microcontroller board. At heart, SqureWear 2.0 is an Arduino running at 3.3V and 12MHz. It has built-in mini-USB port for uploading programs, charging lithium batteries, and creating a serial communication channel. It comes with a lot of useful built-in components, such as a color LED, a general-purpose push-button, a buzzer (yup, you can make it sing a tune), light sensor, temperature sensor, three MOSFETs (to drive high-current load). Even better, it has a built-in rechargeable lithium coin battery (you heard it right: rechargeable coin battery!), so you can power your project right away without requiring external power supply. Every time you plug in the mini-USB cable, it charges the coin battery automatically. Better still, if you want a beefier battery, you can plug in an external lithium battery through the on-board battery jack. The built-in lithium charger can charge external battery as well. Overall SquareWear 2.0 packs a lot of useful features on a 1.7″ x 1.7″ board. It’s great for wearable electronic projects as well as general-purpose microcontroller projects. Below is a summary of built-in components:

  • ATmega328 running at 3.3V, 12MHz.
  • MCP1700 3.3V / 250mA LOD.
  • MCP73831 lithium charging chip (configured to charge at 35mA).
  • MCP9700 temperature sensor.
  • 10K photo-resistor.
  • Four 2N7002 MOSFETs.
  • 5050 color LED.
  • 8.5mm SMT buzzer.
  • 6mm SMT tactile button.
  • Charging indicator LED.
  • LIR2032 rechargeable lithium coin battery (45mAh capacity).
  • 2.0mm JST connector for external lithium battery.
  • SMT mini-USB port, and power switch.



Last year around this time I released SqureWear 1.1, which is based on Microchip’s 18F14K50 microcontroller. It’s pretty neat, but over time I’ve received quite a few requests to develop a similar board based on the Arduino. This inspired me to work on SquareWear 2.0. Many design choices, including components I selected to put on board, were based on feedback and experience at various wearable electronics workshops I organized.

With SquareWear 2.0, programming is now done through the Arduino software. You can make use of thousands of available Arduino libraries to help build your project. Similar to the standard Arduino, it is based on a ATmega328 microcontroller. However, SquareWear does not have a separate USB-to-serial chip. Instead, it simulates USB functionality all in software, using the V-USB library. It has a USBasp bootloader, and can perform serial communication through USB. It can also simulate a mouse, a keyboard, or other human interface devices (see V-USB example projects). While software-based USB is not that fast, it really helps reduce the cost and size of the board by having one chip to carry out all the tasks. That’s why we can offer SquareWear 2.0, with all the aforementioned components and features, at a very competitive price.

The bootloader is based on Frank Zhao’s USnoobie project. To enter programming mode, press and hole the on-board tactile button, then turn on power. This will allow the microcontroller to bootload as a USBasp programmer, which is supported by Arduino. On Linux and Mac, you don’t need to install any driver; on Windows, you need to install the USBasp driver (come on, Microsoft!), which is included in the SqureWear software package. The board has internal assignments for the following pins:

  • D2/D7: USB D-/D+.
  • D4: tactile button.
  • D8/D12/D13: LED red/green/blue channel.
  • D9: buzzer.
  • A0/A1: light/temperature sensor.

The other pins are all mapped out to sewable pin pads with large holes. You can either stitch conductive threads through the pins, or solder wires directly onto the pins, or solder snaps to make it easy for quickly attaching or detaching the board from fabric.


I should mention that pins D3, D5, D6 are internally connected to n-channel MOSFETs and these pins are suitable for driving high-current load (up to 250mA each pin). This is very useful if you want to switch a large number of parallel LEDs, a motor, a muscle wire, a heat wire etc. You can even combine two or three of them together to drive higher current. If you are familiar with Arduino, you should know that these three pins also support hardware PWM, so you can use them to control the brightness of LEDs, the speed of a motor etc. Technically I call them ‘power sink pins’ because unlike a standard output pin, they can only connect or disconnect a component from ground (sink). So the right way to use them is by connecting the positive wire of your component to Vcc (or external power), and the negative wire to one of the MOSFET pins.

Anyways, I want to keep this post short, so I will leave you to find more details in the video tutorial above, and the user manual in the software package. If you are interested in buying SquareWear 2.0, it’s available for purchase at the Rayshobby Shop. Feel free to leave comments below, or on the forum. Thanks!

Reflow Toaster Oven with Bells and Whistles

A reflow oven comes in handy when you work regularly with SMT circuits. I’ve had the T-962A reflow oven for about a year now. While it has worked reasonably well, recently it has started showing some signs of aging. First of all, the total reflow time is quite long, about 15-16 minutes. This is really slow. Worse even, occasionally the internal temperature sensor would have a hiccup and the boards would come out under-heated or over-heated. Also, I hate the built-in buzzer, which produces a very loud, high-pitched beep when reflow is completed. This is very annoying — since I keep the reflow oven outdoors, I didn’t want my neighbors to think the beep is my fire alarm. So it’s time to find an alternative / backup solution.

After some online research, I’ve decided to build a reflow toaster oven using an Arduino-based controller. Toaster oven is cheap and provides better, more even heating than a hot skillet. I know toaster oven reflowing has been blogged about everywhere, but I do want to give my version some bells and whistles to provide more convenience. For example, I typically keep the reflow oven outdoors on my porch while working in the basement. So I’d like to receive a remote notification when reflow is complete (no loud beep please!). Also, I’d like an automatic way to open the oven door and blow air into the oven to accelerate the cooling time. For remote notification, I’ve decided to use an 433MHz RF transmitter to send signals to a remote power socket. I have a lamp connected to the power socket, and this way I will get notified when reflow is done. For faster cool-down time, I will use a servo tied to the oven door handle with a string — rotating the servo shaft can pull the door open. I will also put a second remote power socket connected to a circulation fan to blow air into the oven. Since I am using remote power sockets anyways, I am going to throw in a third one for the oven. This way all power line devices are controlled by power sockets, so there is no messing around with cutting cables etc. If you want better reliability, you can certainly use a relay or an SSR. I just decided to go with RF power sockets for the convenience.

Here is the list of materials I used:

I have an existing set of RF power sockets and I don’t remember where I got them. But the link provided above looks similar, so they should work fine. A quick note: there are cheaper RF power sockets which only support toggling, but I would suggest getting the type that has separate on/off buttons for each channel, because you can know for sure whether the socket is on or off. Also, there are some types which work in the 315MHz frequency band. In this case, you need to get 315MHz RF transmitter instead of 433MHz.

Step 1. Temperature Probe
The reflow oven is a temperature-controlled device, so the first thing to do is to have the microcontroller sense temperature. The cheap kitchen thermometer is perfect for this: it has a thermistor (i.e. temperature-sensitive resistor) wrapped around a metal probe. Just open the thermometer, desolder the two wires, and extend the wire length by soldering two pieces of longer wires. I also used some hot glue to fix the joints so they they won’t move around and break.


Next, measure the diameter of the temperature probe (mine is about 0.147″), and at the back of the toaster oven drill a hole that’s slightly bigger (I used 5/32 drill) than the probe size. The hole should be located at roughly a quarter to one-third on the height, so that when the probe is plugged in it would neither touch the top heating element nor the tray. Next, wrap a layer of Kapton tape around the temperature probe, and insert it through the hole, so that it stays tight in place.

The oven should be set to the highest temperature, convection, and stay on. This way we can bypass the oven’s internal control mechanism and instead use the microcontroller to turn heating on and off.

For the microcontroller to sense temperature, just use the 2.32K resistor to form a voltage divider with the thermistor (i.e. probe). See the schematic on the right below. The divided voltage is connected to Arduino’s analog pin A0 for reading.


Step 2. Temperature Calibration
The next step is to perform temperature calibration. If you’ve got the same kitchen thermometer and 2.32K resistor as I have, you can skip this step. But if you have a different set, you need to perform a calibration step to find out the relationship between the actual temperature with the analog reading. To do so, I used an existing digital thermometer (my EX330 multimeter) to serve as reference. Insert its temperature probe to the oven and get the tip close to the center; then I wrote a simple Arduino program to print out analog values from A0 once every second. Turn on the oven to let it heat up. The temperature will rise, and the analog reading also rises.

When it reaches about 210°C (Celsius), turn off the oven, and record the analog reading. Then do another reading when the temperature drops to about 170°C, and the last one when it drops to about 80°C. Basically 210°C is when we should stop heating (the temperature will climb up a little more beyond 210), 170°C is when the oven door will open and the fan will kick in, and 80°C is when the reflow is considered finished. My readings corresponding to these three temperature values are roughly 830, 790, and 360. These will be used in the Arduino program later.


Step 3. Oven Door Opener
Next is a fun step. I built a oven door opener using a servo. The basic idea is to attach a piece of string between the servo and the oven door handle. Rotating the servo shaft will be able to pull the door open. To do so, I picked up some pieces of wood from HomeDepot and build a wooden frame. To make the whole assembly stable, the base of the frame should be sufficiently heavy. Then I secured the servo to the frame using some long #4 screws and nuts. Since the servo doesn’t come with a long shaft, I used a small piece of wood and attached it to the servo gear. This can extend the sweeping distance of the servo. Be careful not to make it too long though, otherwise you may overdrive the servo’s torque.

The video below shows the servo in action. This is using Arduino’s built-in Servo example called Sweep. The servo’s three pins are connected to 5V, pin D9, and ground.

Step 4. Remote Power Sockets
The next step is to interface with the remote power sockets. I’ve written a previous blog post about this. Since then I have discovered the RC-Switch Arduino library. This is a very useful library that can automatically decode the signal patterns from most common remote power sockets. All that’s required is an Arduino and a RF receiver. I wired up my 433MHz receiver to the Arduino, and used the library’s receiver example to figure out the following binary code for my power sockets:

  • Channel 1 on: 010101010011000101000011; off: 010101010011000101000000.
  • Channel 2 on: 010101011100000101001100; off: 010101011100000101000000.
  • Channel 3 on: 010101010000110101110000; off: 010101010000110101000000.

Once the patterns are figured out, I can then connect a 433MHz transmitter to Arduino to simulate the remote control. This way I can reliably turn on and off each socket individually.

Step 5. Putting Everything Together and Testing
Now all the ingredients are ready, it’s time to put everything together for testing. The Arduino pin assignments are: temperature probe on analog pin A0, servo on digital D9, and RF transmitter on D10. The power sockets assignments are: toaster oven on channel 1, fan on channel 2, and lamp on channel 3. Since the controller will be used outdoors on the porch, I found an enclosure that can fit everything nicely inside. I also soldered a wire to the RF transmitter as an antenna to extend the transmission range. The power comes from an external 5V adapter. Please check the video at the beginning of the post for demonstration. The controller program source code can be downloaded here:


With the capability of opening oven doors and blow air into it, the cool-down time is significantly faster. The total reflow time is about 6 minutes now, which is a lot better than 15 minutes before. That’s it, my reflow toaster oven with bells and whistles. It can certainly be improved by adding PID control, The hardware cost, everything included, is about $120. It’s inexpensive and pretty easy to replicate. Much better than my professional reflow oven!

Announcing OpenSprinkler Beagle (OSBo) v1.0

  • OpenSprinkler Beagle kit is available for purchase at Rayshobby Shop.

Following the sneak-peak preview, I am excited to announce that OpenSprinkler Beagle (OSBo) v1.0 is now officially released! OpenSprinkler Beagle is an open-source sprinkler / irrigation extension board for the BeagleBone Black. It uses four GPIO pins to control an unlimited number of sprinkler valves. Using this board, you can easily convert your BeagleBone Black into a low-cost, web-connected smart sprinkler controller. You can use online weather data to help regulate sprinkler water time, and remotely change settings and programs when you are traveling away. Best of all, it’s an open-source project — you are welcome to tinker with the hardware and/or software to create your own customized sprinkler controller.


The idea of OpenSprinkler Beagle came from the OpenSprinkler Pi, which is a sprinkler extension board for the Raspberry Pi. Since OpenSprinkler Pi was released earlier this year, it has been a very popular product. Over time I’ve received requests from users to develop a similar board for the BeagleBone Black. While the BeagleBone Black is similar in nature to the Raspberry Pi (i.e. both are low-cost embedded Linux boards), it offers some interesting benefits such as a large number of GPIO pins, build-in analog pins, build-in eMMC, microSD card slot (i.e. smaller profile). faster CPU etc. Undoubtedly it makes sense to develop an OpenSprinkler variant for the BeagleBone Black.

The hardware design of OpenSprinkler Beagle is similar to OpenSprinkler Pi: it contains a 24VAC to 5VDC switching regulator, shift register, triac, DS1307 RTC with CR1220 battery, zone expansion board connector. It also currently shares the same enclosure as OpenSprinkler Pi. But it also offers several improvements, specifically:

  • Added a total of 10 bidirectional TVS for protection against transient voltages: one for each of the eight stations, one for the 24VAC port, and one for the rain sensor port.
  • The BeagleBone Black is now plugged down into OSBo, and all GPIO pins are mapped out to the pinout area.
  • Added a 5V mini-relay for more general-purpose switching. The relay has a contact rating of 120VAC / 2A. It can be used for switching low-power lighting, or garage doors etc.
  • The 24VAC terminal block is changed to orange color with 3.96mm pin spacing. This helps prevent incorrect connection to other terminal ports. There is also a solder-on 2A fuse on the 24VAC line.
  • Added a rain sensor port with pull-up and current limiting resistors.

Below is an annotated diagram that shows the various components of the board:

OpenSprinkler Beagle Homepage

Below I am going to give a very brief overview of the hardware and software setups. For details, please watch the tutorial video above, and visit the official OSBo homepage at

Hardware Setup

The hardware is pretty easy to set up. The kit comes with an assembled OpenSprinkler Beagle circuit board, enclosure, screws, terminal blocks, and extra pin headers in case you want to map out additional GPIO pins. In addition, you need to provide a BeagleBone Black, a nano-size WiFi dongle, and a 24VAC sprinkler transformer (these are not included in the kit and need to be purchased separately). The board makes use of the first 2×10 pins on port P9 of the BeagleBone Black for interfacing with shift register, RTC, rain sensor port, and mini-relay. Plug in the BeagleBone Black into OSBo, connect the 24VAC power, plug in the common (COM) wire and individual station wires, and that’s it. The interface is the same with other sprinkler controllers. If you have a rain/freeze sensor, you can connect it to the rain sensor terminal.

Software Setup

Follow the recent update on OpenSprinkler Pi, the software setup for OSBo has also been made a lot easier. Specifically, I’ve created a SD card image with pre-installed software. Download the image, burn it to a microSD card, pop it in to your BeagleBone Black, and you are ready to go. The pre-configured SD card runs a Ubuntu operation system (default user name ubuntu, password temppwd), and sets Dan’s interval_program to start by default. As soon as the system has booted and is up online, you can open a browser and type in http://x.x.x.x:8080 (where x.x.x.x is your BeagleBone’s IP address). This will bring up the interval program’s web interface. The interval program has a rich set of software features, such as setting multiple sprinkler programs, preview programs, run-once program, manual operation, logging, rain delay etc. The details are all explained in the user manual of the interval program.

The SD card has also pre-installed Samer’s mobile web app, which provides a nice front-end for mobile devices such as pads and phones. It is available at http://x.x.x.x/sprinklers.

In addition, there are three demo programs installed in the /home/ubuntu/demos/ folder. There is a self-test program, a relay test program, and a Google Calendar-based sprinkler program, which makes use of a Google Calendar for scheduling water events. I’ve received many good comments regarding the Google Calendar-based program — while it looks simple, it’s quite convenient to use and very suitable for the less technical minded people.

Since the software is pretty much all adapted from OpenSprinkler Pi, feel free to refer to the OpenSprinkler Pi documents if anything is unclear. I will try to make the OpenSprinkler Beagle website more self-contained, and it will have to be polished over time.


In the previous post, I asked for naming suggestions. Thanks to everyone who made comments there. After careful thoughts, I’ve decided to use the full name OpenSprinkler Beagle, and short name OSBo. Particularly, the short name OSBo is picked because it goes well with OSPi (OpenSprinkler Pi), is easy to distinguish with OSBee (openSprinkler Bee), and Bo is a name of a dog. So overall I consider this to be the top choice.

Thanks for reading this post. If you are interested in buying the OpenSprinkler Beagle, we have a limited number of kits immediately available, at the first link below. Feel free to leave comments and suggestions below or at the Rayshobby Forum.


Mission Accomplished — From Michael Wilson, an OpenSprinkler Pi User

An OpenSprinkler Pi user Michael Wilson sent me this nice illustrated document he wrote about setting up OpenSprinkler Pi and the mobile web app. He successfully installed OpenSprinkler Pi to replace his previous Toro controller. The document has somehow slipped out of my mind and has been sitting in my mailbox for a few months. I should have posted it when I received it! Anyways, thanks Michael for sharing it with us!

Download as PDF

OpenSprinkler Paper Box and New Zone Expansion Board Enclosure

This post is a direct update of the post I wrote in September during my visit to SeeedStudio. Today I received the official sample of the OpenSprinkler paper box. Check the photos below. Very cool!



The paper box was designed by SeeedStudio, and hopefully it will give OpenSprinkler a more professional touch.

The other piece of news is that we’ve finalized the new zone expansion board enclosure design. This is going to be injection molded soon. Below are pictures of the 3D printed prototype. The style follow the OpenSprinkler injection molded enclosure, so they will have a consistent look. The new design allows 16 stations per zone expansion board, yet the board size is roughly the same with the current 8-station zone expansion board. So it’s really really compact. This will probably become available in the first quarter next year.