Kody's Build Log

This video made me think of this discussion:

3 Likes

Quick update here about my Power Supply project and an intro to the project I’ll be doing to wrap up Part Two of Learning the Art of Electronics.

Part One Project/Power Supply
So after reading all your comments, thank you very much, I believe that I understand the results I got while evaluating the project with the AD3 and my multi-meter. The distorted ‘sine wave’ I got from after the transformer is expected from a small transformer like the one I am using just because it is being pushed into saturation. It was interesting to see and learn about that signal was since I did not expect it when I started the project.

This project will be improved upon by adding voltage regulation around the middle of December when I finish the chapter on Voltage Regulation. I could probably put something together now, but I want to try and stick to the schedule I have created.

Part Two Project
To cap off part two (transistors) of Learning the Art of Electronics I decided to edit a circuit given in Art of Electronics on page 124. The circuit given there creates a thermistor control for a large heater. My circuit instead is designed to turn a light on when a photo resister ‘tells’ the circuit it is dark and to have the light turned off otherwise. Another note is I plan to power this with a 3V coin cell.

Below is the schematic I have made for it.

I have tested this circuit on a breadboard and it appears to work how I intended. The little test ports I have scattered around is to allow for testing by the ppk2 so I can see the current in multiple areas.

Now while the circuit works (at least when tested) I am still a bit concerned about my understanding of it. Please bear with me as I attempt to explain how I think the two different modes of operation work

First of all is that R1 sets the current that must come from the rest of the circuit and through Q6 because of the current mirror it is a part of.

LED Light Off (it is in a well light room)
The Voltage seen at the base of Q3 is above 1.5V, Q2, and Q1 are in there active mode, Q9 and Q10 are off and current is being supplied by both sides of the comparator.

LED Light On (it is in a dark room)
The Voltage seen at the base of Q3 is below 1.5V. This results in little to no current coming from Q3 and Q4. It also results in Q9 and Q10 being saturating and pulling the collector of Q1 to about 1.8V. Most of the current comes from Q9 and Q10 to meet the required current set by R1 with the current mirror.

Q9 and Q10 being saturated is what results in the LED receiving current and lighting up.

Now that my attempted explanation is done I wanted to point out an issue I have with my own circuit here. To me it seems like I do not have enough voltage for the diode drops of the transistor. Now maybe I am thinking about it wrong however to me it seems like I should run out of voltage at certain points.

For example if Vbe of Q7 is 0.6V and Vbe of Q8 is the same should I not have only 0.3V left? The simulator says there should be 0.6V to 0.8V but I think I must be missing something.

Lastly I’ll share a screenshot of my PPK2 readout of when I turned off a ‘random green LED’, and a youtube short of the circuit in action.

Thank you all for any and all help/clarification.

Very nice work!

I recommend looking at the transistors Vce as well. For example, the 1.5V goes across the Vbe of Q7, then Vbe of Q8, and then Vce of Q6. Depending on Vb, Vce can be as low as ~0.2V and as high as 40V for a 2n3904.

1 Like

Are you using darlington pairs for any particular reason? They are great for applications in which you need to use very low currents, but as you’ve discovered they also introduce larger voltage drops. Vbe for the pair is double that of a single transistor, and the output transistor cannot saturate so its Vce is much higher than that of a single transistor. Both of these make low-voltage operation trickier to achieve (though not impossible).

1 Like

Honestly the only reason I am using a darlington pair is because the on page 124 of Art of Electronics used a darlington pair and I based my circuit on that circuit.

I am thinking that what I may do is order two different PCBs one using the darlington pair and one with just the one transistor on each side. I am thinking these PCBs are going to be small anyways so it may be a good opportunity to compare the different circuits.

Hey, that’s okay. I also copied circuits when I was starting out, and AoE is a much better resource than what I had over 50 years ago.

A post was split to a new topic: Simulating noise in Falstad

Just finished adding a linear regulator to my power supply project.

I wanted to make it an adjustable power supply with the range targeted around 3V to 9V. The breadboard version came out to be 2.7V - 9V.

When decided what regulator I wanted to use I started by looking at the ones I had in stock which was the LM317, MCP1700, and NCV2931CDR2G. I decided on using the LM317 that I have in a big TO-220 package. The MCP1700 was a fixed voltage regulator and its max input was 6V (my input is around 9.5V). I think the NCV2931CDR2G was in a smaller package that couldn’t take the worst scenario power dissipation.

I added a new voltage test point after the regulator and one current test point to see how much current comes from the adjustment/setting circuit.

The potentiometer goes from 0 to 10k. I found the resistor values (2k and 2.2k) after fiddling around with the equations a couple times.

I have not updated the text on my schematic yet but I am thinking of removing some of it and making a markdown or latex file to store in my GitHub with the KiCAD files.

In addition to adding the regulator while I was at it I decided to add a few copper pours to hopefully make the currents happier.

The GitHub I made to store all of the projects I make while working through Learning the Art of Electronics can be found here: GitHub - PhysicsUofRAUI/laoe_projects: A place to hold all projects I have made while reading the book Learning The Art of Electronics.

I just finished up the layout for a new board at work using a fully supervised loop.

I’m wondering about the following things:

  • The dual power supply (5V and 12V) did I execute that fairly well?
  • The sinking or blocking from the logic gate. That signal (to the optoisolator) could be sent along a 300ft wire and I am a bit worried about noise creating enough current through the optoisolator to set off the siren. The siren is the ‘buzzer’ on the bottom schematic.
  • Other than that this is one of my first OpAmp based circuits and my very first logic circuit so any other comments are appreciated.

Here is how the shown PCB ties into the rest of the system.

