DIY Portable Speaker Amplifier using LM386

For one of my first audio circuits, I decided to make a simple amplifier circuit based on the LM386 IC to power an 8 Ohm 0.5 W Speaker. I started off based on the schematic provided in this instructable:

http://www.instructables.com/id/Portable-Speaker-1/?ALLSTEPS

But once I was done with it, I wasn’t really impressed with the audio quality. The audio would start to crackle really soon and there was very little clarity. As it turns out, all I had to do was add a 0.047 uF capacitor at the output and a 0.01uF capacitor  at the input as decoupling capacitors to get a remarkable upgrade. The more common schematic for this application was available at:
http://www.instructables.com/id/Make-a-Simple-Audio-Amplifier/

Oh and for anybody interested in making this project, do check out this awesome detailed post and video by Hackaday:
http://hackaday.com/2011/05/01/lm386-altoids-tin-amp/

and the original hackaweek post:
http://hackaweek.com/hacks/?p=131

So effectively the schematic I used resembles:

(http://hackaweek.com/hacks/wp-content/uploads/2011/04/LM386ampschematicfinal1.jpg)

In order to test my amp, I even wanted to try using an Arduino to drive this speaker instead of the usual annoying Piezo Buzzer I’d used so far for audio output. I used the sample code from the tutorial dealing with the tone() function in Arduino:
http://arduino.cc/en/Tutorial/tone

Here are some pics of my implementation:

And here’s how it sounds:

Future Plans:
1. Adding a bass boost as mentioned in the reference post
2. Trying out a guitar input and output to headphones
3. Putting it in a case

Advertisements

Running the Nokia 6610 LCD with a Raspberry Pi

A while back, I’d bought the Nokia 6610 LCD thinking of it as a nice cheap display to incorporate into certain projects.

http://www.onlinetps.com/shop/index.php?main_page=product_info&cPath=9_41&products_id=776

When I finally got around to using it, I thought of looking for instructables/references on interfacing it with the RasPi, but all I found was:

https://www.sparkfun.com/tutorial/Nokia%206100%20LCD%20Display%20Driver.pdf

and

http://www.instructables.com/id/How-To-Use-a-Nokia-Color-LCD/

and slowly learnt that this particular display has been quite a challenge for the online community for a while now. I did find very nice posts about how to interface it with other platforms though:
Arduino:
http://playground.arduino.cc/Code/LCDPCF8833

AVR:
http://thomaspfeifer.net/nokia_6100_display_en.htm

But after a lot of hunting, once I started looking for projects based on the LCD’s drivers, I finally came across a github project:

https://github.com/engpedrorafael/pcf8833

I really felt a rush of gratitude towards him once I found this because the task of porting the entire C library to be used with the Raspberry Pi through Wiring Pi seemed too daunting to me. Or atleast something I’d be too lazy to do to run a simple colour LCD 😛

All the steps for running the LCD are there on his git page. In short,
1.Make the connections:

(LCD connections)

2. Get his code
3. Run it and test, convert images to the relevant dimensions (132×132 pixels) and file format, and use the python modules he’s created.

I just hope this post helps somebody else find this particular implementation much sooner that it took me considering how easy things became once I found this. Major props to Pedro. 🙂

In terms of connections, I ended up using a 330 Ohm resistor between 12V and the LED+ pin to make the display bright enough, I tried to use the 7806 but IMHO the display wasn’t really readable.

Here’s my setup:

P.S.: In case anybody’s having issues running the D-Link DWA 132 N300 Wi-Fi Dongle with the Pi, check out:

https://xneosis.wordpress.com/category/linux/raspberry-pi-linux/

Works like a charm and the dongle is one of the most reliable ones I’ve used.

P.P.S.: If you want to make your own bench power supply and haven’t seen this yet, check out my post:

https://botmayank.wordpress.com/2014/06/24/diy-bench-power-supply/

DIY Bench Power Supply

For any electronics hobbyist, one of the most crucial tools while testing/prototyping circuits on a breadboard/perfboard is a good standard power supply. But buying a typical bench power supply might not be an option for everyone.

One of the easiest (and perhaps the most useful) hardware hacks I’ve ever done is to re-use a really old PC CPU’s ATX power supply as my own bench power supply. Earlier I used to keep leeching 5V or 3.3V DC off of Arduino Uno boards powered through DC 9 V Adapters and I’d always have to use DC jack to molex or other such types of connectors in conjunction with a plethora of DC adapters to power my breadboard prototypes.

Now, I can easily use this setup to have easy access to 3.3V, 5V and 12V each capable of sourcing 3 A of current too! 🙂
The best part is, there’s really not much that you need to do to get it up and running!

Here’s what an ATX power supply looks like:
http://www.ebay.in/itm/like/intex-450w-smps-atx-power-supply-sata-connectors-/271505046206?pt=in_computer_components

You can get one for around INR 800 (13 USD) easily from a local computer hardware store or online.

Here’s the pinout of the connectors on such an ATX supply:

atx-psu-pinouts
(http://www.helpwithpcs.com/courses/power-supply/atx-psu-pinouts.gif)

As you can see on the main ATX 20 pin connector, most of the standard operating voltages that we need for any electronics projects are right there! The only hitch is, you can’t just plug it in, flip the switch on the back, and make it run.

Remember how your PC CPU powers up? You have to push the power button right? The connection responsible for the powering up is the PS_ON pin shown there. For our purposes, we simply have to short that with GND to get the power supply up and running. So you could simply snip, strip and twist them together, or as I’ve done in my case, connect it to a small slider switch.

DSC_0675     DSC_0678

As for the other supply voltages, I’ve stripped them and connected the wires into this small “distribution circuit” which is essentially just screw terminals for the 3.3V, 12V, 5V, GND wires along with rows of male headers for the same along with a “Power On” green LED and the slider switch. You could even use the ATX 20 pin connector as is, but the molex connector on that has sockets that are larger than the usual breadboard hole sized male headers and that is why I went in for such a setup. ….and we’re done!

I found plenty of instructables online for setting this up and I thought that I could just help add to the list of resources out there so that more people starting off into DIY electronics or budding “Makers” could maybe have some easy access to these common voltages with very little effort, time and/or money.

TL;DR:

Step1: Get the ATX power supply
Step2: Short the Green wire with any one of the black wires on the 20 pin header
Step3: Solder a small perfboard distribution setup if you want
Step4: Plug it in, and DONE! Hookup your breadboard circuit and enjoy!

P.S. Be safe while dealing with the power supply and handling AC voltage and do leave room for the cooling fan at the back of the ATX power supply box

Some more pictures of my setup :

I even hooked up a push button switch and 2 wires to a small DC motor that I can drive with this supply. I intend to fix standard PCB Drill bits with it by gluing the chuck that I can take out from a normal hand press PCB drill in order to have a neat automatic PCB Drill for any prototype PCB’s I make at home with the toner transfer method. I’ll post that as soon as I’m done with it.
Cheers!

It’s all your fault, Mark.

A short funny take on the Whatsoff Incident

Surfing Tangents

23rd February, 2014:

3:39 AM: Confirming the death of Whatsapp.

3:39 AM: You there?

3:39 AM: Wow.

3:40 AM: This is probably the end of an era, isn’t it?

3:40 AM: I wonder if someday, these messages will get delivered.

3:52 AM: Maybe 40 years from now. Some of us will be married, some of us successful. Some of us alive, some dead. Some wanting to be dead. Who knows? Maybe someday when you’re about to put your neck through the noose, in a damp dingy apartment somewhere in a crumbling city, your phone will buzz, with a Whatsapp notification. You’ll read this message, and be visited by ghosts from a bygone era. You’ll remember what it was like to be young. To be, at the same time, naive, excited, in love, and terrified of the world in the most queer way. That heady cocktail of emotions that only plague…

View original post 169 more words

Setting up Cooja: A simulator for TinyOS

It might not be possible to test out all the work you do in TinyOS on a physical test bench at all times. Or maybe sometimes you want to save yourself the trouble of flashing a large number of motes only to realize that you’d made trivial errors in your code. Enter: Cooja.

Contiki is another widely used platform in the field of Wireless Sensor Networks. We’ll now be describing how to setup Cooja: the simulator tool offered by Contiki.

The normal installation is by following the instructions on this site:
http://www.contiki-os.org/start.html

However, for somebody who just wants to use Cooja as a simulation platform in conjunction with TinyOS, the normal setup is bulky at a little over 2 GB to download and the instructions are something that even we struggled with.

In order to save you the trouble of this procedure, we’ve uploaded the relevant part of Contiki to make Cooja.

Steps:

1. Download the .zip file from https://docs.google.com/file/d/0Byj9l1T-DECtRGd2a1Vka1RUakk/edit
2. Extract the files to any convenient location.
3. Make sure you have java development kit (7 or greater) and ant installed on your system. If not, then :

                    sudo apt-get install ant (on Linux)  or https://ant.apache.org/manual/install.html (for Windows)

http://www.oracle.com/technetwork/java/javase/downloads/index.html (for Windows)
or sudo apt-get install openjdk-7-jdk (for Linux)

4.Set the path variables for java and ant (only required if not automatically set or in windows)
5.Go to the location where you’ve extracted the folder.
6.Navigate to contiki/tools/cooja
7.Write ant run (in terminal or cmd)

This should launch the simulator and you can now explore Cooja.

The example we’re going to show here is simple radio communication between two motes and from our basic Send Receive code hosted at:

https://github.com/shady33/tinyos-bits/tree/master/basic_send_receive

General Steps for simulating code based on TelosB motes:
1. File->New Simulation. Create.

2.Motes->Add Motes->Create a new mote type->Sky Mote

3.In the Contiki Process/Firmware field browse to the location on disk where you’ve compiled your code using make telosb

4.Go to build/telosb/ and choose main.exe

5.Add motes

6.Press Start in the simulation control panel

That’s about it. Some of the other common features we use are:

1. The on board LEDs which you can add from View->LEDs in the Network Window.
2. Radio Messages from Tools->Radio Messages
3.Speed Limit control in the Simulation Control window
4.The output of Printf statements that show up in the Mote Output Window
(Something to watch out for while using Printf statements, its better to use the SerialPrintfC component in the configuration file XYZAppC.nc file while simulating in Cooja. On the other hand, PrintfC works better in real-world simulations using the java.net.tinyos.tools.listen tool for tinyos or something else like Cutecom.)

Cheers,
Mayank Joneja, Laksh Bhatia, Sachin

Electronics, Photography, Music; The holy trinity that makes it all worthwhile

Kaustubh Shivdikar

-A KTB INITIATIVE

Jatin Parekh

--Graphics, Vision and BITS

MuseBoxx

Space to Create

webrpi

Raspberry Pi Web Development

Rohit Agrawal

Electronics | Tinkering | Simplifying Jargons

Guitar Extended

A (possible) future of guitar

maniacbug

Explorations in Embedded

Wireless Sensor Networks (WSN) | Remote monitoring systems

ADVANTICSYS provides a large variety of wireless sensor network based devices.

Biju Sir's Computer Architecture

Extended version. Just in case you're interested.

Jacob Salmela

#!/bin/bash

The Auxiliary Wire

USCTrojan | BITSGian | Komicazi | Networks

LEANNE COLE

Fine Art Photographer ~ Daring to be Different

Life in a Photograph

Photography by André Diogo Pereira

Ashish Shakya

Writer. Stand-up comic. General idiot for hire.

Robots with Grace

Brain dump of robotics, vision, graphics, art, and life.

My Personal Photo Blog

Since I'm inarticulate, I express myself with images ...

%d bloggers like this: