STM32 Nucleo Expansion Board Recieved!

This is just a quick post showing the newly arrived PCB’s.  I have only found a few errors in the board where the STM32 Nucleo Expansion port didn’t have some signals that I assumed.  Luckily I added enough 0 ohm resistors and work arounds so that it won’t be a problem.  (Latest schematics on Github show the changes in the Develop Branch).  I discovered the problem when adding OneWire support for the DS18B20 temperature sensor.  Once I get all of the other sensor ports working I’ll flush out any other unexpected behavior and keep the schematics updated as I progress.

Top:

Top

Bottom:

Bottom Side

I got 10 of these boards for about $20 so it was a really good deal. These boards were made in Kicad and the designs and all source code is available on github as explained in this post.

After attending Embedded Systems Conference this past week, I’ve got quite a few new ideas to making these sensor nodes firmware more robust, with licensing terms that will allow me to use the software I create in open source projects as well as closed source.

 

STM32 Nucleo-L152RE SensorNodes Project

So for the past few months I have been working on planning a project that has been on the back burner for quite some time:  house hold wireless sensor network.  The principal is that I would have micro controllers running in low power mode spread across the house monitoring for special failure conditions, such as the toilet starting to leak.  Once a failure condition is detected, a wireless message would be sent and ultimately I would be notified via email or text message of the failure.

Choice of Platform for Project

The following platforms were considered:

  1. MiniWireless from Anarduino.
  2. ULPNode from Charles-Henri Hallard.
  3. JeeNode from JeeLabs (or their US distributor ModernDevice)
  4. Teensy 3.1 from pjrc
  5. Freedom-K64F from Freescale
  6. STM32 minimum development system on eBay
  7. STM32 Nucleo series from ST

The ATMega328 based platforms (MiniWireless, ULPNode, JeeNode) all have been exercised in low power modes and would serve well as simple wireless modules for checking simple conditions and sending a wireless message.  The downside of the platform is the limited number of interface options and the 8-bit processor itself. The lack of JTAG or SWD debugging increases debugging and validation time significantly.

Teensy 3.1’s are a great Freescale platform utilizing the MK20DX256 family of processors.  It has a 32-bit processor with a very dedicated designer who is very active in the support forums for the device.  One of my aspirations with this project is to be able to wirelessly reprogram all the sensors on the network, and the Teensy 3.1 won’t work in that regard.  The Teensy 3.1 supports a small microcontroller named HalfKay which runs closed source firmware which makes the Teensy 3.1 easy to program from the Arduino IDE (provided you have the Teensyduino library installed). The Teensy 3.1 is so stable that I have one at home and at work that I use to filter all of my keystrokes to create and replay macro’s. A rather nice side note is that the Teensy 3.1 platform now supports SWD debugging, which involves cutting two traces and soldering a few wires.

Freescale’s Freedom-K64F is a feature packed platform which has a variety of sensors already on the board, with bloggers dedicated to the configuration and usage of the platform. One of the key factors in the projects that I choose to work on is the accessibility of the components.  Ideally everything that I share with the open source community should be relatively inexpensive to purchase or download.  The FRDM-K64F however comes in at $35 plus shipping, which is a bit out of the inexpensive range compared to other offerings.  My plan is to have a dozen or more of these sensors around the house so the price for each development board would quickly add up.

The STM32 minimum development environment found on eBay is a bargain at under $6 for a fully reprogrammable module. However the support for the cloned hardware is lacking, and useful tools such as a JTAG programmer would have to be purchased separately.

STM32 Nucleo Family

STM32-Nucleo

In order to capture more marketshare of the Maker community, ST has partnered with mbed to produce the Nucleo line of development boards to showcase many of their processors. High performance Cortex M4’s are among the lineup as well as low power Cortex M0’s, all priced below $11. After carefully reviewing the available lineup, I selected the Nucleo-L152RE for its low power features and wide range of communication options. It’s the only board that not only has a large programming space of 512KB, but a 16KB EEPROM.  21 Channels for the ADC and two DAC outputs make it an ideal expandable platform.

I have already started to work through examples for it and learning the platform in general.  The great thing about the STM32 platform is the recent availability of the OpenSTM32 System Workbench. With the eclipse based IDE, it is fairly straight forward to create a new project, compile, reprogram and debug projects using the OpenOCD compatible ST-Link built into the Nucleo boards. AC6, the company that partnered with ST to deliver this great tool, have an update mechanism for not only the eclipse plugin but for all of the dependencies such as GCC and OpenOCD. Unlike other full featured open source development platforms, the only step needed is to install the System Workbench as it takes care of the rest.

