Coder Social home page Coder Social logo

ultrafez / switcherduino Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 21 KB

Arduino sketch to make a serial-controlled Maplin and Nexa remote socket RF switcher

C++ 53.62% Arduino 46.38%
nexa arduino nexa-transmitter nexa-sockets nexa-device maplin-socket 433mhz

switcherduino's Introduction

switcherduino

switcherduino is an Arduino sketch that can be flashed onto an Arduino Pro Micro to turn it into a USB-serial transmitter for controlling Nexa and Maplin remote control plug sockets.

The only hardware components required in addition to the Arduino are a 433mhz RF transmitter (expensive example from Sparkfun - cheaper available on AliExpress), and a 17.3cm length of wire to use as a simple antenna.

Features

The transmitter currently has protocol support for Nexa self-learning sockets (protocol shared with Home Easy and some others - not the Nexa sockets that use a house and unit code), and some inexpensive Maplin sockets. The protocol used by the Nexa sockets seems to be more resilient to interference on the crowded 433mhz band, so I'd strongly recommend using them over the Maplin ones. I stopped using my Maplin sockets in favour of Nexa ones for this reason.

When controlling Maplin sockets, any of the 16 sockets (4 buttons on 4 channels) can be set to on or off. When controlling Nexa sockets, any toggleable sockets can be set to on/off and any dimmable socket can be set to a dim level between 0 (off) and 15 (max).

Usage

When connected via USB, the Arduino will appear to the USB host as a serial device. Opening a serial connection with it using a baud rate of 115200, 8 data bits, no parity, and 1 stop bit will allow you to send commands to the Arduino using the protocol specified in the section below.

Serial protocol

A series of commands sent one after the other (concatenated) are sent to the Arduino, followed by a \n newline character - at this point, the commands will be executed sequentially. Command details:

Set Nexa self-learning transmitter number

Example: t67108863;

Set the Nexa self-learning transmitter number. This can be used multiple times per command string, but only the last set number will be used when all of the commands are executed. This means that only devices that are paired with the same transmitter code can be used in one execution. Maximum transmitter code value is 67108863 (26 bits)

Power Maplin socket on/off

Example: m341

Turn Maplin socket on channel 3, button 4 on. Format: m[channel][button][on/off]

Power Nexa device on/off

Example: n051

Turn Nexa device 05 on. Pad device number with zeros if required. Format: n[device code 2 chars][on/off]

Set Nexa device dim level

Example: n13d10

Set Nexa device 13 to dim level 10. Pad with zeros if required. Format: n[device code 2 chars]d[dim level 2 chars]

Execute commands

i.e. \n

Execute the sequence of commands sent since the last \n

Example

t151632;n020n12d06m411\n

This will use 151632 as the Nexa transmitter ID, and then turn Nexa device 2 off, Nexa device 12 dim to level 6, and turn Maplin socket channel 4 button 1 on.

Credit

Most of the hard work for this project was done by David Edmundson, Martyn Henderson and Erik Simko for their work on the Nexa transmitter, and somebody who's name I cannot currently find due to the original source of the Maplin transmitter code being down.

switcherduino's People

Contributors

asilcock-sbg avatar imartyn avatar steveis avatar ultrafez avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

steveamor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.