«

«

Oct 28

DIY Dust Collector Remote


 

 

I do quite a bit of woodworking and my dust collector draws 20 amps, problem is most commercial remote controlled outlets for dust collectors are only rated for 15 amps if they are 110v.  I thought this would be an excellent chance to make my own DIY dust collector remote and get some experience working with wireless protocols and arduino.

Project requirements

  • Must have a small easy to use remote control
  • minimum range of 30 feet or so
  • rated for at least 20 amps at 120v

The first step I took was ordering a relay.  For prototyping I chose the sparkfun beefcake relay kit.

Link

Next I had to pick out a microcontroller  Although I’ve also made this same project with bluetooth connectivity using a TI launchpad (this project isn’t real demanding on the microcontroller) I decided to use an arduino because the relay uses 5v logic and its also a very popular microcontroller.

 

Finally I had to pick out a wireless device/protocol to use.  After playing with bluetooth, which works pretty well but requires me turning on my phone, connecting to bluetooth, and then opening a program to send values to the mcu I decided that I wanted a much simpler controller with a small fob.  I settled on the NRF24L01+ RF wireless protocol and a Nordic Fob remote.

Links for Nordic Fob and NRF24L01+ module.

Wiring.

Pinout for wiring NRF24L01 module to arduino

You can use different pins on the arduino  than these however I recommend using these so that you can test your setup using the nordic fob example sketch in the RF24 library

Radio Arduino
GND GND
VCC 3V3
CE 9
CSN 10
SCK 13
MOSI 11
MISO 12

 Next Wiring the relay.

This can be wired on any pin.  There will be three wires coming from your beefcake relay kit.  One will go to a digital out pin on your arduino, one will go to 5v and one will go to ground.  I chose P4 for the output pin so if you’re using my code i’d recommend using it.

Looking at this picture I have P4 on the arduino connected to control, and then 5v to 5v and gnd to gnd.   To wire the other side of your relay kit I recommend using this tutorial from sparkfun because they did a nice job documenting it, better than I could do.

LINK to tutorial

Next, its Code time.

This project uses the RF24 Library and specifically modifies the example sketch in the library called nordic fob.  You can find the library and more information here

 

/*
 Copyright (C) 2012 J. Coliz <maniacbug@ymail.com>
This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.
 */
/**
 * Example Nordic FOB Receiver 
 *
 * This is an example of how to use the RF24 class to receive signals from the
 * Sparkfun Nordic FOB. Thanks to Kirk Mower for providing test hardware.
 *
 * See blog post at http://maniacbug.wordpress.com/2012/01/08/nordic-fob/
 */
#include <SPI.h>
#include <RF24.h>
#include "nRF24L01.h"
#include "printf.h"
//
// Hardware configuration
//
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9,10);
//
// Payload
//
struct payload_t
{
 uint8_t buttons;
 uint16_t id;
 uint8_t empty;
};
const char* button_names[] = { "Up", "Down", "Left", "Right", "Center" }; 
const int num_buttons = 5;
//
// Forward declarations
//
uint16_t flip_endian(uint16_t in);
//
// Setup
//
int led = 4; //sets output to led pin4
int a = 0; //initializes variable for output on/off
void setup(void)
{
 //
 // Print preamble
 //
 pinMode(led, OUTPUT);
 Serial.begin(57600);
 printf_begin();
 printf("\r\nRF24/examples/nordic_fob/\r\n");
//
 // Setup and configure rf radio according to the built-in parameters
 // of the FOB.
 //
radio.begin();
 radio.setChannel(2);
 radio.setPayloadSize(4);
 radio.setAutoAck(false);
 radio.setCRCLength(RF24_CRC_8);
 radio.openReadingPipe(1,0xE7E7E7E7E7LL);
//
 // Start listening
 //
radio.startListening();
//
 // Dump the configuration of the rf unit for debugging
 //
radio.printDetails();
}
//
// Loop
//
void loop(void)
{
 //
 // Receive each packet, dump it out
 //
// if there is data ready
 if ( radio.available() )
 {
 // Get the packet from the radio
 payload_t payload;
 radio.read( &payload, sizeof(payload) );
// Print the ID of this message. Note that the message
 // is sent 'big-endian', so we have to flip it.
 printf("#%05u Buttons ",flip_endian(payload.id));
// Print the name of each button 
 int i = num_buttons;

 while (i--)
 {
 if ( ! ( payload.buttons & _BV(i) ) )
 {
 printf("%s ",button_names[i]);
 Serial.print(i);
 a=i; //sets a=i this variable is used to control on off function of relay

 }
 }
// If no buttons, print None
 if ( payload.buttons == _BV(num_buttons) - 1 )
 printf("None");
printf("\r\n");
 }

 if (a==1) //if statements if a is 1 outlet is turned on if 0 outlet is off
 {digitalWrite(led, HIGH);
 }
 if (a==0)
 {digitalWrite(led,LOW);
 }
}
//
// Helper functions
//
// Change a big-endian word into a little-endian
uint16_t flip_endian(uint16_t in)
{
 uint16_t low = in >> 8;
 uint16_t high = in << 8;
return high | low;
}
// vim:cin:ai:sts=2 sw=2 ft=cpp

The code for this project is pretty simple.  I basically just slightly modified the nordic fob example code so that  there is a variable  that is assigned a 1 when up is pressed or a 0 when down is pressed and then have the code written to digitalWrite high to pin 4 if the variable is 1 and digitalWrite low to pin 4 if it is 0.

Results

 

VIDEO0056 from Diyourfaceoff on Vimeo.

 

Not the prettiest but it works! and its very nice not having to walk across the shop and turn on the collector every time I make a cut.

Future Plans

As you can see the install on this project is pretty messy.  The next step will be making a custom pcb with all of the necessary arduino components and the relay components all in one board.  Additionally I would like the install the entire project into a cast aluminum enclosure with a panel mount outlet.