After working with NXP’s LPC1788, LPC1347, Nordic Semiconductor’s nrf51422,  and Texas Instrument’s RM46L852, I find that the development workflow is best in OpenSTM32 System Workbench, followed closely by Nordic Semiconductor’s nrf51422 (after following all steps in Application Note 29 to get a working eclipse setup).

Nucleo-L152RE expansion board

L152RE Expansion Board Schematics

Today I sent out an Expansion board for the Nucleo L152RE which takes full advantage of the pins brought out to the Morpho headers ST provides. The design, developed in Kicad, is fully open source with a permissive Creative Commons – Share Alike license.  Even though I have a full Altium license available, I chose to use Kicad so that anyone can use the designs and all parts freely.  The design and design files are on github for download.  Do keep in mind that I haven’t tested it yet, so it should only be used as a reference.  Once boards come back I’ll populate them and begin testing.

Nucleo-L152RE Expansion Board

The expansion board has the following features:

  • Fully Open Source developed in open source Kicad with part numbers and the actual BOM (so anyone can take the design and change it)
  • RFM69HW pads for high power wireless
  • 128Mb external FLASH
  • MT3329 GPS footprint for 10Hz update rate
  • RGB LED pins along with 4 status LEDS and 1 status button
  • Circuit to perform zero power voltage measurements
  • RJ-45 connection for external power support along with some gpio pins and SPI bus
  • 2 RJ-45 connections that each support a SPI bus with a unique chip select, ADC pin, and a GPIO/DAC pin.
  • SWD breakout for ST-Link SWD debugger
  • 2 USART connectors
  • Micro USB AB connector that can potentially support host or device (with a programmable ID pin)
  • 4 I2C, 4 One Wire Bus connectors, 4 ADC water sensing pins, 4 motion sensing inputs, and 6 pins multiplexed into a single ADC channel meant for limit switches or on/off sensors

Most of the pins on the STM32-L152RE can tolerate 5V, so for the pins that aren’t, I’ve added a special note on the pins on the schematic to serve as a clear reminder.

Part and PCB Price Comparison

Since the last board I sent out a number of comparison tools have entered the market that allow for the quick comparison between the different major part stores (digikey, mouser, newark, etc…) and different major PCB houses.  Using both of those I saved over $25 dollars on my small run of 10 boards + parts for 10 boards.  For SandSquid, it worked best if I used the manufacture part number rather than a particular store’s part number.  So for all of the parts in my schematic I have added field’s to the part that has the manufacture part number, and following the recommended way of Kicad, I modified the python script for BOM generation to throw that part number in a CSV with all of the other fields, so that I can copy and paste it into the example BOM on SandSquid.

In the past I have had a lot of success with OSHPark and I have found that their prices are reasonable, but after a quick look at PCB shopper I was able to find a PCB house that would print 10 of my boards for less than half the price to print 3 boards from OSHPark.  Since many of those cheap PCB houses are in China, the quality won’t be the same as the quality purple PCB’s from OSHPark, but I decided to take that chance.

Summary

So in summary I have started to branch out into developing on the STM32 family of MCU’s, with an ideal platform for collecting a variety of sensor measurements throughout my home and vehicles. This first revision of the board is meant as a stepping stone, with future open source boards integrating the STM32 processor into a one board solution. By choosing open platforms like Github and tools like Kicad, these designs and firmware can be a benefit to the community as a whole.

Teensy 3.1: Adding mouse scrolling support for Linux

Logitech wireless keyboard + Teensy 3.1 + USB Host chip

Logitech wireless keyboard + Teensy 3.1 + USB Host chip

I recently started a project with a Teensy 3.1 and USB Host Shield, I dub it my Keyboard/Mouse Macroizer.  The objective was pretty simple: Record and Playback all of the actions one typically does with a keyboard and mouse.  This is fairly unique since it can record not only keyboard actions, but mouse actions too.  Currently I have two of them and they are my default keyboard and mouse both at home and at work.

LCD + 3d printed case

LCD + 3d printed case

