Using a microphone with the RN52 Bluetooth Adapter

Background

A request from a customer for advice surrounding our BAL (RN52 Development Kit) product, based on the RN52 Bluetooth Adapter from Microchip, wanting to use the product for streaming audio from a microphone to a separate Bluetooth master recording device using the HFP protocol led to more headaches than we could have expected. 

The Microchip data sheet didn't provide us with much help, other than to confirm that our electret microphone (found here and bought here should you want to try this yourself) was within the recommended specification. We looked to this article by sixerdoodle (whom we have to thank for setting us off in the correct direction) and tried to build a circuit for our microphone connection. 

mic and RN52 BAL board

Argh!

Gaaaah! No luck. Excuse the mess in the photo, we were hoping for a quick fix, not something we'd have to write about. We found, similar to the blog linked above, that the MIC would sometimes work on the first call, and after that either be ridiculously quiet, or not work at all. Unideal for a customer to have to turn it on and off every time they start recording. 

Then it stopped working altogether, even on first power up.

The MIC_BIAS pin was not producing anywhere near enough voltage or power, it was (very inconsistently) producing 1.4V open circuit and dropping to 0.5V when in use. Not enough for a 3V mic.

 

Back to the drawing board

The RN52 is based on a CSR BlueCore5 chip similar to this one. Now the CSR chip is much more advanced than the RN52 as Microchip chose not to implement all of its features. We read here that the MIC_BIAS pin derives its power from BAT_P, a pin used by CSR as part of a battery charging circuit for bluetooth products. This is not a feature which Microchip has implemented in any capacity, and so we put our voltage level issues down to this. We found the circuit shown in one of their datasheets, suggesting the MIC_BIAS was to be used as an enable pin for a regulator to provide power from the mysterious BAT_P pin. We couldnt get our MIC_BIAS to drive anything... a Darlington pair, an L.E.D, nothing. 

CSR Circuit

Resolution

We took a 3.3V rail from elsewhere on our project board and tried to implement the circuit like above that with the RC values shown on the datasheet with the diagram. Still, the voltage drop across the microphone was not high enough. Significant playing around, and the addition of a capacitor across the mic finally yielded what we had worked two days to achieve. A phone call where we could actually converse!

See to the left our final design, which now works just fine! C1 (100uF) is a capacitor that removed the background hum on the input, and by increasing that, it removes it gradually. If the 100uF doesnt work for you try change it to 220uF and it should remove the issue.

A lot of effort for a mono phone call, no?

Nixie Tube Clock

So as you can see in the video above, I made a nixie tube clock. It looks something like this (infact it looks exactly like this, because this is a picture of it):

The clock up and running

Below is the schematic for the project, as you can see I'm using 6 IN12 nixie tubes, each with it's own 74141 nixie tube driver. These drivers are great! They simply connect directly to the nixies and display whatever 4 bit binary number you give them (if you give them anything above 9 they blank the display - hence why I use the number 10 in my code to blank the nixies). Because they take in a simple 4 bit binary number, I can hook them directly up to some shift registers to drive them, in my case I used 3 74HC595 shift registers (available everywhere), because they can be "daisy chained" together, meaning in the code I only have to write one 24 bit binary number and it will display all 6 numbers on the nixies. Though in reality I split them up into pairs and write three 8 bit binary numbers.

To use the 74141s you need to connect the live pin of the nixies (through a resistor - in my case 1k5) to the high voltage supply, and then each pin to it's corresponding pin on the driver, which can be found on the datasheet. On my board I forgot these 1k5 resistors and had to modify it. My original board had the live pins going straight to the supply, so I had to cut that trace on the board, and botch in some resistors to each of the tubes, the result is below:

For my main chip I'm using an ATMega328P (the same chip as is in the Arduino Uno), and I'm running the arduino bootloader on it so I can program it in the arduino language - just to make things simpler.

