Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / General Electronics / Re: What am I doing wrong?? on: February 20, 2014, 02:50:47 pm
OK - SMD LED strips pull a significant amount of current.  Generally they are designed for 12v operation.

Why are you driving them with an Arduino????   

Arduino is 5V (or 3.3v) current sink capability is 40mA. 

You fried your Arduino!

2  Using Arduino / General Electronics / Re: where to get shield sockets with the extra long tails? on: February 20, 2014, 02:47:29 pm
These maybe?
3  Using Arduino / Programming Questions / Re: Stepper with limit switches and push button to start on: February 20, 2014, 10:53:53 am
I'm not familiar with the "easy driver" controller.

Most commercial stepper drivers have 3 control connections per motor


With these controllers,

STEP = the micro step set with dip switches on the controller, e.g. 400/800/1600/3200.... etc micro pulses per motor cog step. Your code generates a HIGH/LOW transition to create a pulse. The microsecond micros() delay determines the speed of the motor which is set according to the physics of the machine.

ENABLE = HIGH or LOW to release or engage the coil

Here's a code fragment as an example:

// ** This code controls two stepper motors connected through two commercial stepper
// ** motor controller boards.
// ** XdirPin : 7
// ** YdirPin : 10
// ** XstepPin : 6
// ** YstepPin : 9
// ** Xenable : 8
// ** Yenable : 11
// ************************************************************************************

//#define DEBUG
#define STOP 1
#define GO 0
#define CCW 0
#define CW 1

// these pins are associated with the controller hardware
int XdirPin = 7;
int YdirPin = 10;
int XstepPin = 6;
int YstepPin = 9;
int XenablePin = 8;
int YenablePin = 11;

// variables to hold pulse/position information
long Xposition;
long Yposition;
long XcurrentPosition = 0;         // todo: add limit switches and set arm to 0,0
long YcurrentPosition = 0;
long Xtarget;
long Ytarget;

// variables to hold motor controller information
long XmicroStepsPerRev = 1600;     // controller specific
long YmicroStepsPerRev = 3200;     // controller specific
long maxFrequency = 1500;          // tune this to achieve best speed, acceleration, deceleration
float controllerDutyCycle = 0.5;   // 0.5 = 50%

// variables to hold stepper motor information
int stepsPerRev = 200;           // e.g. 1.8 degrees per cog, motor specific
int motorPulseDelay = 390;       // microseconds - tune this to achieve the right speed without stalling the motor under load

// variables to hold drivetrain motion information
int travelPerRev = 85;           // in millimeters
int maxSpeed = 50;               // millimeters per second


