• Ok, so writing the data is a bit more interesting. I just tried and something like this should work:

    var data = new Uint8Array(64); // you don't have to send all 512 bytes if you don't want to
    Serial1.setup(250000,  {tx:B6,bytesize:8,parity:'none',stopbits­:2});
    // ...
    
    function sendPacket() {
      // Do the Mark after Break
      digitalWrite(B6,0);
      pinMode(B6, "output"); 
      pinMode(B6, "af_output");
      // Send data
      Serial1.write(data);
    }
    
    setInterval(sendPacket, 100);
    

    The timing isn't spot on, but I think it should be good enough for most DMX receivers.

  • Thanks @Gordon.

    I guess I will have to experiment to find out what sort of input the emitter expects, I have a feeling that using:

    Serial1.write([255,255,255]);
    

    is not going to yield the same results as the RGB strips, I am sure DMX will be more complicated than this?

  • It totally depends on the lights. My understanding is that each entry corresponds to a slider. You usually set the lights up with DIP switches so that they know what their DMX start index is I think.

    I guess a simple DMX RGB light would work exactly like you expect. Once you find the correct start index you'll get R, then G, then B :)

  • Ok, well I will do a learning experiment and let you know the results.

  • @gordon well I blew up my emitter!

    A capacitor exploded in the emitter while I was testing the DMX signal, it didn't simply pop its top, it blew in to pieces!

    I am not sure if it was a fault with the emitter or if the DMX shield sent enough current to overload the capacitor, I tested it with tx to tx first, and was not seeing any results, so I switched it over to RX on the shield, was playing around in the IDE and BOOM.

    When I measure the pins in the DMX shield it seems to be putting out half a volt consistently flowing from the bottom pin to each of the top pins (3 pin DMX) while plugged into RX on the shield

    When plugged into TX on the shield it reads .08v flowing in the other direction.

    I cant seem to measure any amps when I test with the multimeter in either configuration however, which seems weird to me, though I am no electronics guru.

    Think it was the negative voltage flow that killed it? I would be cautious to try again as these emitters are not cheap.

    It is a pity that DMX shield has no documentation, otherwise it would not be such a guessing game.


    2 Attachments

    • 20150623_130320.jpg
    • 20150623_130407.jpg
  • By emitter, you mean the actual DMX light?

    Personally, I'd say that was a faulty light and you should try and get it replaced. Is it possible the light was meant for 110v systems and you were running it on 220v? Hard to tell from the picture but it looks like the capacitor is either in the power supply, or the circuitry that drives the light itself.

    Thing is, DMX is just a communications system - it shouldn't be supplying any power down the DMX lines - see what wikipedia says.

    To test it's working, you really need an oscilloscope (even if it's only a cheap hand-held one) put between pins 2 and 3. When it is outputting data you should see some signals coming out of it.

    You shouldn't be able to send anything down DMX that'd blow up the light though - that's just crazy. So as far as the wiring on the DMX shield goes, it'll either work or it won't depending on the wiring - although I wouldn't recommend keeping it powered up in the 'not working' state for long at all, as the Espruino and DMX shield will be fighting each other - both trying to output different voltages on the same wire.

  • Sorry I have been away, I am back on the project now with only a couple of weeks to get this done.

    I have had a hell of a time trying to solder the small pins at the end of the pico, I am sure there is a secret to it, I just have not worked it out yet.

    I will add to the thread soon

  • I have had a hell of a time trying to solder the small pins at the end of the pico, I am sure there is a secret to it, I just have not worked it out yet.

    Solder them down to a board (ie, use them like castellated pads) and they go down easy. Might need a bit of flux, though I don't think I've used it when I put Espruino Picos onto my protoboards. ( https://www.tindie.com/products/DrAzzy/e­spruino-pico-protoboard-discount/ )

    If you're putting pins/wires into them, it's not much harder than a normal soldering job, as long as you've got an iron with a reasonably fine point. You may have to shave the plastic around the pins down.

  • I guess the other solution is to use some kind of ribbon cable (which generally have a 0.05" pitch) - however stripping/soldering those is a pain too.

    You could also do some serious pin-bending on some 4x2 0.1" pin header, and then solder it onto the end of the board - however that'd be more of a pain to do initially.

  • That's a good point on ribbon cable. Ribbon cable is actually not bad to strip. Put it on table, gently press razor onto it, through the insulation, but not through the copper. Flip, and do it again, then pull the insulation off the end (it should come off pretty easily now)

  • Nice idea - I'll have to try that.

    @Rek - In fact, if you search eBay for 'dupont jumper' you'll get ribbon with pins or sockets on the end. If you cut that, stripped it as @DrAzzy says, and soldered it on the end, you could easily get 0.1" pins.

    ... however I'd hotglue over the end - flexing of solder joints to the thin cables can cause them to break in no time.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Distance - Color RGBLED + Distance sensor HC-SR04 (having strange results)

Posted by Avatar for Rek @Rek

Actions