First time looking at this…

  1. where does +5V on the cathode of the optoisolator diodes come from? Is it provided over the same 300ft wire as the output from the NAND gate? I’m thinking about the effect of voltage drops and common-mode noise.

  2. given the long 300ft of wire on the output of the NAND gate, I’m concerned about potential transients and damage to the NAND gate and wonder if a robust analog driver / transistor would be better. The input of the opto-isolator may be relatively low impedance but if will only have an effect when the opto boards are connected.

I suspect in normal operation any noise on the 300ft wire will probably not have enough power to light the LED in the opto-isolator so not an issue.

Fwiw, current loops were originally used for long runs because it avoids voltage noise. E.g. standard 4-20 mA loop, 4mA could mean alarm, 20mA could mean no alarm, and 0mA means there’s a broken wire (which can be sensed at either end). If you’re sending +5V to the opto board, I think you have enough wires for a “loop-powered” system (the voltage source for the loop can power the current sensing circuit and the opto driver so long as it draws less than 4mA). Does make a more complicated system though…

Hope this is of use (nothing can be inferred from not commenting about something :wink: )

Cheers,
Dale

1 Like

Thanks for the reply.

The 5V on the opto-isolator comes from the 5V rail over that 300ft wire (that is a bit of an overestimation on length, but I figure it is better to overestimate) and then when the gate output is set low the LED should turn on starting the siren.

I really do like the idea of using a transistor at the output (not sure why I didn’t in the first place) because that NAND gate would be close to the maximum current it could sink while low.

Is the below schematic sort of what you were suggesting (not some of it is cropped but it is the same as the original in those places anyway)?

On the main station board the siren pcbs would still be connected twice (to ground, and then to the collector of the pnp transistor).

The transistor is slightly better, but is not really providing significant protection for the LVC gate against transients on 200-300 feet of cable “in the wild”. I’d suggest proper protection with some combination of resistors TVS diodes, capacitors, etc.

2 Likes

Iiuc, the concept is to drive the transistor from the NAND gate and the transistor then drives the 300ft of wire. Are you thinking a transient on the wire (perhaps a big motor nearby turns On, or there’s a lightning strike nearby) will cause C-B breakdown of the transistor and the high voltage will then damage the output of the NAND gate?

Btw, I’m thinking 300ft of wire on the +5V could cause similar issues wrt transients, except all the electronics would be affected not just the output of the NAND gate. IIuc…

Agree fully.

1 Like

Exactly.

Absolutely. Also via the C-B junction and through the IC’s output stage onto the rails.

In addition to the grab-bag of parts I mentioned, a C-M choke might be considered.

2 Likes

Thanks for all the replies!

I’m going to go do some research and report back with a circuit with more transient protection. I have heard of TVS diodes and that but haven’t used them before. The most circuit protection I’ve used previously is a diode clamp like what I have at the top of the diagram where the voltage signal comes in.

What would be good resources to consult?

Here are some app notes, found by searching “TVS diode appnote” :slight_smile:

Note the difference between unipolar and bipolar TVS.

https://www.littelfuse.com/assetdocs/tvs-diode-overview-application-note?assetguid=26685cec-30be-4b68-b9f2-6956384c9129

1 Like

Awesome.

I was able to find a couple too. I’ll be doing some reading next week or maybe tomorrow if I have time.

Thanks!

1 Like

This is a really good series by Keith Armstrong - “Essential PCB design/layout techniques for cost effective SI, PI and EMC”. You need to be a “member” to download, but it’s free.

https://www.emcstandards.co.uk/essential-pcb-designlayout-techniques

1 Like

Thanks for all the advice. I have done some reading and came up with this:

D4 is 1N6271A-E3/54 from vishay. Its clamping voltage is 14.5V and its reverse standoff voltage is 8.5V.

The PNP transistor is going to be a 2N3906 with a collector emitter breakdown voltage of 40V.

I will say that one thing I know I’ll have to look at is whether the resistor going into the optocoupler will need to be changed because of the inclusion of the transistor.

I finished the evaluation of the second version of my power supply and found two design flaws with it.

Review:

Here is the schematic:

And here is the pcb layout.

The difference between this version and the first version is as follows:

  1. I fixed the footprint for the rectifier.
  2. I added a voltage regulator.

Results

Mistake One

I found that the regulator does not put out the right voltage when no load is attached. The reason for that is because I neglected to give the LM317 a minimum load current.

I plan to fix this mistake by moving my ‘on’ LED to after the regulator and making it supply the minimum current of roughly 1.4mA (figure 6 of the datasheet).

Mistake Two

Not giving enough of a voltage difference between the unregulated and regulated voltage. This resulted in the regulated voltage having a ripple the same as the unregulated voltage.

Page 7 figure 4 shows the drop out voltage with respect to temperature and for the current I plan to draw the drop out voltage is right around 1.5V.

I am not entirely sure how I will fix this problem. Either I will reduce the output range or change the transformer to one that outputs a higher voltage.

Mistake Three

The AC connections are exposed and a viewer of my youtube channel suggested that I use a connector that does not leave those exposed for safer operation. I guess this is not so much a mistake as a suggestion, but I am considering taking his advice.

Related documentation

LM317 Datasheet: https://www.ti.com/lit/ds/symlink/lm317hv.pdf

Conclusion

I guess this experience really just goes to show one should carefully read and think about the values in the datasheet before design. It was nice to find those flaws though.

On a unrelated note I am going through the labs in the last part of Learning the Art of Electronics (micro-controllers) and have started to use the CH32V family. If anyone has some advice while learning that family I would be happy to hear about it. I plan to re-read the posts on this forum that was about it, but always would like more resources.

1 Like