jejt / jmons

Engineering Tommorrow

Category Archives: Electronics

Hissing Noise from Speakers Fixed


So recently a friend at work (the esteemed DJ Hedflux) had a problem with his speakers – he has a pair of powered speakers, and he outputs sound down a normal stereo cable into the speakers. Being a professional DJ, nothing in his system is particually cheap (he’s not spending £100 on cables, but he’s not buying £1.50 speaker modules from the market) so we can quickly rule out shoddy work and bad connections inside of the devices.

Anyways, he worked out that it was a combination of his computer and his touch lamp causing it – doing things on his computer that required lots of processing, and having the dimmer lamp “dimmed” caused the noise to appear and dissapear.

This is very common, and also, very easy to fix.

How to fix:

Ferrite ring filter

The solution is very simple, and very cheap. You’ll need a ferrite ring, which you wind the audio cable in just a couple of times, like in the above picture.

Maplins sell these for a couple of pounds, usually find them in the Radio section:

http://www.maplin.co.uk/Module.aspx?ModuleNo=29788

Image stolen from http://www.gbrcaa.org/ntoa/Filters,%20Chokes%20and%20OIs.htm on which site you can also find more information about other kinds of chokes.

The science:

In Hedflux’s case, its possible that his computer internals arn’t all grounded to the case correctly, or the case to the power supply, so its generating more electrical noise then ideal. The dimmer lamp however is a common source of Electromagnetic Interferance (EMI).

Because he’s using a set of powered speakers, the loudspeaker cable is acting as an antenna, and the amplification circuit is having a side effect of acting as a little radio, which is picking up the EMI from the computer and the lamp, and turning it into the annoying hissing noise.

The ferrite bands that he added to the audio cable basically change the frequencies of that cable, effectivly filtering the annoying frequencies out.

Why don’t these cables come with the bands installed? Well, the point is that it dosn’t STOP the frequencies, it shifts the resonance frequency of the cable. The cable and speakers will still produce noise if the EMI comes in on a different frequency, so it was just bad luck that the EMI in his room was the same frequency as the cable / speaker setup.

EAGLE CAD and Valves


Uhh.. ok. The biggest problem I have with EAGLE Cad (and I only have the freeware version here – my job lets me use design tools at work, but most of the stuff I talk about on here is actually for home, and I’m trying to finally get some of it online as part of my “open source” roots.) is…

the lack of parts. Too often I come across a custom part that I want to incorperate in my circuit. When I draw my circuits by hand, thats not a problem, but to get these things online, I need to digitise them, and scan’s of my lab book just really arn’t suitable.

This time, I found the need for a particular Triode – the 6S7L – now, before people start asking me questions about Triodes and Valves in general, I don’t know, this is the first time I’ve ever used them and I’m getting quite excited over the prospect. But, Eagle Cad just dosn’t contain the parts for some of these devices, so more and more I’ve been building my own versions.

Because EagleCad is designed to go from a schematic straight to a board layout, I’ve found that I’ve been using the schematics as close as possible, but I really have been just throwing pins at the package file, meaning that if anyone where to convert my schamtics to boards then they will certainly a) be wrong and b) could be quite ammusing.

Anyways, this:

6sl7dual-triode

is the current working diagram. Yes I stole it. The book in question actually, “22 Radio and Receiver Projects for the Evil Genius” was a Christmas present, and I’m getting quite annoyed with the number of typing mistakes I’m finding in it. I wouldn’t say its the best book – you have to be a genius (or be good at pretending to be one) to understand some of the bits in it, but forging onwards … high voltage valve radio soon.

Electronics & Active Smart Posters


So you’ve all seen the video of me making the Prototype 1.2 (back in this post) but now we’re actually gearing up to make a real productised version of it. What this means is turning a prototype system into a single board working version. This presents me with a couple of challenges – mainly over licensing and IP.

I will be the first to recognise that what I’ve done in terms of hardware is hardly rocket science – I’ve taken a module from here, and a module from there, and wired the two together. My touch of genius has come in the form of the code sitting on the microprocessor (module 2) which is driving and controlling the first module.

Module 1 – the really tricky bit, actually isn’t a problem – we’ve paid for a license to use this circuit, and we pay a small royalty for each product we produce with it on.

