Saturday, September 20, 2014

Arduino Himalayan Salt Candle

Himalayan Salt Lights are really cool looking translucent salt "Rocks". With a lightbulb inside, not only are they a soothing warm light, but they are supposed to give off Negative Ions that leave you refreshed. I have added a Arduino and  SSR to give my light a flickering candle look, which makes it a very interesting conversation piece.

Video, code, and parts list below!


Arduino UNO
Solid State Relay (SSR)
Himalayan Salt Light


int lightPin = 9;   
int randNumber;

void setup()  { 
  pinMode(lightPin, OUTPUT);  

void loop()  { 
    randNumber = random(50, 254);
    analogWrite(lightPin, randNumber);   

Tuesday, September 16, 2014

De-Soldering Can Be A Pain!

I typically hate de-soldering. Removing old parts, or re-working a new design can be tricky, as you can over heat a part, damage the board, etc. Well, I've been using a inexpensive manual vacuum tool for months now, and it works GREAT! Cleans the holes out well, and the parts drop right out. The Soldapullt DS-017 is the perfect companion to my Sparkfun variable temperature soldering station.

Tuesday, September 2, 2014

The Under $5 Arduino

Next time you build a permanent project, don't waste a $15-$30 Arduino board. You can get the same functionality of the Arduino UNO for less than $5 at

No usb or power onboard (requires 5v). Program it with an existing UNO or a FTDI Cable.

Will post a programming tutorial as soon as these arrive!

Friday, August 22, 2014

Pan & Tilt, Arduino Style

I've been wanting to play with an Arduino controlled Pan & Tilt Mechanism for quite some time. Today I ordered a kit that will be a prototype for a solar array on a bigger scale. I'll be using this Pan & Tilt Mechanism. The kit includes brackets, two miniature servos and all the nuts and bolts. I'll mount a small solar panel from a garden light on here, and keep you posted as to my progress.

Update: Received kit 8/25/14
Check your hardware package before starting assembly! Mine was missing a small self tapping screw for holding the servo to the wheel. Jameco sending replacement hardware.
Update: Received replacement hardware 8/29/14. Jameco Rocks!

Thursday, August 21, 2014

Albert Piganti Updates Arduino Basic Connections

Albert Piganti, known as Pighixxx, is well known for his beautiful artwork depicting various microcontrollers like the Arduino and Raspberry Pi, and the various accessories and connections that can be made with them. He is updating his original designs, and you can find them at

Friday, August 15, 2014

4 Channel 16 Bit ADC Arduino / Raspberry Pi

The Arduino UNO has five 10 bit Analog to Digital Converter pins (0-1023), but I needed higher resolution. I'm working with a I2C connected 16 bit 4 channel ADC from Adafruit called the ADS1115. 16 bits of resolution allows me to measure signed integers with values ranging from negative 32768 through positive 32767 (-5v to +5v). Although I'm running this single ended (measuring 4 separate inputs in respect to ground), it can also run in a 2 channel differential mode. This would measure the voltage difference between AIN0 and AIN1, and between AIN2 and AIN3. I'm multiplying the value being reported by the ADC by .000188 (188uV / bit) to get the voltage being supplied to the input.

The Raspberry Pi has no ADC, and can only read digital inputs, so this would be a nice addition, as the Pi does have a I2C interface. I'll post an article on the code for doing this soon. Here is the code for the Arduino. Complete tutorial, connections, and library available at

#include <Wire.h>
#include <Adafruit_ADS1015.h>

Adafruit_ADS1115 ads1115;

void setup(void)

  Serial.println("Getting single-ended readings from AIN0..3");
  Serial.println("ADC Range: +/- 6.144V (1 bit =  188uV)");

void loop(void)
  int16_t adc0, adc1, adc2, adc3;
  float volt0, volt1, volt2, volt3;

  adc0 = ads1115.readADC_SingleEnded(0);
  adc1 = ads1115.readADC_SingleEnded(1);
  adc2 = ads1115.readADC_SingleEnded(2);
  adc3 = ads1115.readADC_SingleEnded(3);
  volt0 = adc0*0.000188;
  volt1 = adc1*0.000188;
  volt2 = adc2*0.000188;
  volt3 = adc3*0.000188;
  Serial.print("AIN0: ");
  Serial.print(" ");
  Serial.print(volt0, 4);
  Serial.println(" vdc");
  Serial.print("AIN1: ");
  Serial.print(" ");
  Serial.print(volt1, 4);
  Serial.println(" vdc");
  Serial.print("AIN2: ");
  Serial.print(" ");
  Serial.print(volt2, 4);
  Serial.println(" vdc");
  Serial.print("AIN3: ");
  Serial.print(" ");
  Serial.print(volt3, 4);
  Serial.println(" vdc");
  Serial.println(" ");


Wednesday, August 6, 2014

Dual RFID Readers

I have an application that needs two RFID readers. Because these RFID readers are SPI devices, they can be connected to the same two data pins (MISO & MOSI), and clock pin (SCK), and only two pins (SDA & RST)  have to be unique. This makes a total of 7 data pins, plus 3.3v and Gnd. I'm taking the 5 sets of serial numbers, and adding them together, and making each reader accept a different set of numbers. Run the serial monitor, scan your badge or keyfob, and then enter the total code into your sketch to make it active. You could have two security doors, and one badge will get you through one, but a different badge can get you through both. Get the code and library here!

Friday, July 25, 2014

Constant Current, or Constant Voltage?

I needed a Constant Current power supply for my bench. Now I don't know if you have priced bench power supplies lately, but they can be several hundred dollars. Not any more! Would you believe a 40v 3a adjustable voltage or current supply for about $20?
I grabbed a used 24vac HVAC transformer, soldered a bridge rectifier on top, and fed the input on this board. I put a 300ma 1w LED on the output, and I'm controlling the brightness by controlling the current, even down to 2ma (dim), all the way up to 300ma (blindingly bright). I could go higher, up to 3000ma, but that will let the magic smoke out.

Wednesday, July 23, 2014

Put the Physical into Physical Computing!

The whole point of microcontrollers and physical computing is doing something with the data sensed. If you sense a temperature, if you sense motion, you act on it. However, There's a bunch of science involved when you want to make things move, making sure you have enough power to move said object. The best explanation of the science of making things move is "Making Things Move DIY Mechanisms for Inventors, Hobbyists, and Artists" by Dustyn Roberts.
I've written about this book before, and I own it in paperback and kindle version, because it's that important to Arduino and Raspberry Pi owners. If you want action, you need this book. It simplifies the "magic" of making your microcontroller make things move, in some cases, very large objects.

Sunday, July 6, 2014

Creating the Super Simple Library

Functions allow you to remove repetitive routines from your main code, and call them when needed. There are times when you would like to move commonly used functions out of your Arduino sketch entirely, and into a library you can call from your sketch. This helps clean up your sketch visually, and allows you to reuse code without having to recreate it each time. Below is a simple sketch that takes a value in Celsius, and converts it to Fahrenheit. I'll show you how to convert that into a called function, then I'll repost it by calling an external library that does the same thing. This is kept simple, in order to show the process. There is much more you can do with libraries, but this is the bare minimum to get it to work.

Original sketch without a function:

float celsius = 20;
float tempF = 0;

void setup()
  tempF = (1.8 * celsius) + 32;

void loop()

Original sketch with a function:

float celsius = 20;
float tempF = 0;

void setup()
  tempF = tempConvert(celsius);

void loop()

float tempConvert(float celsius)
  float fahrenheit = 0;
  fahrenheit = (1.8 * celsius) + 32;
  return fahrenheit; 


Now let's remove the function tempConvert, and put it in a seperately called library, ( a pair of .h & .cpp files).

Sketch calling libary:

float celsius = 20;
float tempF = 0;

#include <tempConvert.h>

void setup()
  tempF = tempConvert(celsius);

void loop()

put the following two files in a folder called tempConvert, inside the libraries folder.


// tempConvert.cpp

#include "Arduino.h"   
// use: Wprogram.h for Arduino versions prior to 1.0

#include "tempConvert.h"

float tempConvert(float celsius)
  float fahrenheit = 0;
  fahrenheit = (1.8 * celsius) + 32;
  return fahrenheit; 


 * tempConvert.h
 * Library header file for tempConvert library
#include "Arduino.h"

float tempConvert(float celsius);  // function prototype

For more on creating libraries, see

Sunday, June 29, 2014

Arduino, or a Raspberry Pi, What's better?

Well that question is like asking what's better, a hammer, or a saw? It all depends on what you are trying to accomplish. If you are trying to read analog and digital inputs, make a decision, and control a device, the Arduino is the clear winner. If you need to run a linux operating system, with web and database services, full screen displays, and keyboard and mouse input, then the Raspberry Pi is more appropriate. There are many projects that are best served with a combination of the two. For instance, we use a network of Arduino's as sensors, feeding a database running on a Pi, and other Arduino's are picking up jobs from the database to be executed. This could not be done by an Arduino or a Raspberry Pi alone. So don't limit yourself to making choices, take both home, thay are small!

SainSmart Arduino Uno - $17
Raspberry Pi - $37 (needs a SD Card)

Wednesday, June 25, 2014

Setting up Arduino to work via Windows Embedded and RDP

by Mike Maynard

So here is my situation.  I had the brilliant idea to set up virtual machines for my boys to use, and let them access them via an HP Thin Client, and Windows Remote Desktop.  Great idea right?  I thought so..... right up to the point where I wanted to introduce them to the Arduino.....

The Thin clients are running Windows Embedded Standard (WES) an embedded version of XP.  They then connect to their Win 8.1 pro virtual machines using remote desktop.  Its actually set up so when they log into the the thin client (TC) the remote desktop session (RDP) auto launches and connects them to their virtual machine.

The directions that follow make the following assumptions:

  • You already know how to setup and use an Arduino on a standard computer
  • You are somewhat familiar with driver installations
  • You understand the basics of making a Remote Desktop Connection and how to set its options prior to the connection.

The first problem is, WES does not have driver support for the Arduino.  After much digging I stumbled upon this article - - which was instrumental in making this work.

I only needed 2 files from his list

  • usbser.sys
  • mdmcpq.inf
I originally tried copies out of a Windows 7 install, but I am not sure they will work.  Not having a handy XP install, I turned to google.  I found the needed files, and downloaded them along with the standard Arduino fileset from  (download the zip and not the exe, since we only need the drivers at this point).  Extract the Arduino zip someplace handy, and add the 2 above files to the drivers directory.

Plug in your arduino and let the driver install process start.  Choose the driver folder location inside the arduino directory, and voila - you should have a functional Arduino COM port!  (note: on both of my installs, I had placed a copy of usbser.sys into c:\windows\system32\drivers\ first.  I am not sure if this is necessary or not.  Also on one TC, it asked me to locate that file on my windows xp install disk, I just pointed it to the one in the above mentioned drivers directory and it worked fine)

Now on to the second problem!

Now that we have a working COM port for the Arduino on the TC - we need to pass it through to the RDP session.  I have several hours of banging my head against the wall here, and its really a simple solution, courtesy of this post here:

Long and short, upon making your RDP connection, click the options dropdown.  then choose the Local Resources tab, followed by the 'more' button.  Then check the Ports checkbox, and click OK.  Then you can make your connection like normal (or save the connection for simple use later)

Once you connect to your remote session, your Arduino Com port should be passed through to the remote session, using the same Com port  #.

Voila!! - you now have an arduino plugged into a Windows Thin Client, and passed through to the Remote Desktop Session of another machine.

Friday, June 20, 2014

Arduino Bar Code Reader

Use Bar Coded ID Badges in your time card or security application? Want to teach your Arduino to read Bar Codes? Get a PS/2 style card reader, and connect it to The Arduino PS/2 Keyboard Smart Interface, and you have Bar Code Badge ID's flowing into your Arduino security application!

Thursday, June 19, 2014

A Better Arduino IDE?

Everyone pretty much agrees that although the Arduino IDE is simple to use, for professional programming it's just not up to par with mainstream code editors.

I've used Notepad++ for several years as my editing environment of choice, for html, css, php, etc.

Would it be possible to use Notepad++ for Arduino Sketch editing? Well as it is, yes, but there's no syntax highlighting, extension recognition, or easy way to upload sketches to the Arduino (a macro that executes "C:\Program Files\Arduino\arduino.exe" $(FULL_CURRENT_PATH)).

All that and more can be done, with a few tweaks of the environment, and a plugin.

Follow the instructions at

then  download the plugin at and follow the instructions in the README file.

Tuesday, June 3, 2014

Logic Gates (with pulleys)

Computers are built with Logic Gates. A logic gate looks at a input that is either on or off, and makes a decision, producing a output that is either on or off. Different types of logic gates have different outputs. The following video describes the various types, and the associated "truth tables".

Pulley Logic Gates from Alex Gorischek on Vimeo.