It is interfacing with a DS3232 real time clock chip, which I would highly recommend! It is a great chip which holds hours, minutes, seconds, year, month, date, day of the week (all of which are adjusted for leap years automatically) and it has a tonne of usable SRAM inside it. It's also really really accurate, with a temperature compensated crystal oscillator inside the chip, and fairly easy to interface with (though early on I had some issues - I think it was too much capacitance on the line as I was testing it with cables plugged into the chip socket) over I2C. The only downside I can see is it only comes in a SMD package, which I know some people don't like soldering. Unfortunately I don't have a picture of it, as it's tucked underneath the coin cell battery holder.

For the high voltage supply I simply ordered one of eBay, as it was simpler and cheaper than designing my own! The one I used was this one.

HV Supply board

For the case to my project I laser cut an acrylic front and back and used some chunky nuts and bolts I had lying around to hold them together, as well as to hold the PCB in.

As mentioned in the video, there is a bug free board available on OSHPark if you want to order my board and build this yourselves, and all my code is up on github, links in the banner to where you can find all that!

Homebrew GPS

Hey Guys,

So this project isn’t actually new, I did this around a year and a half ago, but it’s still cool (I think) and still relevant so I may as well share it. This is my homebrew GPS unit!

So the first thing you may notice is it’s not exactly neat, well hey? I did it with very few resources, and for what I made it with, I think it’s quite good!

GPS Top View

 

The main micro-controller I’m using is an ATMega328, in the form of an Arduino Pro Mini (available from sparkfun). Now I know I’ve talked about this before but I really love this board, it’s small, perfect for embedding in projects, and cheap! What more could you want? The GPS I’m using is the Adafruit Ultimate GPS, which I believe is THE best hobbiest GPS. The OLED screen is also from Adafruit, and again is great value for money! It’s tiny (perfect for this project) but still has really high contrast and therefore readability. Both the GPS and screen have wonderful libraries written for them too, which makes the coding so much easier! Aside from the GPS, the screen and the Micro, the only other things are the batteries (AAA) and the buttons, which I soldered onto stripboard with 10K pull-downs (though later I realised it would’ve been easier to use the ATMega328’s internal pull-ups).

Most of the effort with this project was the code, which by the way is awful. I did this code when I was 14, and well it shows. So don’t be too scared! You can find the code on my GitHub page (link up top), so go take a look!

If you can’t stand the sight of such awful code (and I wouldn’t blame you), you can browse the pictures below, which are much more sightly!

 

 

Tremolo Effects Pedal – Part 2!

So you may recall I was designing a tremolo effects pedal for my friend. Well I got the boards back (lovely quality from OSHPark) and soldered them up and, well see for yourself!

Tremolo - Entire Circuit

Above is the circuit for the project, which I have broken down into little bits. Hopefully it’ll be easier to understand that way!

Tremolo Power

So I’ll start with the simplest bit! The power section. It’s pretty much what it looks like, power comes in from headers, and is switched, with a switch.

Tremolo Voltage Divider

The next simplest bit is probably this bit, which is just a voltage divider to give us a nice 4.5V, and some smoothing capacitors across the supply rails. We need the 4.5V because this is what the signal will be centred on, and putting it directly in the middle of the supply rails makes it easier on the op-amp. Op-amps generally don’t work as well closer to the supply rails, and most of the time don’t output near them, to do this, you need a special kind of op-amp, referred to as a rail-to-rail op-amp.

Tremolo Sine Wave Gen

The next bit is the sine wave generator, this is a phase-shift oscillator configuration, with the op-amp for stability (without this op-amp if we were to try to draw any current out of the PSO the sine wave would collapse). RV1 and RV2 are potentiometers controlling the amount of modulation, and the frequency of modulation respectively.

Tremolo Modulator

The final section is the modulator itself! This is the bit where the sine wave is used to modulate the signal from the instrument. The modulation is actually applied to the feedback loop of the op-amp with the transistor (BC548) the op-amp then applies this to the signal itself. The capacitor on the output is to block the DC component of the signal (the 4.5V) and leave the signal as just the amplitude modulated input.

So that’s it! I will eventually be selling this as a kit, but until then, you can order the rev.1 board from OSHPark!