Today I’ll just be talking about some modifications needed to the default Teensyduino 1.18 to add the necessary support for mice.  Apparently there is a bug in the linux driver for mice support, that causes the scrolling action on an absolute mouse, to not be processed by linux.  One day I may track it down, but for now, my work a round is to add a second mouse to the USB descriptors that the Teensy passes the OS when it begins the enumeration process.

Just so everyone knows, I’m using Eclipse as my IDE for this project since the Arduino IDE is designed for beginners.  I would have given up in frustration if I had to use the Arduino IDE to develop these project.

A quick summary of the changes I made:

  • Added support for 5 mouse buttons
  • Added an absolute mouse HID
  • Increased the power that the Teensy requests from the USB host (aka computer)
  • Removed support for the joystick (not necessary in my application)

I just went and updated Paul’s latest repo with my changes, which are reflected in the following git diff.  My recommended method of adding these features, if desired, is to use the application provided by Paul to get the base environment, then add the changes from there.

Continue reading

Converting Text Ebooks into Audio ogg files

Text to speechI’ve recently started a job that requires a 1 hour commute each way, and so I decided to make the most of it by listening to audio books.  I’ve finished about 3 audio books so far, but I realize that I will soon run out of interesting content to listen to (I’ve been listening to LibreVox free public domain audio books).

Exploring the world of Text To Speech (TTS) software led me to first examine espeak, which had too much of a robotic tone for my liking.  I then stumbled upon Pico TTS on my cheap android tablet, which sounded too good to be true.  Looking around, I found a linux project that uses it, PicoSpeaker. Pico is a TTS solution from the company SVOX Mobile Voices, which apparently specializes in text to speech solutions for devices.  I’m not sure how the product ended up in linux as the packages sox and libttspico0, but they are their, and they work reasonably well.  The frustrating problem I found, was that PicoSpeaker didn’t accept large files.  So frustrating was this problem, that I continued to look around at different fixes.

I then checked out Festival, installed better voices, and still found the quality lacking in comparison to Pico TTS.  I played with the gain, rate, pitch to make the different voices sound better to me, but it failed to make a difference (I tried out the MBROLA and CMU Arctic voices, samples here).    Even though I could convert a complete file with these, they didn’t sound as good to my subjective ears.

To cut a long story short, much of my Saturday was spent on getting a TTS solution which would help me convert Text books to Audio books.  To fix the file size limitation problem, I split up the file into 100 line parts with:

split -l 100 -d -a 4 Ebook_ Text_To_Convert.txt

This creates a set of text files with no extension, starting at Ebook_0000.  Next I created the following script, which I named convert.sh:

#!/bin/bash

