Tuesday 29 July 2014

ATTiny84 ICSP Arduino Shield – Plan

A side issue for the ATTiny84 is loading sketches from the Arduino IDE. The approach that I have seen in several guises is using an Arduino Uno to program the ATTiny84. 42 Bots has fairly common design (from what I have seen on the Interweb) - Programming ATTiny84/ATTiny44 With Arduino Uno.

The approach appears to be consistent with several other designs. The main trick is loading the Master Tiny board definitions into the Arduino IDE. I had a bit of a hassle with this as it seems that the IDE has to be completely shut down and restarted to recognise the new hardware.

As it is likely that I’ll want to reproduce this at some stage, I figured that it would be sensible to create a shield for my Arduino that I can drop the ATTiny84 into the DIP socket, transfer the program and then pop the MCU out. I’d then drop the programmed ATTiny84 into my live circuit and continue.

From:

Programming an Attiny84 or Attiny44 with Arduino Uno

I got:

Fritzing ATTiny84 ICSP_bb

as a wiring diagram … and from that it becomes:

Fritzing ATTiny84 ICSP_pcb

There really isn’t much to the board other than it’s pin locations aligning with the sockets in the Arduino Uno. That, and the 10uF capacitor terminating the UNO Reset pin.

I’ll make this up as a PCB so that I can simply attach it to the UNO as a shield and, I’m away.

9V to 5V Voltage Regulator – Plan

I have a couple of plans that involve reworking some of my earlier circuits into a sub-circuit environment and using an ATTiny84 chip as the controller.

The overall view is as follows:

Block Diagram

There will be an ATTiny84 at the core that will take analog input from three Momentary switches to toggle the three load circuits on and off.

The three load circuits are the:

These load circuits will be “controlled” by the ATTiny84 only in so far as the ATTiny84 will be serving power to the load circuits.

To start with, I’m going to be designing and building the 5V Regulated Power circuit to take the input 9V and deliver a smooth 5V to the ATTiny84.

Handily, Fritzing has a nice example circuit to start me off.

Fritzing 9V to 5V Regulator_bb

This simply passes the power from the 9V battery to a LM7805 and the output to a pin block. The circuit uses two 100nF capacitors to smooth the input and output. I have simply replaced the generic LM and input power in the Fritzing example with the LM7805 and a 9V battery.

For the PCB view, in Fritzing, the same changes have been made.

Fritzing 9V to 5V Regulator_pcb

I made some other minor cosmetic changes to the PCB design, such as added labels and rescaled the board (20mm x 20mm).

Thursday 17 July 2014

Making Cables – Part 4 – Dupont Male to 2 Female

Now that I’ve gone through the first two articles (9V Snap and USB Powered) I don’t think that there is much that I can add to the conversation, really. Follow the directions in the 9V Snap article for preparing the multi-strand wire and connector directions. Remembering that you need to use Male DuPont connectors for the supply end of the cable.

01_Done

There are no differences in the way that the DuPont connectors are soldered, nor are there any differences in the way that the 2 Pin Housing is used.

The main thing here is that I have a single wire splitting into 2 wires  at the junction point and then shrink tube goes over the join.

02_Joins

At the end of the wire where there are two black and two red lines, these get a Female (4 in total) connector. At the other end of the cable, solder in two Male connectors. Once again, slip the shrink tube over the lines and then slide one red and one black line into the housing so that you end up with a single 2 pin block at the male end and two 2 pin blocks at the male end.

When connecting the double wire to the single wire, I first soldered the two red wires together in a “V” configuration and then wound the single red wire around the double to make the “Y” connection. And then the same for the black wires. The shrink tube then slides over the join so that there aren’t any exposed wires anywhere. Making use of the Third Hand tool to hold the wires while I soldered them together was very useful.

It really is as simple as that.

You can use your multimeter to perform a continuity test by placing one probe on the positive male connector and then touching the other probe onto the exposed loop on the positive female end. Change over to the negative and then test the negative female ends.

