Adventures in Moteino with CuPID: Remote Temperature Monitor

What every new system design has in common these days is wireless. Like bacon, it just makes everything better.
collage

Put a sensor wherever, read it from somewhere else. Put the power and control where you need it. For the CuPID/Pi, it is no different. [Colin] from [CuPID Controls] has build a great interface around Moteino nodes and has done a fantastic job documenting his build and code. He wanted to put remote sense and control modules out into the wild and read and aggregate them as it makes sense. All the setup steps including source code are shared in this blog post.

His code is based on a new innovative approach he himself has endeavored to develop, called the UniMote. Here’s how he describes it: we want our Moteino programming to be modular. For most or all applications, we want the same code to run on the ATMega, so that we can just reconfigure IO, control units, and other functions by remove parameter changes — without reflashing the code if at all possible. He posted about it in the forum, and here is the link to his blog where he goes into the details.

It gets hot up there in Portland and he wanted a convenient way to check when it’s “OK to come out for a drink”. What better way to do it then with a water-proofed UniMote’d Moteino temperature monitor installed on his porch? Portland is also very rainy and he needed to ensure his setup will endure a stress test:

As a final note here, his user interface to his system is quite impressive, Be sure to check out this great project on his blog.

dataviewermotesinterfaceupdatedmotes

Moteino Framework submitted to The Hackaday Prize!

The Moteino Framework (of connected things) is submitted to The Hackaday Prize. If you want to support this entry you can give it a “skull” on the project entry page. Here is the stage-1 video presentation and overview:

If it gets past the first stage I will continue to add more details and refine the entry. Thanks for your support!

PowerShield R2 released

Due to some intermittent voltage drop issues on the first revision of PowerShield I refactored the design and released a new PowerShield R2 based on the LTC3525 fixed 5V booster that should address this issue. This is a much more expensive chip than the TPS61220, others have used the Linear Technology boosters with success so hopefully it’s more reliable, but price will reflect this. It also means there is no switching between 3.3V and 5V output any more. For 3.3V projects, a Lipo can be connected directly to Moteino and the onboard regulator will provide up to 250mA of current to the Moteino itself and any other peripherals attached. There are also some other changes, notably the charging current has been set to 212mA (4.7K PROG resistor on the MCP73831), down from 500mA (2K PROG). The battery connector has been rotated 90 degrees and a notch underneath it was added to allow the wires to be flush to the enclosure sidewall. The rotation was done to allow the USB charging side to be inserted in the wall of an enclosure without the wires interfering with that. This should be ideal for MotionMotes or similar projects where a PowerShield+small Lipo are used instead of a 9V battery. Then the MotionMote could be plugged in and recharged whenever it runs out of juice, without opening the box. Continue reading

Shop now running on SSL

So far my site did not have a SSL certificate, mostly because it was not needed. Some people were concerned that their data is not secure when they check out at the webshop. That is partially true. The reason is that the financial stuff is done over at Paypal and the shop only captures the name and shipping information, not credit card numbers. If a very bored to death hacker is interested in intercepting and stealing one customer’s name and address at a time on my no-name site instead of just heading over at target.com and stealing 400 million credit card numbers and transaction info all in one shot, then that could be a concern.

So anyway, to make everyone happy, I spent the $ and time to get this setup. Let’s hope my host did this right and there won’t be more down time. SSL is now for real and the shop should show as HTTPS, you should see this when you go there dear customer:

HTTPS

Happy secure shopping, and don’t forget to smile, every day is a blessing.

Moteino controlled CNC mills Stencil8 tooling block!

If you’re wondering why the blog is so inactive lately it’s because there’s lots going on at Low Power Lab, and so not much time for blogging unfortunately.

But among other cool things, I wanted to show a side project that I’ve had implemented with the help of a friend who has a CNC. I wanted to try a tooling block for the Stencil8 system for PCB-stencil alignment and paste application. Having this type of tooling block makes it easy when you get a new stencil.