if [ $# -eq 0 ]
then
echo “Type the base name of the file to convert, followed by enter:”
read name

echo “Type name of author: ”
read author

echo “Type name of book: ”
read book
else
name=$1
author=$2
book=$3
fi

for f in $name*;
do
echo “Converting $f ..”
cat $f | ./picospeaker -o $f.ogg;

echo “Now adding tag information”

lltag –yes –clear -a “$author” -A “$book” -t “$f” $f.ogg
done

I run this script by making the script executable (chmod +x convert.sh) and provide it with the base name (Ebook_ in this case), the title of the Author (“Henry Thoreau” for example), and the title of the book.  Note that if any of those have spaces, you need to put the words in quotes.

The end result is a pretty decent sounding audio book, that I can actually play at 120% (with the -r 20 flag provided to picospeaker) with all of the words intelligible. Here is a 6 minute sample of the audio, uploaded on Picosong (Picosong seems to be like the imgur of audio links, pretty nice service).  This is a sample of it as I like to listen to it.

You may need an additional step to convert the audio into an mp3 format, and to do that, add the following before lltag:

ffmpeg -i $f.ogg -ab 128k $f.mp3

Note that this creates a larger file than the ogg, I’m not sure of the settings to make it better, but for now it will work.  Better to ship something working, than nothing at all.

Flashing Arduino’s and AVR’s over the Network

PI + Pogo + LSCommander

Can flash over the network for Raspberry Pi’s, Pogoplugs, and normal Linux machines.

Ever since I read this post, I wanted to see if I could reliably flash Arduino’s over my network.  I’m pleased to announce that I can, and my plan is to share the juicy details so that you too can enjoy being able to reprogram your projects from the comfort of your main machine.

RFC2217 is a standard that lets you read and write to a serial port, over your local network.  It not only sends data, but it lets the remote client send RTS and DTS signals, which allow you to reset the remote AVR.  The general standard gives us some nice flexibility, letting the remote client control the serial port as if it was right there.

Why would you want to do that?  Well, I can do my main programming on my main machine at my comfortable desk, while having my AVR microprocessor in the hot garage next to the Raspberry Pi/Pogoplug, connected to the network.  Developing on a Pi or Pogo is slow, so if I can leverage my powerful system to do the development on, and delegate the Pi to just the flashing part, then it reduces one more barrier to having network capable, field re-programmable devices everywhere.

A big advantage for me is that now I can completely contain my development environment into a virtual machine, which can be backed up, moved to a different machine, or saved/resumed.  If there are enough requests, I can see if I can upload the machine somewhere for easy download.

The RFC2217 standard would allow for some pretty interesting things.  I could have an Linux Serial Commander connected to one computer, that controls the Raspberry Pi + monitor in the other room. With SSH tunneling, I think I could flash firmware over the internet (I will test this soon), so that all you would need is a Linux system on the wifi, to be able to reprogram any networked RFC2217 AVR within that network.  Another idea is if you need to reprogram your AVR based sprinklers, instead of bringing it inside, you just bring a Raspberry Pi + USB wifi adapter + batteries + serial cable to the unit.  Push a button, and the firmware is flashed from your remote computer.  Pretty awesome.

I’ve uploaded this updated LScreamer to bitbucket this time, a link to it should be in the side bar.  Feel free to ask any questions about getting started with LScreamer.

Newest Project: Linux Serial Commander

LSCommander on left, Raspberry Pi on right

LSCommander on left, Raspberry Pi on right

Recently I was playing around with the Raspberry Pi and thought of how useful it would be to pair an 16×2 character LCD + buttons with it so that I could control it on the go.  After a few hours of brainstorming, I came up with the Linux Serial Commander, which is an Arduino + LCD + buttons, paired with a Linux system running a python server that I wrote.

Here’s a short video of it in action (recorded using guvcview in Linux):

Linux Serial Commander operation from Dustin Robotics on Vimeo.

Continue reading

Using the Raspberry Pi as My Development Machine

300px-RaspberryPiAs many of my readers know, the Raspberry Pi is a $35 dollar ARM computer with 2 USB ports, and ethernet port, HDMI, and some GPIO pins.  My current plan is to use the Raspberry Pi as my main development machine, flashing all of my ATMEGA328 chips from it.  This will allow me to not only program anywhere, but should my computer crash, my development environment will be perfectly safe (provided that I keep it backed up).  This 700 MHz computer is pretty dinky, when I first ran the GUI several months ago, all I saw was how unreliable it was and that it would be impossible to get anything done on it.

Since then I purchased a high speed SD card from a quality manufacturer, and the performance is better.  I also learned that you can divide the memory between the GPU and the general purpose memory.  For my case, I decided to skip the monitor and keyboard, and SSH into it using KiTTY (an updated PuTTY client). I’m also using Xming to serve as a X11 Server on my windows system, so that I can do X11 forwarding of the Arduino IDE if needed.  I hope to use the command line version, arduino-mk, but currently it doesn’t work as well as the Arduino IDE does.

I also discovered that many of my existing programs no longer work on the latest Arduino IDE v 1.0.1, because the avr-gcc team changed some things around.  Luckily I have a backup of my old development environment, as well as a working VM with it on it, but my current plan is to update my existing code as needed, to work with the new versions, since they are the future.

Here’s a brief rundown of what I needed to setup on the Raspberry Pi to get it to work:

  1. Install the latest Rasbian onto your SD card following these instructions. I followed the Easy Way.
  2. I then connected the Raspberry Pi, SD, Ethernet, and power (from a reliable charger, I’m using a HP Touchpad USB charger).  You’ll need to find the IP of the raspberry pi by checking your router for newly connected devices.  Use KiTTY to SSH into it (using the IP and port 22).  Username / password is pi / raspberry.
  3. Go ahead and update things (sudo apt-get update, sudo apt-get upgrade).  I install vim, tmux, arduino and python-serial as well. I also copy a folder I made a while ago that has all of my vim, screen, and tmux settings.
  4. To get my usb-serial devices working, I need to update to the latest raspberry pi kernel.  To do this, we need to install rpi-update. With that installed, update the kernel.  As of this writing, the latest kernel is “Linux raspberrypi 3.6.11+ #414 PREEMPT”,
  5. Now you should be able to use LScreamer or Arduino to flash your projects!

What’s great about this setup, is that I can SSH into the raspberry pi from anywhere (provided I have opened up the right ports in my router).  Yesterday at my brother’s house I was connected to my Raspberry Pi on my workbench, trying to get an Arduino program to compile. As I work on my latest project, I may implement some improvements to this Raspberry Pi setup, possibly automatically controlling my Oscilloscope and my power supply.

I find taking little steps to big goals gives you small accomplishments that build up, giving you that much more motivation to finish.

Useful Tools for a Safe Internet Browsing Experience

magnifying-glass-300x200As I posted a few posts ago, Information: You don’t own it unless you take it, now I will provide the tools that will allow you to take control of your browsing experience.   The motivation for this post is that I’m discovering that some of the content that I enjoy on the Internet, is disappearing.

The following steps are listed in the order of most importance/impact, and are recommended by me to improve your browsing experience.

1. Update your Hosts file

A hosts file is used by most devices that access the internet.  When your browser needs to process a URL, it first looks at your hosts file to determine if any special rules exist for that URL.  By updating your Hosts file, you can make any attempt to load a malicious URL fail on your computer. You should consider installing a host file onto all of your computers and smartphones/tablets.

  1. Download a hosts file from http://someonewhocares.org/hosts/.
  2. Follow the instructions provided in the hosts file to install it.  I would recommend deleting the line in the hosts file which blocks adf.ly, since there is a decent amount of content (typically Minecraft mods) which is provided through adf.ly links.

2. Download Firefox and SeaMonkey

Why would you need 2 browsers?  To restrict and control what the websites you view, know about you.  I’ll also recommend some addons that will help protect you from being tracked by the advertising agencies such as Google or Facebook.

firefoxWhile Firefox doesn’t provide as many options as I would like, there are generally addons which fix the shortcomings of the browser.

 

seamonkey

SeaMonkey is a browser which is based on Firefox, but without the unnecessary changes to its User Interface.  It also combines a mail reader and address book to be a unified application for all of your internet correspondence.

3. Tweak Firefox

I recommend the following addons to improve security and your enjoyment of the internet.  Many of these purposefully break websites that you are viewing to allow You to control what content you wish to view.  Once you get these plugins installed and running, you may consider donating to many of them, since they really do make your browsing experience much better.

  1. NoScript blocks scripts from running on websites, many of which are designed to track you.  In the options for this plugin, under the General tab, you should enable “Temporarily allow top-level sites by default” and the option under which is “Base 2nd level Domains (noscript.net)”.  Under the Notifications tab, disable “Display the release notes on updates”. Generally when you visit a webpage, you may have to enable scripts, one at a time, to get the content to display.
  2. Adblock Edge blocks unwanted advertisements, and is based on Adblock. While many websites depend on advertising to remain in business, often they are not selective about what ads are displayed, and as a result, can install Malware and viruses onto your computer just from visiting a website.
  3. Startpage Https search replaces the insecure and privacy violated Google search engine with a search engine based on google, which removes the privacy problems (since Startpage is doing the searching for you).  Google is an advertising agency who releases free products used to gather information and sell their Ads.  Never trust a company who sells your information, and never provide such information freely.  If anyone can recommend a non-Google and non-Bing based search engine, I would be glad to hear it.
  4. Flash Block stops flash videos from automatically playing.  I’m not entirely sure who thought it was a good idea to have videos play automatically, but in my opinion it hampers the web browsing experience.
  5. Cookie Monster allows you to selectively allow, and delete, cookies for websites you go to.  Browsers are pretty broken in their current implementation.  A website like Facebook can not only interact with the cookie they hold, but also access all of your other cookies used in that browser.  Amazon updates your account anytime you search on amazon for anything, so by allowing the Amazon cookie to persist, they keep track of Everything you’ve ever searched.  Target does the same thing with shopping patterns and is very effective with it, detecting pregnancies and mailing targeted advertisements to expectant mothers.
  6. HTTPS everywhere allows you to have a secure connection between your browser, and the website you are trying to view.  With such a HTTPS connection, you can connect to a insecure wifi hotspot (or your work intranet for example) and securely conduct business.  Keep in mind that the URL of the website you are viewing can still be harvested, just not the content on that website.  Non HTTPS sites you view are sent in plain text, as well as all information you enter.  Look for the Lock icon next to the URL in your browser to determine if it is an HTTPS connection.
  7. Redirect Remover allows you to skip the middle man when trying to view links and contents.

The following addons are recommended to allow you to capture content easier, which can range from downloading all of the content on a website, to downloading full ad-free flash videos. One plugin is also provided to improve usability of Firefox.

  1. DownThemAll allows you to download all of the content you are viewing, to a selected folder on your system.  Useful for websites that directly host file downloads (such as a image hoster). Also get DownThemAll Anti-container.
  2. FlashGot allows you to download flash videos from some of the major video hosting sites.  This allowed be to download and keep a version of the video linked above :)
  3. Youtube MP3 Podcaster allows you to download flash videos as well, having two options can be pretty useful, I generally install both.
  4. Tree Style Tab shows your tabs on the left side of firefox, rather than across the top.  Given our obsession with wide screen monitors and laptops, I’m not sure why this isn’t more popular.  It allows you to have hundreds of tabs open where you can easily read the title of each (and have sub tabs).

