Showing posts with label LM7805. Show all posts
Showing posts with label LM7805. Show all posts

Tuesday, 14 October 2014

Prototype Embedded Electronics – Together

Now that I have completed the three circuits that I had planned to embed in the Steam Punk prop (Torch, Pulsing/Fading LED, LED Chaser) it’s time to put them together in a single main/sub configuration as they would be in the prop. I had to cheat a little here … I couldn’t find one of my male to male DuPont connectors and, rather than make a new one, I opted for the easier option of replacing the 2x2 SMD circuit with the 4 x 5 LED “Desk Light” circuit. In terms of testing the components together, this should really have no practical impact on the outcome. Sure, they are through hole components … and a lot more of them, so the only real difference from the perspective of testing the overall concept is that it will draw more power from the battery. In the embedded scenario, I need to rebuild ALL of the component circuits, so there really isn’t anything lost there.

I have connected a 9V battery to my trusty solderless breadboard and then connected each of the components to the power rails. The Torch and Pulsing/Fading circuits are connected to the 9V directly, whereas the LED Chaser is connected to 9V via a 5V Regulator (I opted for an early version of this as I didn’t need the optional LED power indicator).

The result is as expected … it all works just dandy. I should probably go ahead and work out power consumption so that I have an idea of how long the battery will last in the prop. I’m still toying with the idea of also embedding a battery charger circuit … but it is easy and cheap enough to use a commercial – “off the shelf” charger so I’m not going to bother with that … yet.

There are still more tweaks and optimisations that I am planning, but that’s for later.

I present to you the prototype embedded electronics of the Steam Punk prop …

Fiat Lux

Combined embedded electronic circuits for a planned Steam Punk Cosplay prop

Wednesday, 8 October 2014

Putting the Electronics together – Planning

The main reason that I’ve been tinkering with electronics is my longer term goal of embedding some interesting lighting effects into a Steam Punk prop. That was where all of this started.

Now I have some decisions to make about which lighting effect circuits I want to include.

I want:

  • A pulsing/fading light acting as a power indicator and with a cool translucent – through hole cover (i.e. the Mac power indicator);
  • Chasing lights to come on when the trigger is pulled; and
  • A torch-light at the front of the prop

I’ve done a couple of pulse fade circuits, all with varying degrees of success (well … appearance). My two favourites are the 9V PUT transistor pulse fade that I found in the Make! book and the ATTiny85 pulsing LED that I modified from the Arduino as ISP sketch. The PUT version is neat and quite cheap, it doesn’t require any expensive parts (relatively), the most costly part is the PUT transistor (2N6027), but, at around $0.27AUD per transistor, I can live with that, this pushes the PUT version to around $0.73 per board. The ATTiny85 version has far fewer parts, but the ATTiny85 is much more expensive than a PUT transistor so it ends up costing around $2.48AUD.

The Chasing Lights is a bit of a no brainer, I’m going to go with the ATTiny85 + LED Sub-board option. The total cost of the board and sub-board comes to $4.37AUD.

Finally, I’m going to rebuild the 2x2 SMD LED Matrix project and change the layout a little. This was a great learning circuit for a couple of reasons and at a cost of around $0.49 it’s nice a cheap too!

There are a couple of additional costs, such as switches. For the chasing lights, I’ll either use a momentary switch or a lever switch, which way I go is going to depend on the way that I design the trigger for the prop. Apart from that, there’s about $1.00 worth of wire.

So, the embedded electronics come in at (PUT) $6.59 or (ATTiny84) $8.34 … plus the switches.

Electronics Block Diagram

The above block diagram shows the overall design using the ATTiny85 Pulse/Fade component while the one below shows the overall design using the PUT Pulse/Fade component.

Electronics Block Diagram - Alternative Pulse

With the PUT Pulse/Fade, I’ve dropped a switch and put the SMD LED onto the 9V power source, rather than the 5V regulated power source.

My next step from here is to put these circuit boards together on a prototype “board” to test the overall concept.

9V to 5V Regulator with Indicator LED

Well, I was going to call it a night a couple of hours ago, but I decided to make the new 5V Reg board.

This is pretty much the same design as the previous 5V regulator, it still uses an LM7805, still has one input but now has two outputs … mostly for mechanical stability when connected to a solderless breadboard. I have added a LED (and resistor) into the circuit so that the LED lights up when connected to power.

5V Reg with LED - Etched

Here is the copper side of the board. it’s now 20mm x 25mm, so it’s bigger than the previous version. The increase in size is to accommodate the additional output pin header, the LED and the resistor.

5V Reg - Idle

When the power is disconnected, the LED (and the circuit) is idle.

5V Reg - Powered

Connected to power, the 3mm LED lights up.

