Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 21
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
All today's birthdays', congrats!
Will (38)
Arlecchino (41)


Next birthdays
07/23 Will (38)
07/23 Arlecchino (41)
07/24 Jim_VE7UV (65)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: Tesla Coils
« Previous topic | Next topic »   

Arduino standalone MIDI interupter - Interference issues.

1 2 
Move Thread LAN_403
Doug86
Tue Nov 10 2009, 06:11PM Print
Doug86 Registered Member #2424 Joined: Tue Oct 06 2009, 08:02AM
Location:
Posts: 17
Hi all,

Ive writen an arduino sketch that reads MIDI data on the serial input and uses it to generate squarewaves of the apropriate frequency (it also uses the velocity byte to set the pulse width) and i'm using it as an interrupter on Audio:Deviant's coil.

This simple monosynth works perfectly on the bench but as soon as I power up the coil the midi line picks up so much interfearance that it disrupts the communication.

The midi data is being sent from my interface, over a short butchered midi lead, through a 4n25 optocoupler, to the arduino. I found good direction on midi>arduino here Link2

The arduino's signal is then inverted twice (as a kind of buffer) before being sent down a coax cable to the coil.

Ive tried grounding the shielding of the midi lead to AC ground with maybe slight improvement but still unusable. If I hard code a tune into the arduino (no midi control) then it plays fine and drives the coil nicely.

Ive seen on these foums that a few of you have run coils from midi before, how did you get round this issue?

Many thanks in advance.

Doug
Back to top
TESSiER
Tue Nov 10 2009, 07:28PM
TESSiER Registered Member #2453 Joined: Fri Oct 30 2009, 09:10PM
Location: Surahammar, Sweden
Posts: 3
I would go for fiber optics :)
Back to top
Goodchild
Tue Nov 10 2009, 07:46PM
Goodchild Registered Member #2292 Joined: Fri Aug 14 2009, 05:33PM
Location: The Wild West AKA Arizona
Posts: 795
Try moving the arduino far away from the tesla coil and also put it in a metal box and run it from an isolated power source such as a battery, and one last thing replace the coax with fiber.

also take a look at steves old setup Link2

Hope this helps.

Also if it's not to much to ask may I see your arduino code I have been working on almost the exact same thing for my DRSSTC and I am not the best at writing software.

Thanks

Back to top
Doug86
Tue Nov 10 2009, 08:34PM
Doug86 Registered Member #2424 Joined: Tue Oct 06 2009, 08:02AM
Location:
Posts: 17
Thanks guys,

The link between the Arduino and the coil is ok and rejects enough inteference to work (for the moment). We will eventually replace it with fiber.

If I hard-code a melody into the arduino it plays through the coil perfectly.

The problem I'm having at the moment is with the midi data into the arduino. The midi line is opto isolated from the arduino and coil so im not sure the fiber will have a massive advantage. We need to be able to connect an unmodified midi device to the system.

where should I be grounding the shield for the midi line?

I'll try running a longer coax so that the midi controller can be further away from the coil...

Goodchild, I'll post up the source code for you when I get home.
Back to top
plazmatron
Tue Nov 10 2009, 08:57PM
plazmatron Registered Member #1134 Joined: Tue Nov 20 2007, 04:39PM
Location: Bonnie Scotland
Posts: 351
Without a doubt, fiber optics is the way to go with these. Any amount of wire will act like an antenna, and cause all manner of badness with µC's, the worst being outputs that go high and stay high, killing FET's cry

My MIDI interrupters run on Arduinos too, but the signal is sent down Toslink to the DRSSTC's

I just showed a group of friends these musical coils the other day, so I'm still basking in the warm glow of extra geek points cheesey
Back to top
GeordieBoy
Tue Nov 10 2009, 11:16PM
GeordieBoy Registered Member #1232 Joined: Wed Jan 16 2008, 10:53PM
Location: Doon tha Toon!
Posts: 881
First of all, put the micro board in a metal box to shield it from radiated EMI. Once this is done, all you need to worry about then is conducted EMI...