4. Tweak SeaMonkey

Sadly many of my favorite addons available for Firefox, are not available for seamonkey.  Here’s a list of those I have found: Startpage HTTPS searchNoscript, NoRedirect, TrueBlock Plus (like AdBlock), HTTPS Everywhere (select Firefox to download), FlashGot, DownThemAll, DownThemAll Anti-Container, and Complete YouTube Saver.

5. Abandon Webmail

Email which is left on a server such as Google’s GMail, for at least 180 days, is considered abandoned, and can be read by any agency. While not paranoid myself, I do enjoy a certain sense of privacy, and I believe that a Court Order should be required to view my private information.  It is also important to keep in mind that Email is sent in plaintext, meaning everyone between your email server, and the destination email server can and will scan the contents of your email.  Email is just like a Post Card.  I would recommend using SeaMonkey as your email client, and set it up to download all of your email.

6. Secure your passwords

keepassYou should never let Firefox remember your passwords, because if someone gains access to your computer, your passwords will be easily harvested from your browsers.  I would recommend a password manager such as KeePass. Keepass allows you to save your passwords into an encrypted file, so that even if your computer is compromised, your passwords are safe.  It also provides a random password generator that allows you to create super strong passwords which are unique from other passwords you’ve used.

The general problem is that if the username and password for one website is compromised, many times that same username/password is used on different websites.  By having a unique username/password for each site, we limit the damage that can occur from our username/password being compromised.