Module 2 – the microprocessor board, is proving a little more difficult to source – my current build is based upon Arduino, that is I have developed a shield containing Module 1 on it. I was hoping that the license for Arduino would enable me to adapt the circuit design and build the entire board as one. However, Module 2 is released under Creative Commons Attribute Share-Alike License, which basically means if I use their schematics, I have to license the entire board as that.

And looking for other, more friendly “Open Source” schematics, is prooving very tricky to find, so I resorted to a different tactic – just designing the entire microprossor module myself. Actually, it wasn’t that hard – if your design (from the docs of the microprocessor you are building for) then there is only very small descions you can take. It turns out (after comparing my design against the Arduino, and about three other Atmel based prototyping microcontroller boards), that there is only very very slight differences in terms of schematic – and this will also be reflected in layout – following standard design layout “logic” will lead you to the same conclusion.

mmmm, final version sounds so near.

Arduino as Digital Filter… Hopes downed, and then Revived


I had hoped in my previous post to sample the audio through the use of an analogue input pin on the Arduino, then do some bit manipulation in the form of a Digital filter before playing back. However, my hopes have been crushed with this system:

To test the feasability of this, the code was simple – define an int to store a sample in, call analogRead() to read a byte in, convert this value into a value suitable for the number of output pins, then pass it out.

AnalogRead reads in a value between 0 and 1024, which is a 10 bit number. Because I’ve only got a 6bit DAC, I decided to just take the top 6 bits (I should really try this again with scaling as opposed to just taking MSB).

Now, since starting to write this and battling with lots of media upload tools AND wordpress.com etc, I’ve realised two things. 1) I’m not actually taking the top 6 bits, I’m using the top 2 bits because of a stupidity. and 2) I should use Scaling instead of just using the top 6 bits. I have just tried it again using 6 bits and there is a large improvement, as for scaling, that will have to wait.

My code (which is BAD and WRONG):
void loop() {
  buffer = analogRead(analogPin);
  PORTD = (byte) buffer >> 4 ; // only use MSB 6 bits
}

The following is an MP3 hosted on SplashCast Here. The first sample is the sample I’m inputting into the arduino, the second and third is the output.

[splashcast UQVA8175RX]

Arduino Audio Filter


Whats the difference between Noise Makers and Audio Filters – well, I would expect a level of control. A Noise Maker implies a lack of control – the difference between “din” and “music”. I’ll start this post off with this image, which is a Waterfall image. Waterfalls are spectrum over time – In this case, the frequency is up the side, and the time is across the bottom. The intensity of the colour indicates a voltage at that particular frequency.

Waterfall of Arduino Noise Maker

Waterfall of Arduino Noise Maker

What we are seeing is how the frequencies are changing over time when the dials on the board are swizzled, and by comparing this with other audio projects, we are able to see how various features and code changes change the output.

The next stage of the project is Filters – Filters are basically devices which limit frequencies that go through them – there are essentially two types of filters, High pass (which allow high frequencies to go through) and Low Pass (which allow low frequencies through). By combining these together, you can generate Band Pass filters and Notch Filters (although you might make notch filters in a different way).

By adding filters together, you can make filters which let multiple bands (a comb shape) or ban multiple bands. If you have control of your filters, you can change them and manipulate them over time, and apparently, if you generate white noise on one side, and use two bandpass filters, you can make sounds which sound like words – by moving the two filters in and out and widen and narrow.

Anyways, when I was at Uni, I learnt how to build Digital Filters, that is I learnt the electronics behind the DSP, and its quite simple – well, its a little tricky to get them efficient, but a problem that’s been solved time and time again. The system works by multiplying a set of samples in a fashion. Unfortuantly, my choice of modules (50% electronics or low level computing, 25% maths, and about 20% computing theory) means that… I didn’t do the Signals and Systems module because my Maths skills are troubled. I loose the decimal place ok?

So I’ve had a crash course in Fourier Transforms, which are the very basics behind working out the numbers that you need in the sample multipliers… Which is what I’m about to build on this new circuit. So far, I have an analog input (which is my sampling system) and an 6 Bit R2R DAC shield. The first test will be to act as a buffer. The second will to act as an Echo Box, and the third, to Filter.

