Monday, October 6, 2014

Fingerprint Scanning with the Arduino

A secure way to enable access to projects is through the use of fingerprint scanning. This tutorial uses the 5v TTL unit from Sparkfun. The scanner does not come with a cable, so make sure you also order the JST SH cable. The wires from the JST SH cable are too fine to plug into the Arduino directly, so we are using a solderless breadboard to make the connections with jumper wires.

Fingerprint Scanner -> Arduino
Pin 1 - TX    (black)             D4 - RX                    
Pin 2 - RX    (white)             D5 - TX
Pin 3 - Gnd   (white)            GND
Pin 4 - VCC  (white)            +5v

No resistor is necessary for 5v use, regardless of what the sample sketch's suggest.

The sketch uses SoftSerial, so the pins on the Arduino can be changed in the sketch.

You will need to download the examples and libraries, then upload the Enroll sketch to make the unit recognize your finger print. Follow the instructions in the serial monitor, then upload the IDfinger sketch. Now when you scan your finger, the serial monitor will show "Verified" (with the appropriate ID number) or "Finger not found" if it's not recognized. All you need to do is to enable a relay if a correct fingerprint is detected, and possibly write a entry line to a SD card with time and date stamp for a entry log.




Thursday, October 2, 2014

Protect Your Outdoor Arduino Sensors

Outdoor Arduino projects, especially temperature, humidity, and barometric pressure, need access to outdoor environmental conditions, but protection from sunlight and rain. This is done with a louvered box called a Stevenson Screen or Cotton Region Shelter.
"A Stevenson screen or instrument shelter is an enclosure to shield meteorological instruments against precipitation and direct heat radiation from outside sources, while still allowing air to circulate freely around them. It forms part of a standard weather station. The Stevenson screen holds instruments that may include thermometers (ordinary, maximum/minimum), a hygrometer, a psychrometer, a dew-cell, a barometer and a thermograph. Stevenson screens may also be known as a cotton region shelter, an instrument shelter, a thermometer shelter, a thermoscreen or a thermometer screen. Its purpose is to provide a standardised environment ..." - http://en.wikipedia.org/wiki/Stevenson_screen
This is perfect for our outdoor Weather Station
Temperature, Humidity, Barometric Pressure, Dew Point, Wind Chill, and Heat Index Project 

Here's a DIY project so you can build your own outdoor Arduino Sensor Shelter!

http://www.instructables.com/id/Stevenson-Screen-weather-station/#step0


Wednesday, October 1, 2014

What's your favorite type of sensor?

Arduino's are great devices because they let us sense our environment around us. There are a great number of sensors available that can work with the arduino. Digital sensors allow us to sense whether something is on, or off, like a door switch. Analog sensors allow us to sense how much of something exists, like how much light, or pressure. Some sensors give us actual data streams, like a gps sensor, instead of simple on/off, or a varying voltage.

What are your favorite types of sensors?
What do you like to sense?
Give us feedback if we missed yours, or post links to the project you have personally made!


What is your favorite sensor?











pollcode.com free polls

Poll doesn't work? See
What is your favorite sensor?

Saturday, September 27, 2014

Arduino Seismic / Vibration Sensor

Want to sense Earthquakes? Maybe equipment vibration? We have put together a quick and inexpensive project that will sense vibration. We use a Vibration sensor from Sparkfun, a SainSmart UNO, and a I2C LCD.

We have created a bar graph that moves back and forth based on vibration intensity, and a "Earthquake" message that displays when the level exceeds a threshold.

I2C library and LCD tutorial

See Code and Video below:


Code:

//sensitivity variables
int minimum = 200;
int maximum= 1023;
int maxdelay = 400;

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27 // change to your address found with I2C scanner
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

// Custom Character
byte seismic[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};

//defines the pin connections
int sensePin= 2;


void setup()
{
Serial.begin(9600);

lcd.begin (16,2); // or (20,4)
// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);

lcd.createChar(0, seismic);
lcd.begin(16, 2);

}

void loop()
{
int reading= analogRead(sensePin);
Serial.println(reading);
reading = constrain(reading, minimum, maximum);
Serial.println(reading);
reading = map(reading, minimum, maximum, 0, 15);
Serial.println(reading);
lcd.clear();

for (int i=0; i <= reading; i++){
lcd.write(byte(0));

}

if (8<=reading){
lcd.setCursor(0, 1);
lcd.print("Earthquake");
delay(500);
}

delay(maxdelay);
lcd.clear();

}






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!


Parts:

Arduino UNO
Solid State Relay (SSR)
Himalayan Salt Light

Code:


int lightPin = 9;   
int randNumber;

void setup()  { 
  randomSeed(analogRead(0));
  pinMode(lightPin, OUTPUT);  

void loop()  { 
    randNumber = random(50, 254);
    analogWrite(lightPin, randNumber);   
    delay(randNumber*3);     
  } 


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 http://goo.gl/ZhOrrh

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 http://forum.arduino.cc/index.php?topic=154549.msg1850477#msg1850477
and
http://forum.arduino.cc/index.php?topic=154549.msg1850479#msg1850479

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 https://learn.adafruit.com/adafruit-4-channel-adc-breakouts


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

Adafruit_ADS1115 ads1115;

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Hello!");

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

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(adc0);
  Serial.print(" ");
  Serial.print(volt0, 4);
  Serial.println(" vdc");
  Serial.print("AIN1: ");
  Serial.print(adc1);
  Serial.print(" ");
  Serial.print(volt1, 4);
  Serial.println(" vdc");
  Serial.print("AIN2: ");
  Serial.print(adc2);
  Serial.print(" ");
  Serial.print(volt2, 4);
  Serial.println(" vdc");
  Serial.print("AIN3: ");
  Serial.print(adc3);
  Serial.print(" ");
  Serial.print(volt3, 4);
  Serial.println(" vdc");
  Serial.println(" ");

  delay(1000);
}

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?
http://goo.gl/WYD7m3
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()
{
  Serial.begin(9600);
  tempF = (1.8 * celsius) + 32;
  Serial.print(tempF);
}

void loop()
{
  
}



Original sketch with a function:

float celsius = 20;
float tempF = 0;

void setup()
{
  Serial.begin(9600);
  tempF = tempConvert(celsius);
  Serial.print(tempF);
}

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()
{
  Serial.begin(9600);
  tempF = tempConvert(celsius);
  Serial.print(tempF);
}

void loop()
{
  
}

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

tempConvert.cpp

// 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

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

float tempConvert(float celsius);  // function prototype

For more on creating libraries, see http://arduino.cc/en/Hacking/LibraryTutorial


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)