Instead of just getting myself a tooling block made I got a whole lot more. I never thought a Moteino could run GRBL and actually control the CNC, but it turns out it can!
So the first attempt is a Stencil8 tooling block (really .. just a NxNcm grid of 2.5mm holes with top chamfers), made of MDF. You can get yourself an ALuminum one from here, but I thought I’d try MDF since it should work fine in most conditions. Yeah, I know AL is much more dimensionally stable with temperature/humidity changes, but it’s dry and cool in my shop. Milling AL takes much longer and is messier.
The exciting news is that Moteino is powerful enough to run GRBL and control a CNC:

Check out the video below for some CNC action, milling Low Power Lab in MDF:

Moteino Power Shield now available

I kept talking about it here and there in the forum and the blog. And finally now it’s for real. Parts have been sitting around for weeks and I finally managed to free up some time and get a few assembled, take some shots and put it up on the shop. I know a lot of people asked “how about if you have projects that require 5V because of some special sensors”. So this little board came about for that specific reason. And since I was at work generating 5V from almost nothing, why not add a lipo charger, a voltage level detector, a little prototyping area and a switch (but maybe not the kitchen sink) ?

The charger chip is the popular MCP73871, charges at 500mA via USM mini-B and has a charging status LED. The booster is the mighty TPS61220 adjustable output boost regulator. The output voltage is 5V by default. It can be switched to 3.3V if wanted, by means of a solder jumper:

Even though it works, you should avoid trying to get 3.3V output from a 3.7V lithium battery, because … well … it defeats the purpose of it. Try getting 3.3V output from something much less than that, say a AA/AAA cell, that will put this board to good use.

I’ve started using this to power MotionMote from a small 400mA battery since the PIR sensor requires at least 5V, and Moteino will work great with 5V input (on “VIN”). So that’s a great application, and battery voltage monitoring comes included, sweet. The little lipo won’t last a long time (actually I don’t know how long … we’ll see), but when it does, I can see it from the incoming battery level indicator, and then just quickly recharge it. Not awfully inconvenient. The battery voltage monitor is just a VCC-1Meg-470K+0.1uF-GND circuit which divides the voltage and feeds it into Moteino analog pin A7 where you can read it as analog and interpret it according to what battery you got hooked up. A formula that I use for batteries up to 9V is:

int batteryReading = analogRead(A7);
float battV = ((float)batteryReading * 3.3 * 9)/(1023*2.976);

As you can see there’s also a small prototyping area. The Moteino can be mounted above or below, your choice, just keep the power pins aligned of course. The switch should be OFF to avoid loads when charging and let the charger exert its love on the battery uninterrupted.

At this point it hasn’t been extensively tested but I’ve had no issues using it in my projects. And hey this little board will resurrect your AA batteries from among the many dead you surely have around (you didn’t throw all those away right?). Getting 5V/3.3V from as low as 0.7 is not too hard for the Moteino Power Shield.

Eagle schematic and layout are available on Github.

SwitchMote source code released!

The source code for SwitchMote is finally “done”. As always, consider this a beta release at best, you should always check the github repository for any updates. There are 2 parts to configuring and programming a SwitchMote.

SwitchMoteConfig sketch, which needs to be loaded and used once, after assembly and before SwitchMote installation. This sketch is meant to help setup the essential parameters of the Moteino in the SwitchMote such as frequency, node and network IDs, RFM69 type (W or HW), encryption key, description, and some other utilities that may be extended in the future. All these parameters are then stored to EEPROM and will not be dependent on hardcoded values in your sketch.
This is especially useful when you have some nodes with RFM69W Moteinos and some with RFM69HW. It’s hard to keep track of all the transceivers settings. Additional settings could be added, like power level, bitrate, etc. Keeping the configuration with each node is most efficient in applications like SwitchMote. Setup once and forget!