With the male end connected to power, you can also run a power check to see if there is any significant voltage drop across the cable, which you might get if the overall cable length is too long. My cable is about 15cm long and I get no appreciable voltage drop.

You could replace the Male DuPont connectors with female connectors if you want, it really depends on your application.

Another project that you could do is making a couple of adaptors. Male to Male, Female to Female so that you can connect to devices that require either male or female connections.

Wednesday 16 July 2014

Making Cables – Part 3 – USB Powered

We’re a little bit out of order. I decided to make the USB power cable before the planned second article (2 Pin DuPont Male to 2 x 2 Pin DuPont Female). I’ll get on to that next.

Practically, this project is the same as the 9V Snap project. The only practical difference here is that there is some wire cutting involved in this project that is slightly more complex than the previous article.

As this article builds on the previous one, refer to the previous article for detail on some of the steps that I don’t detail here.

Firstly, I started with an old USB cable for a redundant mobile phone.01_OldUSBCable

This cable has been sitting in my parts/cables box for a while and it’s time to give it a new lease of life.

02_DeviceEnd

As you can see, this is a non-standard device end for a USB cable. Hooray for proprietary implementations.

I simply cut the device end away from the cable with some side cutters.

03_Snip

There’s always a moment when you do this that you think to yourself … what have you done? Now I can’t power that … oh yeah, I recycled that phone more than 10 years ago.

Now strip the outer insulating sheath away from the cable core.

04_Strip

Initially, I made this 10mm, but I then went back and stripped another 10mm away so that I had enough exposed wire to strip the internal wires properly.

05_WireSheath

For this USB cable, there was an inner lining of a metal sheet wrapping the core wires., you can just strip this away by hand.

06_WiresLaidBare

By convention, there are 4 insulated multi-strand wires inside a USB cable. This cable also had another ground wire of uninsulated multi-strand wire in there. I think that this was a continuous ground from end to end.

The four insulated multi-strand wires are:

  • Black – Negative wire for ground connections
  • Red – Positive wire – typically 5V
  • Green – Negative DATA (DATA-)
  • White – Positive DATA (DATA+)

A possible variant is Orange (Positive), White (Negative), Blue (DATA+), Green (DATA-).

As our cable isn’t going to carry data, the Green and White (as well as the uninsulated) wires are cut away.

07_Crop

Try to make this as neat as you can, you don’t want accidental signals interfering with the Positive or Negative lines.

08_WiresStripped

I then stripped away 5mm of insulation from the end of both wires and then tinned the exposed multi-strand leads. These leads are quite thin and are easy to work with.

After the leads were tinned, I then tinned the DuPont Female connector between the end wings as I did in the previous article (9V Snap). Once both the lead ends and the connectors were tinned, I soldered the leads into the connectors.

09_Soldered

Then I removed the connectors from the strip and crimped the connectors to the wire for a sturdy connection.

10_Crimp

In the previous two pictures, you can see that I have already slipped the shrink tube onto the cable. This is so that I don’t have any problems when it’s time to tidy up the job.

After that, it’s a matter of slipping the connectors into the housing. Remember, I use the arrow on the DuPont housing to indicate positive.

11_Housed

I intend to completely cover the wire on my USB cable, so I won’t be able to refer to the lead colour to tell me which is positive and which is negative.

12_Shrink

As you can see, when the shrink tube is shrunk, you cannot tell which lead is which. So the convention of the arrow indicating Positive is very useful.

The last part of this is to connect the cable to power and to power a device to make sure that it’s all hunky-dory. The cable is about 40cm in length, so it should deliver slightly less than 5.1V.

13_Test

Bazingo, the device is powered. By the way, the USB cable is connected to a USB AC Adaptor, rather than to my computer. If you are unsure of the amount of power that will be drawn by your device … blow up an AC Adaptor, they cost less than a computer. Ideally, you would attach the USB cable to your multimeter to check out how much power it is delivering, just to be sure and because it is easy to do, right? When I tested the cable with the multimeter, it detected a voltage of 5.07V … so there you go, safe to connect to my computer.

