Show Posts
Pages: [1] 2 3
1  Using Arduino / Displays / Re: Interfacing to a VFD29-2002I with Logic Controls board on: March 15, 2014, 12:27:59 pm
Hi raschemmel ... thanks for that reply.

I don't actually need (want) to stay with the DB9 connector since its just the arduino and the VFD display involved or my project, so I would prefer to just cut it off and then have the loose wires at one end and the Ethernet connector at the other that plugs into the circuit board.

Your link to the convert is good, thanks. I guess I could still use this; the cable I have is a DB9 female and that converter is also female. I'll look to see if a male version exists or else I could wire plug to plug.  On the other hand, now that this has pointed me to the MAX3232 chip, I could just get that and there seems to be plenty examples on using the chip alone in RS232 arduino circuit.

On the otherhand, a local used gadget shop has the same used VFD with Hitachi driver already on it, for $25, so I may jump wimp out and buy that. I spent long enough time on this project already, and I already have a LCD screen working with it. I just wanted a VFD instead because its for in my car and feel it would view better than the LCD would.

Thanks for the confirmation on the converter and direction. I'll consider my options here and see which way I want to go.

Cheers!
2  Using Arduino / Displays / Interfacing to a VFD29-2002I with Logic Controls board on: March 13, 2014, 11:41:16 pm
Hello,

I salvaged a 20x2 VFD (VFD29-2002I) from a cash register machine; this was used for the $amount display on a pole beside the cash registered. The VFD itself is mounted to a Logic Controls circuit board, model LD9-PD3-7), part of the LD9000 series I believe.

Here is a LD9000 user manual PDF for the Logic Controls pole unit, using the VFD: http://www.bematechus.com/web/Documents/LD9_UM.pdf

There is a cable that has a DB9F  connector at one end (to plug to computer) and the other is an 8-wire either-net type (phone jack) type plug that connects to the circuit board.

Page 11 of the LD9000 user manual indicates the pin layout of the DB9 connector (8 wire version):

1. DCD (tied to pins 4&6 )
2 TXD to PC
3 RXD from PC
3. DTR (tied to pins 1&6 )
4. Ground
5. DSR (tied to pins 1&4 )
6. RTS (tied to pin 8 )
7. CTS (tied to pin 7 )
8. NC

Questions ...

- Can the arduino UNO talk RS232 directly to this device (with libraries) or do I need to use ardware for RS232 conversion to TTL ?

- what does it mean (tied to pins 4&6) ?  Does this mean a wire jumpers pin 1 to both 4 & 6?

If anyone has general comments on strategy to use this VFD with my arduino I'd appreciate your feedback.

Thanks.
3  Using Arduino / LEDs and Multiplexing / Using ShiftPWM and TLC5940 libraries in same app? on: November 06, 2013, 06:33:42 pm
Hello,

I have my arduino project going in two parts. One part is using the public ShiftPWM library to runs multiple leds via output shift registers. The second part I have is running multiple servos via the TLC5940 PWM IC chip using the TLC5940 arduino library.

The problem I have is when I try to merge the two codes into one application. I believe one of them is interfering with the other in regards interrupts or timers???

If anyone is familiar with using these libraries, or ideally has gotten them both to operate together in the same application, I would very much like some tips to making them get along in same app.

Should one or the other be in SPI mode with the other is software?

Do they have interrupt and/or timer conflicts in their default configuration?

4  Using Arduino / Programming Questions / Registering I2C event in class file on: October 21, 2013, 04:12:40 pm
Hello,

Using two Uno's and I2C to communicate with each other, I have this working fine and doing as I want. But now I want to move the worker (slave) code from the sketch into my own class library.

What I want to do is remove all reference of Wire from the sketch and put it intomy class file source code. So in my class INIT() I have the Wire.begin(), which works, however I cannot get right how to register my own class method "receiveEvent()" in the Wire.onReceive(receiveEvent). I keep getting compiler errors.

In my class header I declare ...
public:
void receiveEvent (int howMany)

Then in the INIT() method of class source (ie. class called "MyClass").

Wire.onReceive(receiveEvent);    //this won't compile
Wire.onReceive(MyClass::receiveEvent);  //this won't compile

Sorry I don't have exact compiler error message with my, but its along the lines of "can't find method 'receiveEvent'", and/or no Wire.onReceive method found to match signature.

Anyone know how to declare your ISR events in your own class source file?

Thanks for any tips/comments.

Cheers,
Eric

5  Using Arduino / Project Guidance / Re: Feasibility guidance for a first project on: August 24, 2013, 10:02:09 pm
You said you want to put the arduino between the wall outlet and the motor. But since your original message said it was a small DC motor, I suspect your using a wallwart, thus your output power is really some low level DC voltage, and not 110 AC mains power.