7. Cleanup your Startup on Windows

ccleanerIf you are using the Windows OS, many programs that you install decide that they should start when windows starts, without providing you the option to disagree. CCleaner seems to me to be a very easy way to not only clean up things, but to remove unnecessary things from startup.  While I disagree strongly with their installation setup (trying to trick you into installing toolbars), there unfortunately doesn’t seem to be a better option.

8.  Perform your chatting using Pidgin

pidginPidgin allows for you to connect to different IM networks such as AIM, MSN, GMail Chat, Facebook, etc, without dealing with the interfaces for each of those.  Many of those IM clients come bundled with Advertisements, which may damage your system. I also download the Off The Record plugin which allows for secure communication over existing IM protocols.

9. Windows 7 Usability Tools

A part of my usual windows install includes installing Find and Run Robot, WinSplit Revolution, VirtuaWin,  and WizMouse.  These utilities allow you to quickly search for things, manipulate your windows, have multiple desktops, and to scroll inactive windows, respectively. I consider Windows quite unusable without these simple applications.

Conclusion

While it will take the reader some time to go through all of the plugins and applications presented, there generally isn’t a rush, so you can take your time to learn what each of them do, and decide if you trust them.  It has taken me over 5 years to find and use each of these tools, and I hope by presenting it in a logical format, it will take you less time to start being proficient in protecting yourself online.

Outlet 60 Minute Timer

Outlet 60 Minute Timer

As I was browsing reddit today, I found this nice simple project, an Outlet Timer. I remember leaving the hot glue gun on one day, and finding it the next day, still running as hot as could be. The glue that came out of it was orange, and I know that things would have been bad if I didn’t catch it when I did. Typically I try to be as cheap as possible, but for the importance of this project, I didn’t mind investing the $27.

Here are the parts that I used for this Outlet Timer