Well, as you can see, converting a dead USB cable into a useful 5V power cable is easy and not very time consuming. Overall, this project took about 5 minutes to complete, so don’t expect this to waste your weekend doing it … plan to do other stuff too!

If you wanted to use the cable from a dead mouse … simply cut the mouse away from the cable (it’s just another device end).

Tuesday 15 July 2014

Making Cables – Part 2 – 9V Snap Connector

In this article I’m going to attach a DuPont Connector onto a 9V Snap. This is the first, and most simple, of the Making Cables articles that I have planned. All of the skills that you would need to make DuPont Jumper Connectors can be found here … in the later articles, we’re really just going to be re-organising some of the steps, adding new steps and doing some cable preparation.

Here is a picture of my cable crimper.

01_Crimp

The crimper has some dies in the jaw for different sized connectors, and for double crimps. At the other end of the crimping tool are some rudimentary wire strippers and cutters. I prefer to use tools that are made for those jobs, but these would do in a pinch. The crimping tool came from Jay Car for $14.95.

The 9V battery snaps that I have, I bought from eBay. I got a job lot of 50 of them for about $6.00, I think … it was a while ago.

02_9VBatterySnap

Along with this, I’m going to use a 2 Pin DuPont Housing and 2 x Female DuPont Connectors.

03_DuPontHousingAndFemaleConnectors

You will notice that there is a small arrow on the left-hand side of the 2 pin housing. I use this to indicate the positive (+) for my custom wires, so that’s where you’ll see the red wire going.

The first thing that I do to prepare the 9V snap is to trim the insulating plastic at the end of the wire.

04_TrimWires

I take a scalpel and I chamfer the end so that I end up with a short cone at the end of my wire. The reason that I do this is that the first couple of DuPont connectors that I made didn’t fit the wire nicely, so the locking piece didn’t lock with the housing and I had to go over the wire and chamfer it while it was attached to the housing. That was a pain in the butt, so I chamfer before I do anything else (much easier). It also makes for a neater end product.

05_TrimmedWires

Here are the wires all nicely chamfered.

Next, it’s on to tinning the DuPont Female Connectors. I use a Third Hand tool to hold the connectors firmly before I apply the heat.

06_PositionConnectors

Cut two connectors from the strip of connectors and so they are still connected to each other. This makes it easier to handle … another lesson learned. When I did this the first time, I had the cut away from the strip, making them smaller and harder to position.

Tinning the DuPont Female Connector

I then place a blob of solder into the connector: where the wire will go, so that when I solder the wire in, it is much easier.

Solder the wire into the channel

With the wire held in place in the Third Hand, soldering the wire into the connector is quite straight forward. Simply press the iron down onto the wire and apply a little bit more solder to the top and you’re done.

07_WiresSoldered

You can see that the chamfered insulation sits nicely in the channel and the wire is held firmly in place with the solder weld.

Now it’s time to take the connected wires away from the strip. The first time I did this, I used a pair of side cutters … don’t do that … it’s messy. Instead, simply hold the connectors between thumb and forefinger and wiggle the strip back and forth, it comes away after about 2 wiggles.

08_RemoveConnectorFromStrip01

09_RemoveConnectorFromStrip02

10_ReadyToCrimp

Now that the connectors are removed from the strip, it’s Crimping Time.

I like to give the end wings a quick bite in the crimping tool so that they fit easily into the 22-26 die.

11_ALittleSqueeze

Be careful to only exert a little bit of force here, you’re only closing the end wings about 1mm.

Then it’s into the 22-26 die for a full squeeze. When you are loading the connector into the die, the wire end of the connector should be just inside the die, the sleeve end of the connector should be sitting proud of the die (so that it doesn’t get squeezed).

12_Squeeze_22-26

Close the crimping tool fully and then take the connector out of the die. Just because I like things to be easy, I then give the connector another light squeeze in the 26-28 die so that it is rounded off nicely. This last step isn’t really necessary, but it makes  the connector all nice and neat.

13_Squeeze_26-28

