2
\$\begingroup\$

I have a small project for part of an experiment where a PWM controlled DC fan speed will be controlled by a -10/+10V function generator's analog DC output. So basically the chain will be:

Analog voltage------>PWM------->Buffer------>PWM TTL input to the FAN

To convert analog input to PWM I use Arduino Nano as a micro-controller board. I map 0-5V analog input voltage at A0 pin to a PWM pin duty cycle where I set the PWM freq. to 25kHz. I might not need the transistor buffer actually but I don't want to risk the uC.

Below schematics diagram shows the plan in my mind:

enter image description here Left-click to enlarge

I want to power the Nano through its Vin pin by a 12V power supply named as PSU circuit in the diagram above. 5V linear regulator provides power to the buffer.

But since people will use the function generator as input, I need to protect the analog input A0 of the Nano from reverse polarity and maximum limits. For reverse polarity a 1N4148 D2 in the diagram is used. 1Meg R7 resistor is for preventing floating in case there is no input connection. And for limiting the max input voltage I plan to use a 500mW 5.1V zener Z1 in the diagram along with a 220 Ohm series resistor R1.

The Nano uses ATmega328P. I couldn't figure out the maximum analog input the uC can handle. If there is no other fundamental problem, would a 5.1V zener be fine for the analog input pin?

Edit:

I needed to make an edit with a new alternative after Jack Creasey's answer:

enter image description here

Edit2:

Inverted

enter image description here

\$\endgroup\$
  • \$\begingroup\$ The ATmega328P data sheet describes the ADC characteristics on p.265. Seems like 5.1V zener should be good enough. You should take care that your signal generator can output enough current when the zener goes into reverse conduction mode. \$\endgroup\$ – ZelmaB Jul 16 at 15:21
  • \$\begingroup\$ You didn't quite follow what I proposed it seems. You should make R1 20k ohm IMO. There is no need to allow such high current to flow to/from the power supply with the 220 ohm resistor. R3 serves no purpose to prevent floating input. The resistor need to be on the input. The choice of the LT1490 is a good one since it already has excellent input protection. Apart from the changes suggested, what you show will work well. \$\endgroup\$ – Jack Creasey Jul 16 at 22:27
  • \$\begingroup\$ The fan type you used here (San ACE 120) is very indicative of the problems I showed with the PWM signal. See here: farnell.com/datasheets/886393.pdf The details here clearly show that trying to pull up the PWM signal (with more than just a resistor) may indeed damage the fan. \$\endgroup\$ – Jack Creasey Jul 16 at 22:40
  • \$\begingroup\$ @JackCreasey Did you mean R2 should be 20k instead of 220 Ohm regarding here i.stack.imgur.com/YEM5q.png? You wrote "You should make R1 20k ohm" I think you meant R2 in my drawing (?) \$\endgroup\$ – user1999 Jul 17 at 10:25
  • \$\begingroup\$ @JackCreasey Here is my last verison i.stack.imgur.com/aQQxN.png I made the changes and also inverted. \$\endgroup\$ – user1999 Jul 17 at 10:31
3
\$\begingroup\$

Would this circuitry work with 5.1V Zener diode to protect a Nano input?

Short answer: NO

A Zener is crude when it comes to use as a clamp, and the voltage variation will impact the A/D conversion on your Arduino Nano.

A typical Zener such as this has a range of voltage from 4.85 - 5.2 V for a nominally 5.1 V Zener. At 5.2 V you will already have significant current into the Nano intrinsic diode on the supply side.

If you want to protect the input then use a device such as the TLV6001 to buffer the input signals.

schematic

simulate this circuit – Schematic created using CircuitLab

The TLV6001 is rated for rail-rail operation and so allows the full range of A/D input ...in addition it is rated to carry 10mA in the input protection diodes. This would allow the configuration above to withstand voltages of +/-200 V on the input resistor R2 (providing your resistors are rated for this voltage).

Since the TLV600 is powered by the Nano +5 V supply it cannot produce an output voltage above 5 V or below 0 V, so the input is accurately clamped WITHOUT impacting the A/D range at all. You must make sure that your MCU solution is always drawing a minimum current greater than your expected protection current (this is only an issue if you put things into a sleep state).

Note:
While not asked as part of your question ….you are NOT driving the PWM fan correctly. You should NOT provide active pullup to the fan unless the datasheet specifically says you can.

You need to read and understand the specification for the 4-wire fan you are likley using.