I’ve tested the two pairs of output pin headers and they show 4.98V, the input pin header shows 8.96V, so it doesn’t look like the LED is affecting the output voltage (of course it shouldn’t) this just means that the battery will not last quite as long … it should still last a long time though, the battery is rated at 200 milliamp hours, the actual bleed time is dependent on the load amps. Either way … new power regulator … cool!

Here’s the evolution of the power regulator so far:

1st version of the regulator board …

9V_5V_VoltageRegulator_01

2nd version of the regulator board …

New Version 9V to 5V Reg

Current version of the regulator board …

5V Reg - Powered

There’s still room for improvement for the board, I could go SMD and try to make it smaller, but then, SMD electrolytic capacitors aren’t much smaller and a SOT LM7805 isn’t that much smaller either … I think that I’m happy with the design as it is at the moment.

Tuesday, 7 October 2014

ATTiny85 Shift Register – Etched Boards

Okay, so I’ve etched the boards for the ATTiny85 + Shift Register and the LED + Resistor sub-board.

ATTiny85 and 74HC595 - Etched

This is the main board, top left is the ATTiny85, middle is the 74HC595 and the row of 9 pins at the bottom is the interface to the sub-board.

This went fairly well, I tested all of the traces and found that the board measures up OK.

LED Sub-board - Etched

And, above is the sub-board with LED and SMD (0805) resistors coming in to two pin headers (4 pin and 5 pin) for the interface to the main board. As you can see in the picture, there is some misalignment in the transfer. This happened because I needed to overprint the board (the first run with toner transfer didn’t work very well). It also lead, more seriously, to three points on the board where the misalignment resulted in bridging. All of the bridges occurred on the SMD pads. I cut the trace with a scalpel and the scraped off the copper to make sure that the bridge was removed.

After testing the modified/corrected board with the multimeter on continuity, I found that I had eliminated all of the bridges and there were no gaps in the trace that would cause the board to fail.

Next, I’ll be drilling and filling.

Finally, here’s another 5V regulator (LM7805) circuit with a power indicator LED and resistor.

5V Reg with LED - Etched

This is just the same as the last one with two modifications:

  1. I’ve added a second set of pin headers to improve the mechanical stability of the board when it is plugged in to a solderless breadboard; and
  2. LED and resistor (far left in the above image).

Well, that’s it for tonight. Good luck and happy soldering!

Wednesday, 1 October 2014

9V to 5V Regulated Power Supply – Revisit

Just a quick revisit on the 5V Regulated Power Supply circuit. When I made the previous version I oriented the output pin header facing up. This was done so that I would be able to componentize the circuit within other embedded projects.

After using the circuit a couple of times with solderless breadboard prototyping for the ATTiny85 IC, I realised that I had missed an opportunity. With the output header pins facing up, I had to use a female to male DuPont wire connector to connect the circuit to the solderless breadboard. If I were to change the orientation so that the output header pins were facing down, then I could connect the circuit directly to the solderless breadboard without intervening jumpers.

I made another of these handy little circuits and soldered the output header pins to the bottom of the PCB. There were no other changes made to the PCB at all, nothing!

New Version 9V to 5V Reg

After soldering it up, I gave it a test. Connecting the regulator to the solderless breadboard and a pair of jumpers on the +/- rails of the board and then to the multimeter on 20V power measurement, the regulator gave me a steady 4.98V (0.996 below 5V) so the circuit still works just dandy.

Then I connected a load circuit to the jumpers (again, my “go to” load circuit, the 2x2 SMD LED matrix), and of course it works just peachy. With the same voltage reading as the other circuit, I figure that there isn’t much need to do any more testing than this.

Job done … yay!

I could probably improve this design by adding another pair of header pins in front of the existing output pins. These additional pins would only be soldered to copper pads and are not part of the circuit, but would improve the mechanical stability of the sub-board when plugged in to the solderless breadboard.

Thursday, 11 September 2014

9V to 5V Voltage Regulator – PCB

In my previous article (9V to 5V Voltage Regulator Plan) I was working on making a small, discrete 5V power regulator with a 9V input voltage. Today, as I had some etchant going to waste, I decided to make this handy little circuit.

I started with toner transfer and then etched the board. After cleaning off the toner and drilling the through-holes, I printed out the silk and glued it to the top of the PCB and set to populating it.

The circuit uses:

  • 1 x LM705;
  • 2 x 100nF electrolytic capacitors;
  • 4 x pin headers
  • 1 x 18mm x 20mm FR4 single sided copper clad board

The soldering was very easy on this board, while it is a little cramped, I started with the pin headers, then the capacitors and finally the regulator.

9V_5V_VoltageRegulator_01

The input is at the back of the circuit and the output is at the front. I’ve labelled the +/- of the input/output as well as the expected voltage.

The datasheet for the LM7805 says that the input voltage range is 5V to 18V, but the goal for this little circuit is to be embedded in other devices that will have a 9V battery … so I’ve labelled it 9V. If you wanted to use this circuit with other voltages, please be sure that you read and follow the data sheet for the LM7805 (from www.fairchildsemi.com).