From a conducted EMI point of view the micro box has at least two cables going into it: The MIDI cable from the MIDI master, and the cable coming from the TC. Both of these will pick up interference and carry it inside the micro's shielded box. If you are using an external power supply for the micro then this is a third cable that will also pick up EMI and carry it towards the micro. All potentially leading to either a software crash or corrupted MIDI data.

The MIDI cable already uses an opto-isolator so unless you are breaking down the isolation barrier with several kV, I would suspect that this cable is not the problem

That leaves the interrupter cable from the TC and the power connection. You can easily investigate the potential of conducted EMI down the power cable, by powering the micro from a battery inside its shielded box. If this works, then either stick with the battery power or put a filter, ferrite chokes etc on the power feed cable.

As for the cable to the TC, this is by far the most likely offender because it goes close to the operating TC's electric and magnetic fields. As others have suggested an optical fibre connection will almost definitely fix this problem for sure.

If you replace the cable from the micro to the TC with several metres of optical fibre, you can move the micro, it's power supply and all of the MIDI cabling well out of the interfering fields from the TC.

If you are set on sticking with a wired connection, then look at filtering. In particular use a tightly twisted pair, and wrap this wround some honking great big high-permeability ferrite cores at each end of the cable. These common-mode chokes at each end won't effect the wanted differential-mode signal from the micro to the TC, but they are just about as good as you can get for blocking common-mode interference going in the opposite direction!

Just some thoughts from someone who used to work in EMC approvals. Hope this helps,

-Richie,
Back to top
Avi
Wed Nov 11 2009, 01:39AM
Avi Registered Member #580 Joined: Mon Mar 12 2007, 03:17PM
Location: Melbourne, Australia
Posts: 410
TESSiER wrote ...

I would go for fiber optics :)
thats what i had to do, i used a toslink cable. However the receiver module may be difficult to work with. Also this needs to go in a metal box too.
Back to top
Goodchild
Wed Nov 11 2009, 01:52AM
Goodchild Registered Member #2292 Joined: Fri Aug 14 2009, 05:33PM
Location: The Wild West AKA Arizona
Posts: 795
Doug86 wrote ...

Goodchild, I'll post up the source code for you when I get home.

Thanks very much!

Back to top
Wolfram
Wed Nov 11 2009, 07:24AM
Wolfram Registered Member #33 Joined: Sat Feb 04 2006, 01:31PM
Location: Norway
Posts: 971
In addition to what the other posters here said, you might want to change your optocoupler for something more suitable.

I'll quote myself from an other thread:

I have also used common optoisolators for MIDI, but this has given me a lot of trouble. It seemed to be working well together with some MIDI controllers, but would not work, or only work intermittently with others. The recommended PC900/6N138 are darlington optocouplers, so they have a much higher current transfer ratio than common optocouplers. Common optocouplers will work fine together with stronger midi outputs, but with weaker ones it will work intermittently or not at all. I tried adding an external transistor to the optocoupler, to make it into a darlington, and while this improved the situation, it still only worked with about half of the devices I tested it with.

I suppose the low gain of the 4N25 could make it more noise-sensitive too. The typical current transfer ratio of the 6N138, which is the usual choice for MIDI, is 1100%. Compare this to 50% for the 4N25.


Anders M.
Back to top
Doug86
Wed Nov 11 2009, 01:05PM
Doug86 Registered Member #2424 Joined: Tue Oct 06 2009, 08:02AM
Location:
Posts: 17
Thanks to all, I've ordered the fiber optic and some 6n138s and will report back.

Here's the source code to my arduino although:

THIS VERSION HAS STILL GOT A BUG!!!!

Ive realised that if the pulse width is longer than the interupt timer i'm using then the interupt is missed and the frequency drops a little. this version works but produces notes that are out of tune at longer pulsewidths. I'll repost with a better version when I work out how to stop it.

Apologies for the messyness of my code but it's still work in progress :)

You need to install the MIDI library from here Link2 for this to work

I also used code from the "melody" example that comes with the arduino software.

EDIT : CODE REMOVED, PLEASE USE IMPROVED VERSION BELOW.
Back to top
1 2 

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.