Cheers, Tom

Tremolo Effects Pedal

So for my friends birthday, I decided I’d get him something a little more personal than just a bar of chocolate say, or some money. So I set out to design and build him a Tremolo effects pedal for guitar!

First of course, I needed to figure out how a Tremolo pedal works, I’d heard one in action before, but never thought about what was going on in any depth. Tremolo is an effect created when you change the amplitude of the waveform, which basically changes the volume of the sound. The speed at which you modulate (change) the volume can be changed on the pedal, as can the amount it varies it.

With this in mind, I got to work on EagleCAD (a free schematic and PCB layout software package) designing my pedal. Of course I didn’t design it all from scratch, I patched different circuits together to create it:

TremoloSchematic

This circuit essentially works like this: The bottom section, with the four capacitors, is a sine wave generator. Hooked up to an op-amp (LM324), so as to make sure current could be drawn from it (without the op-amp, if you attempted to use the sine wave signal for anything, it would collapse). There are two potentiometers here, R1 is the potentiometer controlling the amount of modulation the sine wave applies to the signal, R2 is controlling the frequency. The modulation is physically applied to the feedback loop of the top op-amp (another LM324) through the transistor, which then applies it to the signal.

The power, ground, input, output and switch terminals are so they can be connected to their appropriate off board components.

After designing this schematic, I created a PCB:

Tremolo Board

 

I am currently waiting for my PCB to be built (by OSHPark), but when I get them back and test them, I will write another post. If they work, I may even sell them as a kit!

Leave any feedback (pun intended) below.

Cheers, Tom

RTC Using a SeedBoard

Hi everyone,

If you haven’t heard, me and my co-partner are building a development board to embed into projects rather than using a full blown Arduino. For more details see this post.

Anyway, as one of the first projects for this little board, I have hooked it up to a DS1307 real time clock, and an AXE133Y OLED display to make a simple clock. As shown below:

SeedBoard Rev 2.0 with RTC

 

I have simply connected the I²C lines to the same pins on the Arduino and wired up the ds1307 like the data sheet tells you to do. If someone asks I will draw up a schematic for you all, though many can be found online – like this one.

I hope to do many more projects in the coming weeks and months prior to the launch of this board next year so keep posted to see what else the SeedBoard can do. And as always you will be able to find the links to the Arduino sketches on our github page linked at the top of this page.

Thanks guys,

Jacob

SeedBoardSeedBoard with RTC

SeedBoard

Want to see what a SeedBoard can do? Check this post!

Note: SeedBoards are currently not for sale, but if you really want one drop me an e-mail and I will get in contact!

So big(ish) news guys! Me and my co-partner Jacob Rawson have been developing a small micro-controller dev board in our spare time, because we got sick of having to spend loads of money on an Arduino simply to embed it in a project and never see it again.

Now, there are other solutions to this rather than building your own, though much less fun, like the Sparkfun Pro Mini (which I have mentioned before)! For most of you this will be perfectly adequate but for me, living in the UK, it was just a tad too expensive to ship over here.

So why not build one? I got myself onto EagleCAD and started designing a board! This is the result! The SeedBoard (currently rev.2). With a small square form factor it’s ideal for embedding in a project, and (obviously) cheap enough! Costing us around £6 (~$10) non-profit. It can have any crystal you want in it, up to the chip limit of 20MHz, although if you’re feeling adventurous, you could try over-clocking it?

Thanks go to OSHPark for the amazing quality boards they consistently produce, this being one of them!

They are currently not for sale, but (as mentioned above) if you really want one, drop me an e-mail (tom@doayee.co.uk) and I’m sure we can work something out!

For those who don’t want one just yet though, we may be running a kickstarter sometime next year!

Look out for that!

Tom.

Blutooth Audio Link – Video!

Above is a video about my Bluetooth Audio Link board REV.1.

My revision 2 board is currently up on OSHPark, so go check that out!

http://oshpark.com/shared_projects/4JnDnzgH