Arduino Noise Maker


I’m so sorry that this blog does seem to be jumping around quite a bit at the moment – one moment its RFID / NFC reading and writing, the second its serial to eithernet connections, and the third its … digital synthesizers? And unfortunatly, this post will be soon followed by a post about IRC robots, when will the random jumble of stuff come together? Soon! Sooon I say SOOOON!

Basically David Reynolds and myself have been working on a Digital Synth on the Arduino board, and been set back by being unable to get components from local shops blah blah etc etc. But finally, tonight, we have had success in building a semi-clone of the Arduino Noise Maker, and this is where I post my Vimeo Video.

Before I do, I need to first apologise to anyone reading this on Advogato – last time I posted a Vimeo video, Advogato went mental and merged my post with the person who posted immediatly before (i.e. the post immediatly below mine). The RSS feed that wordpress generates does seem to be sane and ok, so it makes me wonder if its and Advogato RSS eating/spittingout bug?

First running complete circuit – similar to that of Little – scale on Blog Spot. I should also mention that the film was filmed by Dave on a camera phone, so apologies for the sound and video quality. I think you can also hear the Wii Brain Teaser in the back ground.

This is actually the second version because we had massive problems sourcing the components needed, and we tried using a second Arduino board to clone the missing chips.

In this one however, the main noise is being outputted to the Breadboard via 6 lines into a 6 bit R2R DAC. The schmitt triggers are mounted on a nuelectronics arduino board, which controls the vibrato and the wave selector units. The two extra pots on the breadboard are the pitch and speed selection pots.

Stay tuned for more – next version promises to have some midi integration!

Info:
* R2R info: en.wikipedia.org/wiki/Resistor_Ladder
* Original Design: little-scale.blogspot.com/2008/01/arduino-noise-maker-info.html

Lantronix Xport Direct … and its death


Lantronix make some awesome little chips which give you a serial connection to a TCP/IP connection… that is by sending “C” followed by an IP, then waiting for a “C” back, it connects to the remote host.

My Problem? When I started with my chip, there was a wiring accident and I think I’ve fried its serial connection. So I need to buy another chip to confirm whether its dead, and then, when I have, throw this one in the bin :(.

Audio and the Old Man


Dave and me are trying to build an audio project, which is all about sound manipulation. Dave’s the musician of the two of us, and I know nothing about sound whatsoever. We’ve got a primitive system using a Arduino that will produce sounds out of an R2R Digital to Analog Converter, but we’ve got no real idea about generating the wave form. If only we could sample…

About ten years ago, my dad mentioned in passing a short story… Before I was born, and we’re talking about the mid 70’s here, or maybe even possibly early 70’s. Either way, the styles where much different to now. He was helping a friend of his build an Digital Audio project. Sound familiar? Time to pick the old man’s brains.

Anyways, it turns out, back in the day, they built a device which sampled audio from a microphone by converting its voltage into a number, then saving it to memory, then, synchronized, retrieving the elements from memory and playing them back. Yes yes, it’s an echo box. Primitive but worked. If his memory serves him right (and we’re talking my entire life span here, and he’s had a lot of stress in that time – he’s my Dad after all) he thinks that they only sampled at about 50 times a second. Apparently, even cooler, whilst it was a digital system, they didn’t use any form of micro controller – they did the entire lot in Digital Electronics, making the controlling circuits using just logic chips. Thats hardcore. Anyways, back to the point of this.

Why couldn’t I have worked this out? My mind is stuck in this world of high tech digital quality sampling on one side, and on the other, using really high frequencies which sampling at 50hz seriously won’t cut it but that doesn’t matter does it! Either way, I’m now set to sample data on the analog port, and then shove it out again on the R2R DAC on the other side.

Ok, time for some diagrams about what I’m talking about.

Ok that was the worlds most boring diagram, but it gets the point across I guess. Sorry about the ? with the other side of the microphone. I have no idea what this should plug into, and actually, I have very little idea where I’m going to get one from. I have a suspicion I’ll be plugging it into a computers line out or headphones port into a jack there. For those of you who don’t have a clue what a R2R Dac is, then check out this page and erm, I guess thats it for now until this has actually been built.