Show Posts
Pages: [1] 2 3 ... 19
1  Using Arduino / Networking, Protocols, and Devices / Re: Z-OSC Library and Seeeduino Ethernet Shield Communication Issues on: Today at 11:05:21 am
The first thing to know about TouchOSC is that it only sends and receives float values.

In general, however I would not work with the Z-OSC library.
I'd recommend using Oscuino, which is the Arduino OSC library created and actively maintained by the inventors of the OCS protocol at CNMAT :  https://github.com/CNMAT/OSC

I am not at my computer at the moment but can post some code later how to get that to work with TouchOSC.

Edit: I just checked the Seed Studio website. It appears that they have a Ethernet Shield V1 that hosts the Wiznet W5100 Ethernet chip and a V2 that hosts the W5200 Ethernet shield. Which one do you have ?
Both work, but the W5200 is much more performant. It depends on what you want to do if that's an issue. Based on my experience with both chips for TouchOSC it won't make a difference.

I use TouchOSC to remote control my lighting systems (see sig)
2  Using Arduino / Networking, Protocols, and Devices / Re: Arduino Ethernet Bonjour / ZeroConf Networking Library on: August 09, 2014, 10:50:51 pm
Good to hear! Thanks for the feedback!
3  Using Arduino / Networking, Protocols, and Devices / Re: Controlling Arduino with iPhone on: August 04, 2014, 09:30:39 pm
Yes, WiFi in general is very power hungry. Much more so than Bluetooth for example.
Unfortunately Apple is rather restrictive in what they allow the maker community to do with Bluetooth.
4  Using Arduino / LEDs and Multiplexing / Re: Fading an RGB LED on and off on: August 04, 2014, 09:23:32 pm
Here's a link to a forum thread where 12 bit PWM is discussed.
Few clarifications on some of the remarks in that thread.

12 bit make a lot of sense if you want a visually linear fading experience. If you want to fade really slowly all the way to compete darkness you may need 16 bit in order not to see steps at the very lowest light levels. Naturally the speed of fading makes a difference. Oddly enough I've never anyone seen mention it.

The response of the human eye to brightness is only coarsely logarithmic. More precisely it follows the CIE lab color model.
5  Using Arduino / LEDs and Multiplexing / Re: Fading an RGB LED on and off on: August 04, 2014, 08:52:24 pm
Here is an early version of a 3D Bresenham algorithm I used for testing:

Code:
 /* find maximum of a and b */
#define MAX(a,b) (((a)>(b))?(a):(b))

  /* absolute value of a */
#define ABS(a) (((a)<0) ? -(a) : (a))

  /* take sign of a, either -1, 0, or 1 */
#define ZSGN(a) (((a)<0) ? -1 : (a)>0 ? 1 : 0)


uint8_t r1, g1, b1, r2, g2, b2;

void setup()
{
  Serial.begin(9600);
  
  r1=0; g1=0; b1=0;
  r2=0; g2=0; b2=0;

}


void line3d(uint8_t x1, uint8_t y1, uint8_t z1, uint8_t x2, uint8_t y2, uint8_t z2)
  {
    int xd, yd, zd;
    int x, y, z;
    int ax, ay, az;
    int sx, sy, sz;
    int dx, dy, dz;

    dx = x2 - x1;
    dy = y2 - y1;
    dz = z2 - z1;

    ax = ABS(dx) << 1;
    ay = ABS(dy) << 1;
    az = ABS(dz) << 1;

    sx = ZSGN(dx);
    sy = ZSGN(dy);
    sz = ZSGN(dz);

    x = x1;
    y = y1;
    z = z1;

    if (ax >= MAX(ay, az))            /* x dominant */
    {
      yd = ay - (ax >> 1);
      zd = az - (ax >> 1);
      for (;;)
      {
        goToRGB(x, y, z);
        delay(15);
        if (x == x2)
        {
          return;
        }

        if (yd >= 0)
        {
          y += sy;
          yd -= ax;
        }

        if (zd >= 0)
        {
          z += sz;
          zd -= ax;
        }

        x += sx;
        yd += ay;
        zd += az;
      }
    }
    else if (ay >= MAX(ax, az))            /* y dominant */
    {
      xd = ax - (ay >> 1);
      zd = az - (ay >> 1);
      for (;;)
      {
        goToRGB(x, y, z);
        delay(15);
        if (y == y2)
        {
          return;
        }

        if (xd >= 0)
        {
          x += sx;
          xd -= ay;
        }

        if (zd >= 0)
        {
          z += sz;
          zd -= ay;
        }

        y += sy;
        xd += ax;
        zd += az;
      }
    }
    else if (az >= MAX(ax, ay))            /* z dominant */
    {
      xd = ax - (az >> 1);
      yd = ay - (az >> 1);
      for (;;)
      {
        goToRGB(x, y, z);
        delay(15);
        if (z == z2)
        {
          return;
        }

        if (xd >= 0)
        {
          x += sx;
          xd -= az;
        }

        if (yd >= 0)
        {
          y += sy;
          yd -= az;
        }

        z += sz;
        xd += ax;
        yd += ay;
      }
    }
  }


