Review of schematic

I don’t use the Pi but, correct me if I’m wrong, doesn’t it already include this circuit?

2 Likes

Hm… you’re right. doh
Must have grabbed that of suggestions for the older ones.
:frowning:

Smart dudes.

1 Like

I think it is missing from the Pi Zeros but as far as I know the rest of the Pis include it.

Edit: Is it Pis or Pies? :worried:

1 Like

Thanks. Can I assume that is all Zener diodes to be replaced by regular diodes (or just the microswitch diodes)?

I do not know what other circuitry connects to those connectors. But those diodes appear to be used to pull the GPIOs inputs low, in which case yes, you would want to replace them with regular diodes. You might also want pull-up resistors on the GPIO pins (unless the Pi has internal pull-ups).

1 Like

Hi

Attached is a revised circuit with changes as suggested. I hope I have implemented these as you conceived them. Not sure if I got the concept of the labels and GND, PWR connections right but I took a shot. It seems more readable to me already.

Of concern:

  1. I’ve had some issues with current coming back from the stepper drivers and want to protect my Pi.
  2. Is it worth trying to protect the Optocoupler from issues with the microswtiches? Zener diode in the previous circuit.
  3. Is is better to use a single Optocouplers for each connection or ok to group them (4 inputs)?
  4. Not sure how to select diodes or transistor values.
  5. Tried a fan speed control circuit for 2 wire fan (perhaps a better method)? Perhaps just leave pads and solder in resistors as needed?
  6. Is it worth leaving any pads/holes anywhere? In case of some future needs/changes? As a newbie its hard to know what to anticipate.

I still can’t post to the forum so here is a link to the revised PDF.

saw_v2_.pdf

May I suggest a flyback diode on each relay coil command. See https://en.wikipedia.org/wiki/Flyback_diode for more details. This will protect your command transistor from surges due to an inductive commutation.

Second point LED1 to LED4 have both connections on the same net which is probably not what you want (at least if you want to light up the LED).

1 Like

5 posts were split to a new topic: Dropbox links for new users

There is a wrong junction at J3 / J4 shortening all pins.

Avoid crossing pins with a wire not connected to them. The connection between J3 pin 2 and J4 pin 2 crosses J4 pin 1. That’s why the junction got there in the first place.

1 Like

The two regulators still don’t have proper reference designators and … both of them are to feed the same net (+5V) ?

I suggest junctions in situations like below for readability. There are many instances of that in the schematic.

2 Likes

Hi @ahacking

Check the buzzer circuit. You have 5V connected directly across C-E of the transistor. And depending on the value of R21 and the characteristics of the buzzer, the buzzer will be permanently on or off.

3 Likes

You had flyback diodes in your original schematic, put them back. :slight_smile: The LEDs should be in parallel with the relay coil in series with a current limiting resistor, be careful to observe the polarity of the LED.

While 1K is usually a safe value for the LED’s current limiting resistor in a 5V circuit, you might want to calculate a more optimum value depending on the LED you plan to use.
To do this use:

R = (Vsupply - Vf) / If, where:

Vsupply is the supply voltage
Vf is the forward voltage of the LED
If is the forward current of the LED

Choose a value for If that is slightly less than the LED’s “Absolute Maximum” to allow for tolerances etc, or even less if you don’t need the LED to be it’s brightest.

So for an LED with a typical Vf of 2V and an absolute maximum If of 20ma you could use:

(5V - 2V) / .015 = 200R

This is usually done with clamping diodes.

Probably not if switches will be the only things connecting to these optos, powered by the 5V at the connector. The series resistor already offers some protection.

Individual optos can sometimes make routing the PCB easier but otherwise it doesn’t really matter. Quads lower the parts count, occupy a little less space and probably cost less.

I would look at an NPN transistor array to drive your relays and buzzer such as a ULN2003 or ULN2803 they even include the free-wheeling (flyback) diode. I think the optos you have driving your relays are a bit of overkill.

For diodes it depends on the circuit, but in general the main parameters you care about are Vr, Vf, If. But I think most of the diodes you have connecting to GND and 5V are a bad idea.

Controlling fan speed, while possible with a series resistor, is usually done using Pulse Width Modulation (PWM). Does the Pi have a timer that can be used to generate PWM? A series resistor will usually dissipate a bit of heat.

The connectors you have for the DRV8825 are only 16 pins in total, are these not a socket for the DRV8825?

I think you need a bit more work on separating the Pi GNDs and 5V from the rest of the circuit. Where is Pin 6 of the Pi connector supposed to connect? You also need a bulk capacitor (100uF) on the second regulator. I would also have a zener on the input to the second regulator.

That should be enough for now. :wink: Sorry, didn’t realize how long this post was getting.

1 Like

Thanks!!! Will address shortly.

Thanks! Changes made.

Is this not a bit much current? (Admittedly i need to use as little power as possible in my applications. So i tend to use only leds that work well with very little current consumption.)

I use the following values for my leds. (Found experimentally to get them bright enough)

3V3: 1k to 3k3
5V: 3k3 to 5k6
12V: 5k6 to 15k

These values work well for the following smd leds found over at farnell
2322076; 1716767; 2217985
The led 2335811 is quite dark with the values given above. (I need to find a new red led that behaves better at low power conditions.)

My advice would be to simply test what resistor works well for the leds used. Just use a constant voltage source and a bunch of resistors to play around a bit.
Start with the resistor you calculated and increase it until you think the led is now too dark. I would take the highest value that has enough brightness.

1 Like

It’s not too much according to the LED’s specifications. It might however be too much for your application depending on your power consumption and brightness needs. The value I calculated would be a maximum current/minimum resistance.

The other parameter to consider is luminous intensity, LEDs vary quite widely in terms of efficiency. Some are not so bright at max rated current while others would light up the room.

1 Like

Perhaps the major part of any design activity can be described as “evaluating tradeoffs”. (And they are not always technical tradeoffs.)

I design common LED indicators to run at about 10 mA of forward current. Less than that if I must conserve battery capacity; a bit more if it must be visible under bright, outdoor, lighting conditions. (And then there are the cases where your nit-picky, fuss-budget boss wants the red and the green LED’s to have “the same brightness” . . . . )

In some shops you may be required to operate components at less than some specified backoff from their maximum ratings (e.g., no more than 75% of maximum current, voltage or power rating).

Dale

3 Likes

Concerning your U1 optocoupler cabling, you might have forgotten to adapt the transistor side after a X mirror.
ie: putting 5V on the emitter is strange.
Best case scenario: error prone
Worst case: not working at all according to what is on the collector side.

I recommend you this kind of design that are well known. This will also help the reader to easily understand your design goal and avoid confusion. This is not mandatory but it really help when working with a team.

2 Likes

Thank you. I will make these changes as well.

Hi Joan,

Just finished the special symbol…I think. I actually created a new component. Was this the approach to take?

Thanks

Adam

1 Like