Tuesday, April 15, 2014

Arduino based SQL Queries

We are successfully performing SQL queries on two Arduino's, one in the US, one in Italy, inserting data into a HostGator hosted MySQL server. We are polishing a spiffy PHP / Ajax interface so you can see the results.

Here's a taste of what's going on:

void read_data() {

      sensorValue = analogRead(sensorPin);
      char buf[128];
      sprintf(buf, "INSERT INTO spspence_test_arduino.temp VALUES (%i)",
      Serial.println("Data read and recorded.");

void setup() {
  if (my_conn.mysql_connect(server_addr, 3306, user, password))
    Serial.println("Connection failed.");

void loop() {

Learn more by reading Beginning Sensor Networks with Arduino & Raspberry Pi by Charles Bell

Sunday, April 13, 2014

Arduino Internet Time Client

Added 12h/24h switch and Standard / Daylight Savings Time Switch! See steps 7 & 8.

Typically computers get their internal clocks adjusted by connecting to a Network Time Server (Internet or Local), using the Network Time Protocol (NTP). That functionality is also available to microcontrollers like the Arduino. We have put together an inexpensive and easy to follow instructable that will allow you to add official time keeping to a project. Have fun!


Tuesday, April 8, 2014

Add logging to your project for $2.50

A inexpensive way to start logging data from your sensors is with a SD Card. Although some shields come with onboard SD Slots, if you don't have one you can add it to your project for $2.50


This board is 5v & 3.3v friendly.

Examples and instructions for reading and writing to SD Cards can be found at http://arduino.cc/en/Reference/SD


CS 10 53
MOSI 11 51
SCK 13 52
MISO 12 50

Stay tuned for a number of upcoming SD Card logging projects!

Thursday, April 3, 2014

April Raffle - Temperature, Humidity, Barometric Pressure & Light Sensor Board

For April, we are raffling off a protoboard with a temperature, humidity, barometric pressure, and light sensor on board, with a RJ-45 connector for running a patch cord back to your arduino. Put this board in a clear vented project box outdoors and be a Citizen Scientist!

All participants will be sent code, full schematics and connection instructions.

Tickets are $5

See http://arduinotronics.blogspot.com/2014/03/weather-lcd-shield.html for more details on sensors and code!

Wednesday, April 2, 2014

Water / Chemical / Fuel level Sensors

eTape™ Continuous Fluid Level Sensor
The Next Generation of Liquid Level Sensor Technology

The eTape Liquid Level Sensor is a solid-state sensor with a resistive output that varies with the level of the fluid (liquid or powder).  It does away with clunky mechanical floats, and easily interfaces with electronic control systems.  
The eTape sensor's envelope is compressed by the hydrostatic pressure of the fluid in which it is immersed. This results in a change in resistance that corresponds to the distance from the top of the sensor to the surface of the fluid. The sensor's resistive output is inversely proportional to the height of the liquid: the lower the liquid level, the higher the output resistance; the higher the liquid level, the lower the output resistance.

eTape sensors can be manufactured in custom lengths to fit any application. Contact Milone Technologies if you have an application that requires specific length, configuration or output characteristics.  


Saturday, March 29, 2014

pcDuino, LAMP Server

Since I needed a mini LAMP (Linux / Apache / MYSQL / PHP) server, I dug out my older pcDuino for the job. There's a Ubuntu image available at http://www.pcduino.com/?p=1892.

pcDuino is a mini PC platform that runs a PC like OS such as Ubuntu and Android ICS. It outputs video through a HDMI interface. Moreover, newer versions have hardware headers compatible with Arduino.

All I need to get going is a >8gb Micro SD card for the image, and a 2amp 5v Micro USB power supply. Stay tuned as this project gets off the ground.

Friday, March 28, 2014

Why is Steve getting a Raspberry Pi?

I've been avoiding the Pi. I like the Arduino platform, and since I haven't been pushing the limits of the Arduino's capabilities, I didn't see the need for a Pi. Well. I need a SQL database server for my Arduino Sensor network, and the Pi can run MYSQL, so ..........

Raspberry Pi Rev B

Using mysql on a Raspberry Pi

Arduino to MYSQL

Beginning Sensor Networks with Arduino and Raspberry Pi

Monday, March 24, 2014

RFID Access Control

Need to identify a RFID card, and allow access to a controlled space? Maybe log the time and date when a user swipes their card?

Now you can with an inexpensive (<$10) RFID solution. Just supply a Arduino, and maybe a relay to control a door strike, or a real time clock module to log date and time with the card number and user name. 

We connected our RFID Module as follows:

RFID     Arduino
SDA      10
SCK      13
MOSI    11
MISO    12
IRQ       N/C
Gnd       Gnd
RST       9
3.3v       3.3v

We also connected the anode of a Red LED to pin 6 and the anode of a Green LED to Pin 5. Cathodes of each connect to a 330 ohm resistor and then to Gnd. Look in void loop() for the interesting bits.



Tuesday, March 11, 2014

Inexpensive Cross Band Repeater using 2 HT's

We had a successful run with the $30 RPT-2D repeater cable using two Baofeng HT's. One radio was set to talk on 446.000, the other was set to talk to our local repeater on 146.805. The cable links the mic/spk ports of the two radios. Had 6' of separation between the radio's to prevent the 2m side from locking in TX. Worked perfectly! See our review posted at http://www.radioddity.com/us/blog/rp2d

Sunday, March 9, 2014


We took the Neo-6M GPS module from a previous tutorial, added the LCD Rotary Encoder shield, and are displaying the GPS data (lon / lat, time / date, altitude, speed / heading) on the LCD. Turn the Rotary Encoder to display other "pages" of information. 

GPS Rx to Arduino pin 12
GPS TX to Arduino pin 11
GPS VCC to +5v
GPS Gnd to Gnd


Saturday, March 8, 2014

The Arduino LCD Clock

Lots of projects require a battery backed time and date display or stamp. In this project we took a SainSmart DS1307 RTC Module and connected it to a SainSmart UNO & LCD Shield. We are displaying the date and time on the lcd display.

Normally, on a lcd, if you print 35, then 7, you'll get 75, as the 7 slides to the left, and leaves the old digit. I'm using a if statement to detect if a number is less than 10, then inserting a 0 first. This maintains the placement. You can insert a space if you prefer.

We used a Real Time Clock library from Adafruit as the base project, and made our modifications to that.

To set the time, pull the battery from the unpowered clock module, reinsert it, and upload the sketch to the Arduino. The clock module will be set to your computers date and time at the time the sketch was compiled / uploaded.

The 4 connections necessary are:

+5vdc to RTC VCC
Gnd to RTC Gnd


You can add a relay, buzzer and alarm code to turn things on and off or notify you.

Tuesday, March 4, 2014

Weather LCD Shield

We took our LCD Keypad Shield, and added our Weather Shield that we used with the web server project. Now we have temperature, humidity, pressure, and more displaying on the LCD. Just press the buttons to see the various readings.


SainSmart RFID Sensors

I have a couple 13.56 mHz RFID modules coming for different projects I'm working on. One project is key-less entry for auto or home use, the other is for object tracking. A lot of fun for under $10.

Let us know what you would do with one of these in the comments, and we may send you one!

Monday, March 3, 2014

Image Recognition & Path Tracking

Ever wanted to do image recognition, and path tracking? You don't need expensive processor power or complicated programming. The Pixy recognizes color patterns, and can process 50 frames per second. It tells the Arduino what object it's tracking, and the x, y co-ordinates of that object. We have one coming this month, and will have several projects based on it. Read more ....

Screw Terminal Blocks, Great for any project!

I'm always trying to scrounge screw terminal blocks for various projects, and finally found my favorites. I use them on my prototype and permanent projects where temporarily sticking a sensor wire into a header is no longer appropriate. These are rated at 8amps up to 250v, so will work great with the many low voltage, low current applications we build. At $8 for 30 two pole blocks (that clip together for more poles) you can't go wrong!