SwitchMote sketch is the permanent sketch that will get loaded on your SwitchMotes. Note that this sketch will read the EEPROM configuration that was setup with the SwitchMoteConfig sketch mentioned above. This sketch does several things.

  • keeps track of which buttons were pressed, and manages the modes of operation
  • any button can be in ON or OFF mode – reflected in GREEN or RED led status
  • listens for BTNx:y tokens, to put button x in mode y, x={0,1,2}, y={0,1}
  • listens for SSR:y tokens, to turn the SSR on or off and the associated button in that same state (reflected by the LEDs)
  • if the button associated with the relay (SSR) is pressed then the SSR is turned ON or OFF depending on the mode that button transitions to
  • if a button is held pressed for at least 3 seconds (configurable) it enters SYNC mode, explained below
  • if a button has SYNC data it will notify the remote SwitchMotes to virtually “press a button”, and transition that button to the mode specified in the SYNC data
  • if any button is held pressed for at least 6 seconds (configurable) it erases the internal SYNC data in EEPROM. This could be modified such that only the SYNC data associated with the pressed button is erased, not the entire SYNC data
  • notifies the gateway, if any present, that a button was pressed

Note that SwitchMotes loaded with this sketch will work independently and with each other without the need for a network gateway or coordinator. A gateway is by default notified but the feature can be removed if not desired.

Also note that a SwitchMote can work without a relay, in which case only the neutral wire N and a hot wire to either one of S1/S2 is needed. In this case the SwitchMote can just act as a controller for other SwitchMotes or be customized to send other commands to other Moteinos. For instance you could open/close your garage (with GarageMote). The sky is the limit of what you can do.

Further details of the SYNC feature and how to use it are documented on the SYNC mode section of the SwitchMote page. Please refer to that page for any updates and latest information on SwitchMote.

Happy switching & sync-ing!

P.S. This code was released for RFM69 transceivers only because of huge growing interest in these line of transceivers and diminishing interest in RFM12B. You are welcome to port this to a RFM12B implementation as long as you keep within the boundaries of the CC-BY-NC-SA license.

Wireless programming a SwitchMote Moteino

I’m close to being done coding the SwitchMote, I think the code will be released tomorrow. I’ve been testing the code on the SwitchMote here in the lab because I can physically interact with the buttons on it. Needless to say, every time I want to upload the new firmware I cannot disconnect the breaker, unscrew the wall plate and the mains wiring, detach the unit from the wall to be able to upload through FTDI, that would be awful.

Enter wireless, over the air, magic, programming of Moteinos.
I’ll just say that it comes in very handy when your project is in the wall!

I’ll cut this short and let you watch how it happens, too bad the flashing LED is not very visible on the video while upload is in progress:

One note to mention is that I’ve recently patched the wireless programming library to shift frequency up by 8Mhz during upload so the heavy RF traffic would interfere less with the rest of the network packets. Also I added an option to use another LED to be flashed during upload – handy for SwitchMote which has a bunch of LEDs on the front panel which are all on other pins than the default D9. I’m also planning to experiment with increasing the bitrate during the upload, maybe double it, and see how much faster and reliable that is. But that might prove tricky since several other settings depend on that, so all settings have to be changed back to what they were after the upload is complete.

SwitchMote released!

SwitchMote is now finally released and available as a kit in the shop!
Thanks to all the followers for their patience!

There is now a guide page for SwitchMote that includes assembly details, technical specs, and of course relevant disclaimer and warnings. Anyone attempting to buy SwitchMote should read that guide and agree to the terms of purchase before doing so. LowPowerLab assumes no responsibility for how SwitchMote is used.

The guide is a work in progress and more details are added as they become available. Code is not yet published as it needs some final touches, but should be ready in a few days.

SwitchMote has been in development for months and went through several prototype revisions. But it paid off. The current version is stable and more user testing will hopefully lead to turn out even better features and fine tune the future revisions.