Assuming low DC voltage, the components that you want to put together could be:

  • proximity sensor (google for a PIR motion sensor; sounds like you just need cheap short range sort)
  • an alternate approach to the motion detector would be infrared emitter and detector. If the cat enters a specific entrance way then you could setup the emitter/detector in break-beam manner to be the trigger; google for that circuit example
  • H-bridge to activate the motor, forwards or backwards; google a 754410. You run the wallwart DC power to the h-bridge, and use your arduino code to turn on/off or set forwards/backwards by talking to the h-bridge. The h-bridge runs the power to the motor, but your arduino controls the h-bridge.

It doesn't really need to be anymore complicated than that. Since you indicated your already programmer savvy, I'll leave programming the signal detect coding and h-bridge activation as well as timer control details to you. smiley

Hope that helps.
Eric
6  Using Arduino / Project Guidance / Re: What happens when I run out of space? on: August 24, 2013, 09:42:16 pm
Use parallel shift registers, something like 74HC595. You use 3 pins from the arduino and get in return 8 outputs. You can daisy chain multiple shift registers to each other ( get 8 outputs * numbers registers) without increasing your original 3 wires. And their cheap.
7  Using Arduino / Project Guidance / Re: Button programming issue on: August 24, 2013, 03:09:01 pm
Simple use a boolean variable, (call it ledState) in your program. Whenever you detect a button press, then if the boolean variable ledState is false then set it true, else set it false. At the same time, write HIGH or LOW to you led pin.

sample coding approach ...

Code:
if (button pressed)
  if (ledState)
  {  //led is already on, so turn it off
     ledState = false;
     digitalwrite(ledPin, LOW);
  }
  else
  {//led is already off, so turn it on
     ledState = true;
     digitalwrite(ledPin, HIGH);
  }


You will most likely quickly notice odd or erratic behavior when pressing the button and how the light sometimes goes on or off. Time then to google "button debouce".

8  Using Arduino / Project Guidance / Re: How would I efficiently control the speed and direction of 6 12v dc motors? on: August 24, 2013, 02:57:49 pm
The SN754410 is a nice H-Bridge that can run two motors, bi-directional, with breaking or freespin, and supports PWM. And at a couple$ each, their low cost.

The description says ...
The SN754410 is a quadruple high-current half-H
driver designed to provide bidirectional drive
currents up to 1 A at voltages from 4.5 V to 36 V.

If you use a single parallel shift output register (74HC595) then you can use 3 wires (digital high/low) from your arduino to run 8 output signals from the 74HC595 register. The 8 signals from the 74HC595 can be 8 on/off signals to 4 H-bridges (2 motors per bridge).

You can even, if your able to code it on the arduino, code PWM looping code that sends pulse signals to the 74HC595 which in turn pulses the h-bridge motors on/off to control speed.

If you need/want to monitor input signals (motion, light, water, temp, etc, sensors) to activate your motors, then you can use a 74HC165 input shift register (3 wires to arduino) to monitor for 8 input signals. Both the HC595 and HC165 support daisy chaining so you can increase the number of inputs/output signals to your arduino without changing the number of wires to the arduino.

So, 3 wires from your arduino to control 8 or more output signals (8 * number of HC595 chips). If you add the 74HC165 for input signal monitoring, then 6 wires total to do both input and output signals.

If you do just simple input signal on/off monitoring, and simple on/off output signals to start/stop motors, then the arduino coding is pretty straightforward, lots of examples to be found. If you needed to code the PWM, then that's more advanced coding.

I happen to be working and using on all these strategies on my current project, so I know they are all workable approaches.

Regards,
Eric
9  Using Arduino / Project Guidance / Re: Not another proximity question! Detecting objects around me. on: August 02, 2013, 04:33:44 pm
Interesting; along that lines I'm going to try a bank of ultrasonic "senders", programmatically controlling each one on/off in sequence. Thanks.
10  Using Arduino / Project Guidance / Not another proximity question! Detecting objects around me. on: August 01, 2013, 04:08:03 pm
Hello,

I've been reading up on various detection and proximity sensors, but I'm not getting clear handle on how I might go about a project.

If we have for example a movable vehicle (battery powered car), and I want to mount multiple detection sensors around the vehicle, what strategy(s) might work well to be able to tell if an object, or multiple objects, were straight in front of the car, or front left or front right, etc.

Simple object detection "out front" is too vague.  Also, have to consider multiple objects in the field of view.

Is there a sensor that can give feedback about objects in field of view and the relative angle/position from the sensor?

Imagine detecting table legs, or char legs.

Could multiple sensors, say on the front of the car, be used to section the total field of view into smaller sections. Would they then create "ghosts" responses to each other?

Just trying to get a handle on what type of sensors and/or strategy that would work well for this scenario.

Programming control of the sensors using the arduino is the assumption.