// *******************************************************************************
void goToX(int Xtarget)
  int direction;
  digitalWrite(XenablePin, GO);
  #if defined DEBUG
    Serial.print("Xcurrent position : ");
  if(XcurrentPosition > Xtarget)
    digitalWrite(XdirPin, CW);  // go backwards
    direction = CW;
    //Serial.println("X Direction : CW");
  } else {
    digitalWrite(XdirPin, CCW); // go forwards   
    direction = CCW;
    //Serial.println("X Direction : CCW ");
  int Xmove = abs(XcurrentPosition - Xtarget);
  #if defined DEBUG
    Serial.print("Direction : ");
    Serial.print("Xmove : "); 
    Serial.print("Xtarget : "); 
  int Xsteps;
  for (Xsteps = 0; Xsteps < Xmove; Xsteps++)      // Iterate until target is reached
    digitalWrite(XstepPin, LOW);                        // This LOW to HIGH change is what creates the
    digitalWrite(XstepPin, HIGH);                       // "Rising Edge" so the controller knows to when to step.                                                    // This delay time is close to top speed for this motor
    if(direction == CW)
      XcurrentPosition -= Xsteps;                         
    } else {
      XcurrentPosition += Xsteps;   
  #if defined DEBUG
    Serial.print("X position at end of goToX: ======>");

..... etc ...................

// *******************************************************************************
void allStop()
  digitalWrite(XenablePin, STOP);
  digitalWrite(YenablePin, STOP); 
// *******************************************************************************
void allGo()
  digitalWrite(XenablePin, GO);
  digitalWrite(YenablePin, GO); 
4  Using Arduino / Project Guidance / Re: Control Arduino from Xively dashboard on: February 19, 2014, 12:18:13 pm
Thanks for the input !

Sounds like we are fairly close to matching those requirements - although the data admin side will need to wait for a while.

We are going to offer this to the non-commercial community with some obvious limits, such as update frequency, total storage space, etc.  Maybe we will offer a service with fewer limitations for a small monthly fee.

The plan is to make the interface open source so that developers can design apps to interact with the data. 
5  Using Arduino / Project Guidance / Re: Multiple sensor/display project on: February 19, 2014, 11:26:06 am
You don't "need" to use a complex  multi-wire connection to the LCD.  There are interface boards for that which use only 2 (I2C) or 3 (SPI type) wires.  That gives some flexibility on which pins you are working with.

For example I2C is available on A4/A5 and all I2C devices can share that wire, as long as they have unique addresses.

Similarly the Latch/Data/Clock wiring scheme allows the use of any pins to drive the LCD.

code example here:
// *****************************************************************************
// ** DHT + SPI demo code
// ** --------------------------------------------------------------------------
// ** Coding by:   Don Gibson
// ** Created:     April 17 2013
// ** Version:     1.5
// ** Last update: added DHT sensor  2013/04/19
// ** Modified by: DG
// ** This code is public domain, but please always include the original header
// ** in any subsequent copies
// ** Based on Adafruit sketch for I2C/SPI LCD backpack
// *****************************************************************************
// uses
// uses DHT11 humidity sensor (1)
// uses
// uses 20x4 SPI display
// uses CATkit (1)
// uses Kitten boards
// uses 1m, 5m, 20m CAT5 cables
// *****************************************************************************
 Demonstration sketch for Adafruit i2c/SPI LCD backpack
 using 74HC595 SPI expander
 ( )

 Uses DHT-11 temperature humidity sensor
 On the Leonardo, pins D2, D3 are I2C so don't use these for Adafruit's 'SPI' at the same time
  The circuit:
 * 5V to Arduino 5V pin
 * GND to Arduino GND pin
 * CLK to Digital 2 (or D8 )
 * DAT to Digital 3 (or D9 )
 * LAT to Digital 4 (or D10)

// include the library code:
//#include "Wire.h"
#include "LiquidCrystal.h" // this is the Adafruit LiquidCrystal library
#include "DHT.h"

#define DHTPIN 1              // what pin we're connected to

// Uncomment whatever type you're using!
#define DHTTYPE DHT11       // DHT 11
//#define DHTTYPE DHT22       // DHT 22  (AM2302)
//#define DHTTYPE DHT21       // DHT 21 (AM2301)

// Connect pin 1 (on the left) of the sensor to +5V
// Connect pin 2 of the sensor to whatever your DHTPIN is
// Connect pin 4 (on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor


// Connect via Adafruit 'SPI'. Data pin is #3, Clock is #2 and Latch is #4 on UNO
// Connect via Adafruit 'SPI'. Data pin is #9, Clock is #8 and Latch is #10 on Leonardo
// Relates to Kitten pins:  K2; K3; K1
LiquidCrystal lcd(9, 8, 10);

void setup() {

  // set up the LCD's number of rows and columns:
  lcd.begin(20, 4);
  // Print a message to the LCD.
  lcd.print(" SmartGreenHouse!");
  lcd.print("Using 'SPI' protocol");
  lcd.print("CAT5 cable upto 100m");

void loop() {
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a slow sensor)
  float h = dht.readHumidity();
  float t = dht.readTemperature();

  // check if returns are valid, if they are NaN (not a number) then something went wrong!
  if (isnan(t) || isnan(h)) {
    Serial.println("Failed to read from DHT");
  } else {
    Serial.print("Humidity: ");
    Serial.print(" %\t");
    Serial.print("Temperature: ");
    Serial.println(" *C");
  lcd.print("Temp: ");
  lcd.print (t);
  lcd.print("*C ");
  lcd.print(" RH:");
  lcd.print (h);

Project showing how to build a remote LCD display:
6  Using Arduino / Project Guidance / Re: Electronic valves project on: February 19, 2014, 11:06:49 am
We do this all the time with our irrigation systems.

You will need a 5v controlled relay ( and others have these)  an appropriate solenoid valve (   for example) and a power source for the valve via the relay.

Then its simply a matter of connecting the Arduino to the relay and writing the control sketch.
7  Using Arduino / Project Guidance / Re: Sound Reactive LED's using Electret Mic, MSGEQ7 and LM358N on: February 19, 2014, 11:00:15 am
Well the answer lies in how sensitive you need the system to be, to do the job.

While you can increase sensitivity - range, signal amplitude, frequency sensitivity, etc  you will also encounter increasing noise which then needs to be filtered out, and that can get very expensive.

You are on the right track with the op-amp which is a simple linear amp without filtering.  May I suggest:

and  a well tested ultra-sensitive circuit is here:

Have fun !
8  Using Arduino / Project Guidance / Re: Control Arduino from Xively dashboard on: February 19, 2014, 10:45:36 am
Yes we tried a few systems, but in most cases the support and reliability were not sufficient.

Xively kinda works. Documentation for the Arduino and the support of other datatypes in the stream is really not sufficient for our needs.  The Xively system does provide graphing which is nice, and there is a data logging ability (3 months I think) so for many applications it will do the job.

That said, we are probably a month away from completing a data collection/logging/mining application designed around XML with a PHP/mySQL back-end running on our small server farm. This allows both monitoring and control as well as conditional/automated events via the micro controller or any other web connected device.

When the time comes we will be able to offer that as a free service with open-source s/w for non-commercial users.

I would be interested in hearing from other potential users about the features that this system should offer.

Currently the XML dataset allows:

<SITE> Identification of the source location with geolocation details one site per XML file
  <DEVICE> multiple devices are possible, e.g. BeagleBone in Greenhouse A
    <SENSOR_ID>  multiple sensors per device with ID, Name, Type description, Datatype (Integer, Float, Long, Text, Boolean, etc), Data value, Data unit (Celsius, number, text, etc)
    <ACTUATOR_ID> multiple actuators per device with ID, Name, Type description, Datatype, Value to send, Data unit
  <ACTUATOR REPORT> multiple reports of the values of the actuator data. This can be controlled by any authorized device such as smartphones, PCs or other micro controllers. Can also be a separate XML file on a different computer/database.
    <ACTUATOR_ID> multiple actuators per device with ID, Name, Status, Datatype

<DEVICE_NAME>MEGA Ethernet ServerTest module</DEVICE_NAME>
    <SENSOR_NAME>DS18B20 on workbench</SENSOR_NAME>
    <SENSOR_NAME>Potentiometer on A0</SENSOR_NAME>
......... etc

    <SENSOR_NAME>RTC Clock on I2C (D20/21)</SENSOR_NAME>
    <SENSOR_VALUE>2014-2-19 7:47:59</SENSOR_VALUE>
    <ACTUATOR_NAME>Motor controller on pin D3</ACTUATOR_NAME>
9  Community / Products and Services / Re: Cats and Kittens Mark 2 for long distance connectivity over CAT 5 cable on: February 18, 2014, 12:10:20 pm
A note for those folks using the CAT5 shield with the Galileo....

Mount the board as usual, but DO NOT use the power jack on the CAT.  Only use the power jack on the Galileo because it requires a 5v supply. The jack from the CAT will supply power to VIN which may overheat the Galileo regulator and cause it to fail.

The Galileo will supply power to the CAT5 shield and cables as usual.

Otherwise we have seen no issues with the CAT5 shields or the Kitten system with the Galileo.

Enjoy !

10  Community / Products and Services / Re: Cats and Kittens Mark 2 for long distance connectivity over CAT 5 cable on: February 15, 2014, 03:48:54 pm
Yes, basically that's right.

In the picture you will see a CAT5 shield with 3 RJ45 jacks, mounted on top of an Ethernet shield.

The Ethernet shield uses pins 10/11/12/13 (SPI) and if the SD card is being used, pin 4 as well.  All the remaining pins are available over the CAT5 cable for sensors and actuators - i.e.  A0-A5, D0-D3 + D5, D6-D9 are all available if you are using an Ethernet shield.

I2C (IIC) and Dallas 1-Wire devices have a specific address and they can share a single pin (connection) among many devices.

If I understand your question correctly, all of your I2C sensors, and the display, could share a single CAT5 cable from the CAT5 shield, using the in-line Kitten boards to distribute the sensors. 

The Ethernet shield and it's cable are independent. You could also use a WiFi shield instead.

11  Using Arduino / Sensors / Re: Distance From Accelerometer ADXL345 on: February 03, 2014, 12:14:15 pm
Thats not really what this sensor is for.  It measures angular tilt and acceleration along the axes. If it is static i.e. on a table, or moving at a constant speed it will not tell you anything about the motion.

Maybe a GPS would be the solution for distance traveled?
12  Using Arduino / Sensors / Re: DS18B20 Not showing anything on: February 03, 2014, 12:10:58 pm
Look at this example with multiple sensors daisy chained

And you should use the pullup between signal and power unless using parasitic mode.
13  Using Arduino / Project Guidance / Re: interrupt question on: February 03, 2014, 02:17:09 am makes a nifty 6 channel debouncer board with a very reliable circuit and debounce times based on the combination of resistors and capacitors.

The basic kit has components for a 180ms delay but instructions are provided to change those times with alternative components.  Each channel can have a different debounce time if required.

14  Using Arduino / Project Guidance / Re: Would RF transmitters be feasible for wireless ‘judge’s boxes’? on: February 02, 2014, 07:09:41 pm
CAT5 cabling from each judge to the central receiver would be inexpensive and simple. 

Search for CATkit shields or CAT5 Shield under the Products and Services section of this forum.
15  Using Arduino / Project Guidance / Re: servo motors not working properly on: February 02, 2014, 07:05:26 pm
"..also using 2 DC motors..."

Um - how are you driving the motors exactly?  The Arduino will not be able to do that alone unless they are tiny pager motors.

Also DC brushed motors are extremely electrically noisy which can affect all downstream circuits.

Pages: [1] 2 3 ... 5