Also if you have got a rev.1 board here are the instructions for making it work properly! Unfortunately there were some design changes needing to be made which I overlooked on rev.1. So here are the instructions:

[gview file=”https://doayee.co.uk/wp-content/uploads/2013/10/PCB-Fix-for-bluetooth-audio-link.pdf”]

In response to Corey, who requested a parts list for BAL Rev.2. Below is the Parts List for the REV.2 board, as exported from eagle, hope this helps:

[gview file=”https://doayee.co.uk/wp-content/uploads/2013/10/parts-list-2.pdf”]

Here is the schematic for the board:
BAL Schematic

VFD Tube Clock

Hey people!

So a while ago I bought an old Vacuum Florescent Display tube, and attempted to build my own controller for it. Well I’ll keep that story brief but it doesn’t need saying that I failed dramatically, and blew about £60 on it ($96).

But I didn’t give up and a couple of weeks ago I bought myself an awesome little board from OSHPark. Built by a user named ‘Awesomenesser’. Unfortunately I have no means of contacting this person but I would sincerely like to thank him/her for making this awesome little board.

Built by Awesomenesser

Built by Awesomenesser

The board itself uses a MAX6921AUI. Which is a VFD controller chip made by maxim integrated. This chip is absolutely awesome so if you are thinking of doing a VFD project really do check it out!

Unfortunately the board was supplied with no instructions so I sat down for a while and compared data-sheets until I had something that made sense. Now I don’t want you to have to do the same thing so I thought I’d do a little picture and you can see for yourself how it goes.

Max6921AWI Breakout Explained

Some of you who know a thing about VFD tubes will know they run at high voltages, between 30 and 80 gives you a good bright light (though make sure not to exceed the 76V rating on the chip). So you may be wondering how I generated this. To do this I used the HCJ-IPM-V5 DC-DC step up converter, I would highly recommend this solution for anyone wanting up to 30V DC, simply because it is SO easy and simple and still very cheap.

DC-DC Step Up Converter

 

I also used a DS1307+ chip, to keep the time, with a 32.768KhZ watch crystal and a simple 3V coin cell to keep it running when off. I used a really useful library called RTCDue to interface this chip with my Arduino Due, though I plan on eventually running it on an ATMega328PU, in which case I will use this DS1307+ library from Adafruit.

DS1307+

 

And finally I used the Arduino Due to run the show. My code is available on gitHub so take a look if you are looking to interface with the MAX6921 chip! The library I use is specifically for the arduino Due, but if you change that the code should work perfectly on any other arduino!

 

Bluetooth Audio Link

UPDATE: The BAL project has now been redesigned, check the BAL section on the header to see the changes!

Hey everyone,

So after successfully completing my RGB LED strip lights, I was at a loss for what project to embark on next. I wanted to make something a bit more flashy, and a bit more well built.

That is when I saw this video from Sparkfun, where they used an RN-52 Bluetooth module to stream audio directly from a phone into speakers. Now this on it's own is no real use to me, but streaming it to an audio jack where I could plug in headphones or plug it into my full speaker system at home? That's useful (and cool)!!!

The video:

So I went onto EagleCAD, and started designing, finally creating this lovely little board:

Bluetooth Music Link

 

The design is chiefly pretty much the same as the sparkfun circuit, but instead of streaming it out to speakers, it has an audio jack. It also has a DC power jack with an onboard 3.3V supply. The switch is used to switch it between programming mode and normal mode.

If you are interested in the schematic, that is here:

Bluetooth Audio Link Schematic

As of yet, whilst I am still prototyping it, most of the components are through-hole, but if you want to order the board to try it out, it is available from OSHPark (which is where I ordered mine from).

WARNING, on the silkscreen, the LED's are backwards, if you order it make sure you put them the other way!

If you wish to make a board professionally, I seriously recommend OSHPark! They have amazing quality, and amazing prices too, and if you are not fussed about waiting, free international shipping. They are also run by a pretty cool guy called Laen, who is great.

Cheers all,

Tom Cousins