As I don’t have my multimeter with me, the only real test that I can perform is a voltage output presence test … that is, if I plug in a battery at input and a load at output, does the load circuit work.

As is fairly usual with my testing, I use my 2 x 2 SMD LED circuit as the load. I plugged in the battery and the load circuit and … light!

9V_5V_VoltageRegulator_02

I will do some actual voltage tests on the circuit next week when I am in the same state as my multimeter. For now, that’s job done.

This circuit will normally be wired up to feed power to a solderless breadboard when I need a regulated 5V supply, such as when I am testing my ATTiny84/ATTiny85 circuits. I’ll probably make a 3.3V version at some stage, but for now I don’t need one.

Here it is connected to the previously programmed ATTiny85 again, feeding the 2 x 2 SMD LED circuit.

9V_5V_VoltageRegulator_03

I’ve videoed the LED. This is using a modified version of the pulse function found in the ArduinoISP sketch. The pulse function drives the Heartbeat LED in the source sketch.

9V Battery 5V Regulator – ATTiny85 Power Supply

Oh, and by the way, here is the pulse sketch from the ArduinoISP sketch. The values following the comment (//) are the original values from the Arduino sketch, for reference.

int LED_HB = 0;

//void pulse(int pin, int times);

void setup() {
  pinMode(LED_HB, OUTPUT);
  pulse(LED_HB, 2);
}

uint8_t hbval = 175; //128;
int8_t hbdelta = 16; //16;

void heartbeat() {
  if (hbval > 225) hbdelta = -hbdelta; //192;
  if (hbval < 16) hbdelta = -hbdelta; //16;
  hbval += hbdelta;
  analogWrite(LED_HB, hbval);
  delay(50); //30;
}

void loop(void){
  heartbeat();
}

#define PTIME 50
void pulse(int pin, int times) {
  do {
    digitalWrite(pin, HIGH);
    delay(PTIME);
    digitalWrite(pin, LOW);
    delay(PTIME);
  }
  while (times--);
}

Tuesday, 12 August 2014

Voltage Regulator – Breadboard

Originally, I intended to have two separate projects for voltage regulation (9 to 5V and another planned for 9 to 3.3V), but it turns out that there is very little difference between a circuit for 5V and 3.3V power regulation. The only practical difference is that, if you use an LM7805 transistor you will end up with 5V, or if you use aUA78M33C, that you will end up with 3.3V.

I bought the LM7805 from eBay, and the UA78M33C were purchased from element14. I am fairly happy with the 3.3V, however, it cost more for postage than it did for the transistors (more than $12 AUD while the transistors only cost $8 for 10 of them). Nevertheless, I have them and I’m OK with that.

I used the example breadboard for a power regulator that comes with the Fritzing application, you can go to their website if you want to see the layout (download it, it’s free).

VoltageRegulator_7800series_bb

There are 2 x 100nF capacitors, the Voltage Regulator and some jumpers, this is a very straight forward circuit, all that is happening is that voltage goes in through input (1) and comes out through output voltage (3). The capacitors are there to smooth the flow. I inadvertently used 100µF rather than 100nF, resulting in a lower output voltage (you can see that later). The circuit only ran for a couple of minutes so I wasn’t able to observe the longer term effects of using the wrong capacitance on the V-Reg.

VR_Circuit_Breadboard

I connected the circuit to a 9V battery and measured the output using my multimeter set to 20V.

Here is the multimeter when the circuit is not powered.

Multimeter - No Power

And here we are with the circuit powered.

Multimeter - Powered - LM7805

The voltage fluctuated between 4.96 and 4.97V, I expect that the variation and the <5V result was a consequence of the wrong capacitors.

When the power is disconnected, the delivered voltage bleeds out (as it is stored in the two capacitors). After 3 seconds, the output is 0.09V.

Multimeter - Powering Down - LM7805

I replaced the LM7805 with another from the same batch and got a slightly different result.

Multimeter - Powered - LM7805 - 02

But still in the range.

Then, I replaced the LM7805 with the UA78M33C, powered it up and measured the output again.

Multimeter - Powered - UA78M33C

When I build the circuit in anger, I’ll be using the correct capacitor (tee hee). Overall, this was a very simple experiment and it provides me with the circuit that I’ll need to power the ATTiny84 and ATTiny85 circuits that I’ll be building. The goal is to have a ready regulator circuit that will feed the three ATTiny8x circuits further up the food chain.

Well … actually … I retested with 100nF (0.1µF) and the results were the same. I guess the variation may be in the quality of the capacitor? Either way, I calculate that to be within approximately 1% of the target value (actually 0.6 – 0.8% for the 5V and 0.909% for the 3.3V), hopefully that will be sufficient.

Paypal Donations

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