In true DIY fashion, I’ll go through the steps that i used to make it.  I first wanted to find out which wire was Hot (the conductor that is switched when you switch on/off the power strip.  I first pealed back the insulation, being careful not to nick any of the wires.  I picked this location so that it was pretty close to the strip.

Under the insulation, we find, 3 wires (white, black, green).

In my case, the switch was connected to the black conductor (I could tell by measuring the conductance between the black wire, and that socket, when I switched on/off the power strip).  I cut the wires, with a pair of wire cutters, and stripped the recommended length of conductor for the countdown switch.  After feeding both wires through the 1 Gang electrical box, I inserted the trimmed black conductor into the countdown switch.

Inserting Black wire into countdown switch, note that both ends of the power cord have already been fed through the 1 Gang electrical box.

After that, I secured both green wires together using a WireTwist wire connector, and I did the same for the white wires.

Securing green and white conductors with wire connectors

At this point, I wanted some strain relief, so that things don’t come undone if someone accidentally pulls the power strip.  So I took 2 black zipties, and fed it through the 1 Gang electrical box so that the power cable will be secure against the box.

Stress relieving the power cable using zipties

By far the hardest part of this project was screwing the Countdown switch to the 1 Gang electrical box.  Those flat-head screws weren’t fun.  I wrapped it up by putting the faceplate on.  I did a quick sanity check, by using my multimeter and checking conductance before it has been plugged in.  Ground and Neutral were always connected, Hot was only connected to the wall if both the timer was on, and the switch for the power strip was on.  I tested it using my plug tester, and it tested out :)

Price list

As always, proceed at your own risk.  If you make this project, and it messes up, you take full responsibility.

Outlet 60 Minute Timer

Cheap Breadboard Arduino with Wireless Module

I see that there is a good amount of demand in the community for a cheap “Arduino” clone with wireless. Many people, while grateful of the Arduino community and organizers, are frustrated, because everything seems so darn’ expensive! $30 Arduino Board + $20 wireless thing + $15 proto board makes almost $100 just to get you running. If you somehow found JeeNodes, they are $23. A RBBB, which just has the processor, is $13. We can do better than that though!

If you’ve clicked on the caption, you’ll see that it is possible to make a breadboard Arduino for just $7. The problem is that we still need a wireless module. XBee’s retail for $23, which is a pretty robust solution (configurable up to 19200 baud in real world situations, can communicate just with serial, standard footprint so there are lots of cheap adapters for it). But it’s expensive. You can check out the RF Bee, which is a $20 wireless solution, which actually contains an Atmega168 (running Arduino)! It’s tiny form factor is awesome, but it is $20. A RFM12B radio retails for about $6, which is pretty decent. It even has a good library for Arduino to go with it. But we can do better.

How about a $2.50 wireless module, that has a good library to go with it? That would bring our cost to $9.50, excluding shipping. That’s my cup of coffee. The hard part is finding the individual components you need, which I will help you out. Finding the cheapest parts from 20 different places is great, but the shipping will kill you. I’ll attempt to minimize the shipping cost, by ordering from a few places, getting what we need from each.

Parts:

Extra:

That brings the total for the required parts to $5.44…  wow.  Shipping would be about $5 from each place (roughly), but it isn’t included in our consideration.  Getting some different colored wire wrapping wire will help you out a lot, as well as getting a wire wrapping tool (which can be very useful).  Adding the $2.50 wireless module would bring you to $8, pretty nice!  This number scales down as you buy more, so if you buy enough parts to build 3 or 5 of them, it will be cheaper. Consider the pricing levels of the ATmega328p chips to figure out how many you should buy (you should always get spare protoboards :P )

I’ll do a post sometime soon on my recommended set of parts to have.  A quick update on the Carduino: I still haven’t put it in, I need to get up the motivation to start modifying wires and integrating it into my car.  I know eventually I’ll get to it, but in the mean time, I’m exploring the idea of making my own Watt Meter, with SD logging.  It would be hard to compete with that, but if I’m smart, I can end up with a meter that can work in RV’s, like this one does, using an external Shunt (small value, high wattage, precision resistor).  Till then!

Edit:  If I could make a schematic for this cheap Arduino breadboard, I would take the parts required to make it work, and customize it for each application after it.  The arduino is great as a platform, but for completed projects, typically the soldering connection is constant.    Here is a quick guide on wiring up the nRF24L01+ to a Arduino.  By following the Instructables post, you can get a general idea of how to wire it up.  I got the idea for the voltage regulator + resonator from JeeLabs, so the v5 schematic would be what you use to wire up the rest of it.  I hope this helps!