Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Digital I/Os during power up


  • Please log in to reply
27 replies to this topic

#21 Andrei

Andrei

    New Member

  • Members
  • Pip
  • 6 posts

Posted 02 June 2011 - 07:37 AM

Firstly, thanks to you all. I did not imagine such an active and helpful community. I need a shield which expands the Digital I/O's because Netduino does not provide enough to drive my 16-relay board. Do you know of a shield which expands the Digital I/O's AND solves the problem of the initial power to the Digital I/O's? I know I might be asking too much but it's always better to ask ;-) My friend recommended me a "74HC 3-state buffer". I did do some reading on it although being a complete beginner, I did not understand much. What do you think as a solution?

#22 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 02 June 2011 - 08:48 AM

@Andrei:
I think the best thing is to follow the Stefan's SPI circuit.
It solves several problems at time:
  • it expands your N ports;
  • does not have the power-up problem that the N ports have;
  • no inversion of polarity;
  • it is much faster (thousands more);
  • it is pretty compact and cheap (1-2US$).
What else?

@georgejh:
The main problem of Andrei is that he owns already the relay-shield, so we should find a solution for that shield.
However there are a couple of points that I didn't understand...
  • Why did you connect the Led to the relay? What's the goal?
  • The fuse could be a good idea, but it is not involved in the relay drivers. What's exactly your meaning by adding it?

Furthermore, the PNP pattern is a good choice, but I would suggest to configure the port as TristatePort. That is because is much easier to choose the right resistors. By the way, using a normal OutputPort, an high level is +3.3V, and it would be enough to drive the PNP.
Instead, using a tri-state port, when you set "true", there's no current flowing, so no way to drive the transistor.
Note that by using 12V (or more) relays, this PNP pattern will not fit the target.

About your very nice tutorial, why don't you publish it in the wiki, so many of us can contribute?

Cheers
Biggest fault of Netduino? It runs by electricity.

#23 georgejh

georgejh

    Advanced Member

  • Members
  • PipPipPip
  • 87 posts
  • LocationGlasgow, UK

Posted 02 June 2011 - 12:12 PM

@georgejh:

  • Why did you connect the Led to the relay? What's the goal?
  • The fuse could be a good idea, but it is not involved in the relay drivers. What's exactly your meaning by adding it?


1. It is not about the LED connected to the relay. it is about powering On/OFF anything through the Relay. I used it to illustrate the idea. You can attach anything after the Relay and it will not get power until explicitly you allow this from code. You can attach 5 LED switching schemas plus any sensors etc... just make sure they got their 5V from relay's controlled (not controlling) circuit.
2.Point two gets clear when you have to power more than One LED (as mentioned in point 1). Just protection, nothing more.
3.If needed you can create a shield with PNP and Relay and power the rest of the shields through it.
4.Configuring port as Tristate will not solve the booting problem. This becomes effective only after code is executed. When you power on Netduino, ports going in high state and stay this way until your code not change it. But this could last for ages, even not even get to the code execution. You certainly don't want a devices connected to Netduino to be switched on because of that.
5. In case of higher than 5V power supply only thing you need to do is recalculate the values of R1 and R2 in such manner so to keep PNP closed when port is 3.3V. If difference goes too high, you can use voltage divider and then from the new voltage through additional resistor bias the PNP base.

#24 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 02 June 2011 - 01:12 PM

That's OK, except for point 5.
If you power the PNP stage with a relatively high voltage, you will have two problems:
  • the difference between high and low become too tight, and the resistors become critical/hard to calculate. If the relay uses many current, you may also not reach the transistor saturation.
  • the higher is the PNP voltage, the higher will be the leakage current flowing *continuously* into the output pin. Consider that there is a diode inside the chip to the +3.3V.
  • In case of power over the +5V, I'd suggest an additional transistor stage.
Good job, anyway!
Cheers
Biggest fault of Netduino? It runs by electricity.

#25 georgejh

georgejh

    Advanced Member

  • Members
  • PipPipPip
  • 87 posts
  • LocationGlasgow, UK

Posted 02 June 2011 - 01:32 PM

  • the difference between high and low become too tight, and the resistors become critical/hard to calculate. If the relay uses many current, you may also not reach the transistor saturation.
  • the higher is the PNP voltage, the higher will be the leakage current flowing *continuously* into the output pin. Consider that there is a diode inside the chip to the +3.3V.
  • In case of power over the +5V, I'd suggest an additional transistor stage.


I fully agree with your considerations, but have to say that in practice, when I calculated it for 12V power supply I got pretty standard low resistor values. I have chosen RB based on the IB required to keep transistor in switch mode, then kept RB same and increased R1 depending on the voltage. I doesn't go too high (27K for 12V). For those cases it goes too high, you can use 3 resistors like this:

+V
|
R1
|------ RB-----Transistor base
|
R2
|
(pin)

Choose proper Rb+R2 to achieve proper Ib and then calculate R1 to achieve bias voltage. You go into two equation system but I guess it will not be a problem to solve it.

> In case of power over the +5V, I'd suggest an additional transistor stage
I fully agree that's the way to do it if required, but as I wrote above seems this scheme works fine for quite high voltage values.

Cheers

#26 Coding Smackdown

Coding Smackdown

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationLewisville, TX USA

Posted 25 November 2011 - 04:14 PM


Later in this tutorial I also will describe how one can use FET/MOSFET, DIOD or Transistor NAND as well as NAND TTL IC to achieve same.


Wouldn't an XOR Gate work better than a NAND Gate? I would think you would only want a high output when the two input are different. So if the Netduino board sets all pins to high at reset you could hook up one input to the Netduino pin you are going to use as a switching signal and the second to positive voltage. This way when the board resets both inputs would be high and the output would stay low. Then once your application starts you could drive the Netduino pin low to get a high output from the XOR Gate thus providing the voltage required to allow current to flow through the transistor.

Or do I have my logic backwards and you need the NAND gate to keep the signal high so there is not enough difference at the base of the transistor to allow current to flow?

Regards,

Jim Lavin
Brewing Award Winning Beer with a Netduino!
http://diybrewery.com

#27 Coding Smackdown

Coding Smackdown

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationLewisville, TX USA

Posted 25 November 2011 - 04:24 PM

Looking at the specs for both a NAND Gate and XOR Gate I think I answered my question. They both give you a high output when the inputs are different. The only difference is that the XOR Gate does not give you a high output when both signals are the same where as the NAND Gate will give you a high output if both signals are low. So I guess you could use either type of gate. Regards, Jim Lavin
Brewing Award Winning Beer with a Netduino!
http://diybrewery.com

#28 mv10

mv10

    New Member

  • Members
  • Pip
  • 6 posts

Posted 13 March 2015 - 04:48 PM

Dragging up this old thread to ask a quick question. Using a Netduino Plus v1, my wife was going through the servo chapter in the "Getting Started" book. Obviously we got the start-up jitters discussed here, and adding a 10K pull-down eliminated that.

 

However, even with the pull-down, there is a little twitch at start-up. What causes this?

 

The first 9 seconds of the video below is without the pull-down (it vibrates all over the place while the Netduino is booting up), and the next segment is with a pulldown -- you can see the start-up twitch at about 13 seconds after I plug it in the second time.

 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.