The end result should be that the inner and outer wings of the connector are wrapped snugly around the wire and the sleeve has not collapsed. If the sleeve has collapsed? Well … start again, they are a pain to try to push out again (although you *CAN* do it by hammering a dressmaking pin in to try to open it up again).

14_Crimped

Pimped and crimped. You can see that there are two complete loops. One at the business (left) end and one almost halfway along. The one almost halfway along is the piece that locks in to the plastic housing notch to stop the connector from sliding in and out of the housing.

Now you can slide a small piece (say 20mm) of shrink tube over the two connectors. I do this by threading one through first and then threading the second through. If you try to put both through at the same time, it ain’t going to work, unless your shrink tube is too big.

15_Shrinky

Yeah, a pretty crap picture, but detail isn’t all that important for this one. I’m using a 2.0 diameter shrink tube here.

Now, down to business. I put the red (positive) wire in first. You can see the second loop of the connector through the hole in the side of the housing. Each void has a little tongue in it that will catch at the back of the connectors middle loop, preventing it from coming out. There’s still a little bit of wiggle room there, but not much.

16_RedGoesToArrow

You can see from the picture that the left-hand side of the connector housing has that little arrow I was talking about … this is where my red wire goes.

And now the black wire goes in the same way.

17_BothIn

Both are pushed in until the middle loop is completely through, you can then pinch the plastic tongue down and it will sometimes give you a satisfying little “click” indicating that it is engaged properly.

Then it’s just, push the shrinky up to the housing and heat it in place.

19_ShrinkyShrunk

I heat the shrink tube by running the hot soldering iron over it in quick even strokes. This seems to be a hell of a lot better than using a cigarette lighter (IMHO).

The final stage is the one where you get to plug it in to something to prove that you have connected it all properly … and give yourself a little “woohoo”.

20_JobDone

That’s it. The whole job only took about 10 minutes to complete (with some preparation and photography) and now I have another 9V snap that I can use to power some stuff. I hope you enjoyed this article and that it can give you some kinda benefit.

Making Cables – Part 1

A while ago, I tried to find out the best way to make up my own connector cables with my budget in mind.

My needs, at the time, were to make some 1 pin and 2 pin connectors using DuPont male and female connectors. These were to make up some 9V battery power lines, and later making up some USB power lines.

image

I found some useful information on the Internet, but the part that was a little mysterious was making DuPont male connectors.

image

image

There are a couple of things that you need that will make your life a lot easier if you’re going to do this. First and foremost, you’re going to need a decent pair cable crimping pliers.

I’m going to make up three leads.

  1. 9V Battery Snap to 2 Pin Female DuPont;
  2. 2 Pin DuPont Male to 2 x 2 Pin DuPont Female (split) Lead; and
  3. Dead Mouse USB cable to 2 Pin Female DuPont (5.1V).

I’ll treat each of these as separate projects so that you can refer to them more quickly if you need to.

I’ll litter the Internet with photos of each of the steps so that you can follow the projects as easily as possible.

Stuff that I recommend that you have for these projects:

  • Scalpel – used for tidying up the wire insulation so that it fits nicely into the pin housing;
  • 8 x 2 pin DuPont housing;
  • 6 x DuPont Female connectors;
  • 2 x DuPont Male connectors;
  • DuPont crimp pliers;
  • Solder;
  • Soldering Iron;
  • Red and Black (or whatever combination) jumper wire;
  • Shrinky wire insulation;
  • Wire Strippers;
  • Wire Cutters.

You can usually buy a couple of hundred male, female and 2 pin housings on eBay for a couple of dollars.

Each project only takes a couple of minutes to complete, so you can get a good result pretty quickly and end up with some versatile jumpers and connectors for your projects for a little effort.

So far, I’ve made these up for Arduino projects, simple power connections for solderless breadboard projects, power connectors and links for PCB projects.

I’m going to start the first project tonight, so I’ll post part 2 of this article after I’m done. As I said, I’ll take plenty of photos as I go.

Paypal Donations

Donations to help me to keep up the lunacy are greatly appreciated, but NOT mandatory.