void loop()
{
  int rand;
  rand = random (1, 4);
  
  if (rand==1) { r2=255;} else { r2= random(0, 256);};
  if (rand==2) { g2=255;} else { g2= random(0, 256);};
  if (rand==3) { b2=255;} else { b2= random(0, 256);};
  
  line3d(r1, g1, b1, r2, g2, b2);
  
  r1=r2;
  g1=g2;
  b1=b2;
}

It will not compile out o the box. You have to replace gotoRGB(x,y,z) with your own function that sets the LED color. Ive used this early on to test on my High Power RGB LED shields. When trying to get a linear dimming effect you will get visible stapes when going through the lower values. 8-Bit is just not enough to make that happen.

I believe however there is a way - although only for on pin IIRC - to get that to a higher PWM resolution even on an Arduino Uno. You may have to google around to find that.
6  Using Arduino / LEDs and Multiplexing / Re: Fading an RGB LED on and off on: August 02, 2014, 09:04:01 am

But first things first, let's get that LED dimmed without the color shifting noticeably.

That can be quite a difficult task!

1. As suggested before you could employ an algorithm that draws a line through a 3-Dimensional space, with the three axis being the three colors. An algorithm that does this very effectively with integer math is the bresenham algorithm as it only deals with integer arithmetic. So google 3D Bresenham and adapt the code fragments to work on an Arduino.
That will allow you to draw a line through a rasterized 3D space. so on an Arduino that would be a 256 x 256 x 256 large space.

This will allow you to smoothly fade from any given coordinate to zero, without any color dropping out too early. If thats what you are trying to accomplish I can dig out work I've done to get that accomplished.