Probably the best historical document describing the fan spec was produced by Intel on Formfactors.org, that site is long gone but you can get the document here. In this document the PWM freq is stated as 21-28kHz and the PWM drive signal MUST be an open collector/Drain drive (in other words a pullup resistor or active pullup was NOT permitted). The voltage on the PWM pin was no more than 5.25V, but this was set by the fan ....not the driving elements.
In some fans available today, if you actively pullup the PWM pin or connect to two fans you will get the wrong speed. Most of the early fans had a limited low speed range too, with 20-30% full speed not unusual. In the worse case you may actually damage the fan with a high current pullup as you have it.

Things have changed over the years and many fan manufacturers have improved their specifications. One example here for the Delta fans which can use a PWM freq of 30Hz- 30kHz, tolerates active pullup and 10V PWM amplitude. Arctic fans are another example, with their own specification for multiple fans (up to 4) on one PWM signal line.

The correct way to drive the fan PWM is like this:

schematic

simulate this circuit

Driven as shown above you would not need the extra regulator or the buffered driver you created.

Warning: One answer on this thread says it's quite ok to use the Absolute Maximum rating on the inputs. THIS WILL RESULT IN DEVICE FAMAGE. The warning in the datasheet is clear:

enter image description here

For example, in the operational characteristics for the A/D inputs the datasheet shows the input voltage limits as Gnd and VCC. See Table 21-10.

enter image description here

You should never design to use the intrinsic diodes to clamp the input excursions. While Microchip don't have any clear characterization of the input protection you might find this helpful reading to understand the problem.
You may already know that the output current for I/O pins is limited, and for a group of pins you should not exceed 60mA total ..this is because you risk blowing a track on the chip. I would fear the same may apply to the input protection (intrinsic) diodes, and if you have excessive current you may permanently damage the device. In any professional design you should not be depending on the protection of these diodes. You should externally and accurate clamp all inputs (and outputs) especially if your design is subject to abuse (such as students).

\$\endgroup\$
  • \$\begingroup\$ Many thanks for your detailed answer. I just modified and added the new schematics here: i.stack.imgur.com/YEM5q.png I made a buffer at the inout as you suggested. I have another rail to rail opamp LT1490 in hand(I also need DIP package). analog.com/media/en/technical-documentation/data-sheets/… So for reverse polarity I used two 1N4148. I guess I can supply this buffer from the Nano's 5V DC output. For the drive side I can use 2N7000 MOSFET with gate resistors. Hope it looks better now (?) \$\endgroup\$ – user1999 Jul 16 at 19:37
  • \$\begingroup\$ (I think R3 is in wrong place. I should have put it at the very inout I guess to prevent floating) \$\endgroup\$ – user1999 Jul 16 at 19:41
  • \$\begingroup\$ There's also some more info about driving on page 351 (page 5 of the pdf) here: sanyodenki.com/archive/document/product/cooling/… \$\endgroup\$ – user1999 Jul 16 at 20:08
  • \$\begingroup\$ And here another one newark.com/pdfs/datasheets/Sanyo_Denki/… At last page shows PWM connection. Can this be open collector as well? This is also same brand but it can slow down to zero unlike the other fan, \$\endgroup\$ – user1999 Jul 16 at 20:18
  • \$\begingroup\$ @user1999 I think you have improved the schematic greatly. Well done. That last link can be run open drain/collector as shown in the circuit portion. They seriously confuse the issue with the 4.2-5V recommendation since that can only work if there is a series resistor. Many fan manufacturers make this same simple mistake in the specification. Notice that they say if the PWM signal in open circuit the fan runs at full speed. I'd suggest if you measure the voltage on the PWM wire when open circuit it will be about 1V. \$\endgroup\$ – Jack Creasey Jul 16 at 22:51
1
\$\begingroup\$

Page 258 of datasheet you linked says: Maximum voltage on any pin except RESET with respect to ground VCC+0.5V

So it is ok, I hope speed is not a problem, remember that diode behaves like a capacitor, and as you see it is in parallel with a resistor.

\$\endgroup\$
  • \$\begingroup\$ NO NO NO ….the Absolute Maximum rating say use at this level may lead to device damage. Very poor answer. \$\endgroup\$ – Jack Creasey Jul 16 at 17:50
  • \$\begingroup\$ @JackCreasey What is the value of Vcc here? In my case Vin will be 12V. So will Vcc be 12V as well or Vcc is always 5V? What is meant by Vcc here? \$\endgroup\$ – user1999 Jul 16 at 18:32
  • 1
    \$\begingroup\$ The MCU VCC which would be a maximum +5V or 3.3V depending on your Nano type. \$\endgroup\$ – Jack Creasey Jul 16 at 18:34
  • \$\begingroup\$ @JackCreasey Thank you. I'm trying to edit my question and will come back to your answer soon. I will update the circuit with an alternative rail rail opamp buffer and now Im looking for DIP type also will sim in LTspice. I will also provide more info on the DC fan PWM input. \$\endgroup\$ – user1999 Jul 16 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.