Thanks for any feedback and comments.

Cheers,
Eric
11  Using Arduino / Programming Questions / Re: Building new library, header, and other library on: April 09, 2013, 02:46:50 pm
FYI ... I've resolved my issues.

As PaulS suggests, the executable code in the TLC5940 header was largely the issue.  I've moved the TLC library out of the core arduino structure and into "my documents" arduino/library folder tree. I then modified the tlc header to contain just the prototypes and moved the code/functions into the TLC class itself in the main .cpp source.

Now with my own library files in my documents/arduino/library, along with TLC in its own mydocuments/arduino library folder, the includes work cleanly without having to specify the full path, and it all compiles with no errors.

Thanks for the feedback.
Cheers,
Eric
12  Using Arduino / Programming Questions / Re: Building new library, header, and other library on: April 06, 2013, 06:50:18 pm
ok, so from your reply#2 I'm getting the jist of the issue; not being able to include a 3rd party lib into another lib. However from PaulS response, "it CAN be done", so I'm still looking.

Perhaps I will try and extract the  TLC routines I need out and put them into my lib, or else embed my routines into the tlc lib.
13  Using Arduino / Programming Questions / Re: Building new library, header, and other library on: April 06, 2013, 11:32:26 am
Drats! The "TTCS - Copy.cpp" is a copy of my source library left in the library folder. I created it when I was preparing the source for upload here. It's not the original reason for the errors, it only added a couple more  smiley-red

Anyways, removed the "copy", using the same source as listed above, and these are the errors.

TTCS\TTCS.cpp.o: In function `tlc_angleToVal':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:113: multiple definition of `tlc_angleToVal(unsigned char)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:113: first defined here
TTCS\TTCS.cpp.o: In function `tlc_valToAngle':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:122: multiple definition of `tlc_valToAngle(unsigned int)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:122: first defined here
TTCS\TTCS.cpp.o: In function `tlc_getServo(unsigned char)':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:106: multiple definition of `tlc_getServo(unsigned char)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:106: first defined here
TTCS\TTCS.cpp.o: In function `tlc_setServo(unsigned char, unsigned char)':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:99: multiple definition of `tlc_setServo(unsigned char, unsigned char)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:99: first defined here
TTCS\TTCS.cpp.o: In function `tlc_initServos(unsigned char)':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:76: multiple definition of `tlc_initServos(unsigned char)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:76: first defined here


So from PaulS comment ..."Tlc5490 is NOT a core library, and has no business in the core library folder." ... is that a problem or just a complaint? And what does it mean, not being in the "core library" folder. I'm starting to suspect there's a user library folder I should be using?
14  Using Arduino / Programming Questions / Re: Building new library, header, and other library on: April 05, 2013, 09:54:39 pm
Ok, here is my source then. Thanks for looking.

I actually removed all the code from the .cpp functions to make it smaller and easier to read; it does not affect the issue of trying to get it to compile.

For new readers, here is the issue. I've trying to setup my own library to include the TLC5940 library and make calls to the TLC5940 routines from my .cpp library source. I don't need to access the TLC routines from the sketch.

As it is now, trying to compile the code below will spit out a bunch of "multiple define" errors.  As you can see in each of my files below, I have the includes present and commented out where I was trying different combinations.

Here is a sampling of the errors; the real list is about 4 times longer.

TTCS\TTCS - Copy.cpp.o: In function `tlc_angleToVal':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:113: multiple definition of `tlc_angleToVal(unsigned char)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:113: first defined here
TTCS\TTCS - Copy.cpp.o: In function `tlc_valToAngle':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:122: multiple definition of `tlc_valToAngle(unsigned int)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:122: first defined here
TTCS\TTCS - Copy.cpp.o: In function `tlc_getServo(unsigned char)':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:106: multiple definition of `tlc_getServo(unsigned char)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:106: first defined here
TTCS\TTCS - Copy.cpp.o: In function `tlc_setServo(unsigned char, unsigned char)':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:99: multiple definition of `tlc_setServo(unsigned char, unsigned char)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:99: first defined here
TTCS\TTCS - Copy.cpp.o: In function `tlc_initServos(unsigned char)':
C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:76: multiple definition of `tlc_initServos(unsigned char)'
TTCS.cpp.o:C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940/tlc_servos.h:76: first defined here


Here is my sketch:
Code:
boolean debugPrint = false;

//#include "C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940\Tlc5940.h"
//#include "C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940\tlc_servos.h"
#include <TTCS.h>

TTCS Ttcs = TTCS();

void setup() {
}

void loop()
{
   Ttcs.loop();
}

Here is my library header (TTCS.h):
Code:
#ifndef TTCS_H
#define TTCS_H

#include "Arduino.h"
//#include "Tlc5940.h"
//#include "tlc_servos.h"