2. However, the algorithm above will NOT keep the color consistent. That is difficult to do in the RGB coordinate system. In order to keep the color consistent in terms of Hue and saturation you'd have to adapt a HSV (Hue, saturation, Value) color model. You'd fade down the Value to dim the LED while keeping the color constant. Well, more or less. the non-linearity explained earl will come into play here as well and can further complicate the situation. I've got code for that a well.
7  Using Arduino / Networking, Protocols, and Devices / Re: Controlling Arduino with iPhone on: August 01, 2014, 10:34:17 pm
You can connect an Ethernet shield to the Arduino and then connect a little WiFi pocket router like the TPLink TL WR702n (or 703n) to the Ethernet Shield. the T Router has the ability to function and an AP so you can connect to it directly from the iPhone without needing a router.
If the solution needs to be small then you could use a CC3000 (WiFi) breakout board or shield e.g. from Adafruit (http://www.adafruit.com/product/1491). That however will require a router to connect through.

On the iPhone side you could use TouchOSC (http://hexler.net/software/touchosc). You can create your own interface on the PC (or mac) that defines what OSC messages you want to send and receive and then upload the interface to the TouchOSC app on the iPhone.
On the Arduino side you'd use the Oscuino library (https://github.com/CNMAT/OSC)

I use a Teensy 3, with WIZ820io for Ethernet connected to a TPLink WR702n for WiFi and Oscuino and Touch OSC on the iPhone. I know that works and is not just wild theory ;-)

I am looking forward to a complete description of your project!
8  Using Arduino / LEDs and Multiplexing / Re: Fading an RGB LED on and off on: August 01, 2014, 10:01:03 pm
The limitation to 8-bit PWM or 256 steps only applies to the Arduino boards. The Arduino compatible Teensy 3.x boards have 16 bit PWM pins and the PWM frequency on those is easy to modify and allows a greater range than what you'd find on a normal Arduino. http://www.pjrc.com/teensy/index.html

The reason for the large visible "steps" in brightness can be attributed to the low 8-bit PWM resolution.
The fact that a step from say 210 to 211 does not result in a visible step, but a change from 4 to 5 is clearly visible is explained by the non-linear response of the human eye to brightness. It describes approximately a logarithmic curve or more precisely the CIE lab curve. The human eye is more sensitive at low light values.

All this can be taken care of by fancier hardware and algorithms.
9  Using Arduino / LEDs and Multiplexing / Re: Lost with 50w LEDs + PWM on: June 28, 2014, 03:44:15 pm
A couple more questions:
1. how many of these LEDs are you going to use and how far are these apart ?
2. If you are going to use this on a boat, will this ultimately below the water line or will it be installed in a dry area ?
10  Using Arduino / LEDs and Multiplexing / Re: Lost with 50w LEDs + PWM on: June 27, 2014, 09:34:19 pm
You will need two power supplies, one for the Arduino and a separate one or the LED shield. The LED shield would receive the output from your boats battery that is stepped up by the boost converter you have referenced before.

The boost converter has a 32-35 V output and that is within the range of input voltage (6V-39V) the shield can take.
It is also higher than the forward voltage Vf of the LEDs. Good!

You don't need to set a constant voltage for the LED as LEDs are constant current devices. You will need to set the constant current. That particular shield allows three different constant currents 0.35A, 0.7A and 1A. The voltage that drops across the LEDs will change as they get hot during operation, but the current will remain constant.

Speaking about the LEDs getting hot. Do not operate these 50W monster LEDs before you have mounted them to a massive heat sink!

I would have to make one disclaimer though. I have not worked with that particular shield but with the very similar 1-channel version of that LED driver which has a smaller input voltage range. https://www.tindie.com/products/Conceptinetics/6-channel-led-shield-for-arduino-035-07-1a/?pt=directsearch
Also that shield is directly driven by the Arduino's PWM pins and if I understand the one review on Tindie correctly it does not come with any documentation. Also the Arduino pins only do 8-bit dimming so 256 steps. for Very slow, smooth dimming that's too little.
11  Using Arduino / LEDs and Multiplexing / Re: Lost with 50w LEDs + PWM on: June 26, 2014, 07:57:32 pm
To answer the original question of how the pt4115 drivers work, they are constant current, switched power supplies.
The constant current is set by means of a selecting a specific value for the current sense resistor. Some of these drivers have a selection of several of these on board and the selection happens by means of solder jumpers.

There are a few interesting boards on Tindie.com that are possibly better than the small single channel ebay drivers linked in this thread:

https://www.tindie.com/products/RobG/20w-rgb-led-driver-pcb/?pt=directsearch
https://www.tindie.com/products/Conceptinetics/4-channel-pwm-high-power-led-shield-for-arduino-035-07-1a/?pt=directsearch
https://www.tindie.com/products/Conceptinetics/6-channel-led-shield-for-arduino-035-07-1a/?pt=directsearch
12  Using Arduino / LEDs and Multiplexing / Re: Lost with 50w LEDs + PWM on: June 25, 2014, 07:36:23 pm
I am assuming you are referring to the pt4115 drivers available from ccc suppliers (cheap Chinese crap  smiley-grin ) on eBay.
These drivers are essentially a constant current switching power supply in buck configuration, meaning that the input voltage must be higher than the output voltage.
If you rapplication requires a higher output voltage (28V) than input voltage(12V) you need a boost configuration.
However, assuming by how you asked the question that you don't know too much about LED drivers, why don't you post your application and then we can see what alternatives are available ?
13  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino Nano + ENC28J60 + MQTT on: June 12, 2014, 08:45:18 pm
Were you going to post more detail so we would have an idea of what you a even hoping to accomplish ?
14  Using Arduino / Networking, Protocols, and Devices / Re: communication for small robotics projects on: June 01, 2014, 04:06:19 pm
Hi

I am wanting to get to arduinos to communicate with each other. I have heard of i2c and pwm signal and that pwm can be transmitted from an fm transmitter. What is the best communication method for wired and wireless communication. I have heard of xbees and other wireless communication modules but would like to build my own transmitters and receivers. Also if any one could explain to me how i2c and pwm SIGNAL work it would be appreciated.

Any help will appreciated.

How about you try to google some of that stuff. Do some homework. When you have more specific questions come back and ask!
15  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet and OSC on: May 14, 2014, 09:17:45 pm
The matter of fact is that  simply don't know whether a non-W5199/W5200 based Ethernet Shield will actually work at all. the danger is that you possibly spend weeks debugging something that at this time you don't have the necessary expertise to do so and then still are left with a non-working project.

Currently I can get a W51000 Ethernt Shield at Newegg for $10.34 http://www.newegg.com/Product/Product.aspx?Item=9SIA3M11D05490&nm_mc=KNC-GoogleMKP&cm_mmc=KNC-GoogleMKP-_-pla-_-Switches-_-9SIA3M11D05490&ef_id=YktOnEINaVUAAA0x:20140515015650:s Actual availability and pricing depends on where you live.

You mentioned that you have the three  receiving computers connected via wireless  LAN (I assume WiFi). Do you have the computers connected through a WiFi Access Point / Router ?
How would you want your Arduino to connect to the WiFi LAN? Per Ethernet Cable ?

Another thing you may want to do is to post your existing Arduino Code (in code prackets please. Use the # button above to do so.)

In general for my projects I don't use original Arduinos anymore as there are fully compatible, less expensive, more powerful and smaller product available with the Teensy boards http://www.pjrc.com/teensy/index.html
Pages: [1] 2 3 ... 19