//had to code full path so compliler would stop complaining about files not found
#include "C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940\Tlc5940.h"
#include "C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940\tlc_servos.h"

#define SERVO_PULSE_WIDTH_USEC   5
#define SERVO_DELAY_TIME      20

#define NUMBER_OF_SHIFT_OUT_CHIPS   2
#define NUMBER_OF_SHIFT_IN_CHIPS   2

struct TTCS_ITEM {
int     signalPin;
boolean triggered;
int     pairedIndex;         
long    lastTriggered;       
int     switchPin;           
byte    switchDirection;     
byte    flipTrackDirection;   
};

class TTCS
{
  public:
  int shin_ploadPin;
int shin_dataPin ;
int shin_clockPin;


int shout_clockPin;
int shout_latchPin;
int shout_dataPin;

byte shiftOutData[NUMBER_OF_SHIFT_OUT_CHIPS];
byte shiftInData[NUMBER_OF_SHIFT_IN_CHIPS];

int overRidePin;

long lastLedPulse;
long ledPulseDelay;

unsigned long motorFrequencyStart;
unsigned long motorFrequency;
unsigned long motorDutyCycle;
unsigned long lastMotorOnCycle;
unsigned long lastMotorOffCycle;
unsigned long motorRunningOn;
unsigned long motorRunningOff;

long lastPulseChange;
long lastAnalogRead;

boolean servoAngleRising;
long lastServoPulse;
long servoPulseDelay;
int servoAngle;
   
    TTCS();
void loop();
void addItem(TTCS_ITEM *newItem);

  private:
int  pulseWidth1;
void pulseLeds(void);
void pulseMotor(void);
void pulseServos(int servo, int angle);
void writeShiftOutData();
void readShiftInRegs();
};

#endif


And here is the stripped down library .cpp source file (TTCS.cpp):

Code:
#include "Arduino.h"

#include "TTCS.h"
//#include "C:\Program Files (x86)\arduino-1.0.3\libraries\Tlc5940\tlc_servos.h"

// Constructor /////////////////////////////////////////////////////////////////

TTCS::TTCS()


       //this is the only call so far in the code that makes reference to the TLC library.
       //Note: I will get the compiler errors with or without this line, so its not the cause of the compile errors.
       tlc_initServos();         

shin_ploadPin           = 11; 
shin_dataPin            = 12;
shin_clockPin           = 13;

shout_clockPin          = 6;
shout_latchPin          = 5;
shout_dataPin           = 4;

overRidePin              = 2; 

lastLedPulse = 0;
ledPulseDelay = 1000;

motorDutyCycle   = 50000;
lastMotorOnCycle   = 0;
lastMotorOffCycle   = 0;
motorRunningOn =1;
motorRunningOff =0;

lastAnalogRead =0;

servoAngleRising   = true;
lastServoPulse =0;
servoPulseDelay   = 20;
servoAngle = 0;

pinMode(shout_latchPin, OUTPUT);
pinMode(shout_clockPin, OUTPUT);
pinMode(shout_dataPin, OUTPUT);

shiftOutData[0] = 0;
shiftOutData[1] = 255;

lastPulseChange = millis();
motorFrequencyStart = micros();
motorFrequency = 50000;

bitSet(shiftOutData[1],6);
bitClear(shiftOutData[1],7);
}

// Public Methods //////////////////////////////////////////////////////////////

void TTCS::loop()
{

}

void TTCS::addItem(TTCS_ITEM *newItem)
{
}


// Private Methods /////////////////////////////////////////////////////////////

void TTCS::pulseLeds()
{
}

void TTCS::pulseMotor()
{
}

void TTCS::pulseServos(int servo, int angle)
{
}

void TTCS::writeShiftOutData()
{
}

void TTCS::readShiftInRegs()
{
}

15  Using Arduino / Programming Questions / Re: servo coding on: April 05, 2013, 04:16:09 pm
I may be a bit late to this party, but ... in your original post you state you want to use a push button to control on/off of the servo, yet you have not code referencing any push button. Or perhaps that's your point ... you don't know where/how to do it?

Taking zoomkat's example and perhaps just simplifying it, just do digital read on a pin with the pushbutton connected. When/while the button is LOW then run your existing code to read the pot, map, and move servo.

You might need to wire a pull-down on the button to make sure its low when not pushed; or try zoomkats trick of writing high to the pin (never done that myself).

Ex.

Code:
#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo
 
int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin
int button1 = 4;
 
void setup()
{
  pinMode(button1, INPUT);

  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
 
void loop()
{
  if (digitalRead(button1) == LOW)  //if button is not pressed then read pot and run servo
  {
    val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)
    val = map(val, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180)
    myservo.write(val);                  // sets the servo position according to the scaled value
    delay(15);                           // waits for the servo to get there
  }
}
Pages: [1] 2 3