Netduino home hardware projects downloads community

Jump to content

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


Member Since 06 Dec 2011
Offline Last Active Jan 02 2015 02:56 AM

Posts I've Made

In Topic: 5V sensor with netduino 2

02 January 2015 - 02:49 AM

Don't think of it as losing 2V.  You aren't really losing any of the span and accuracy of the sensor output signal, you're just scaling it into a voltage that the Netduino can understand and work with.  It pretty common to do this in the analog to digital world, where some of the analog voltages are outside the range at which ADC chips can work.  The input signals have to be adjusted for the ADC chip to use them.  That's exactly what is happening here.  5V becomes 3V, and 0V is still 0V.  You're taking the output range and compressing it slightly, but you still have all of the range represented in the 0 - 3V span of the signal.


You'll have to do some translation tricks in the code, like using a correction factor to arrive at the actual value represented by the new voltage, but that can be arrived easily enough by using the ratio of voltages.  In this case 3V/5V = a 0.6 correction factor.  If, in a 5V span, the sensor puts out 3.3V, the new circuit would display that 3.3V signal as 3.3 * 0.6 = 1.98V.  You just have to interpret that in your code the right way.  So if your sensor is saying that it is at 10 PSI when putting out 3.3V, your Netduino will read that same 10 PSI pressure reading at approximately 2V, you just have to teach your Netduino code to understand what that means.


To obtain your correction factor, take 5V and apply it to the top of the voltage divider with the divider connected to the Netduino pin.  Measure the voltage on the resistor leg at the Netduino pin.  Take that voltage and divide it by 5 Volts.  Presto, you now have a scaling, or correction factor to use in your code.  To scale downward, multiply by the correction factor.  To scale upward, multiply by the inverse of the correction factor (1/correction factor).

In Topic: 5V sensor with netduino 2

01 January 2015 - 04:11 PM

You want higher value resistors to limit the current into the Netduino.  Make Z1 10000 Ohms.  Also, make ZL 50000 Ohms to reflect the input resistance of the Netduino.  That will give you a more accurate voltage when hooked up.  Don't forget to test the voltage before hooking it up to the Netduino.


You also might want to choose a value for Z2 that provides 3V rather than 3.3V.  3.3V is the maximum for the analog port.  I prefer to use a little less voltage than the maximum for safety reasons.

In Topic: 5V sensor with netduino 2

01 January 2015 - 03:18 AM

A voltage divider is the way to go on this one.  Here's a link to the theory behind the voltage divider and a handy calculator:




Also, this is a pretty good voltage divider calculator:




Use calculator # 2.



According to the datasheet, the input resistance of the ADC is maximum 50k Ohms (If I read it right) so that would have to be taken into account for your measurements to be accurate.  The input resistance would be represented in a voltage divider as RL.


You can mess around with the calculator on that page and try different values.  Best to do your calculations to get 3V or 3.3V as an open circuit voltage and hook it to the Netduino.  The voltage will then drop to around the value given for the loaded voltage.  You can then adjust the voltages as necessary.  Remember to disconnect the voltage divider from the Netduino when changing out resistors.  You don't want to brick your analog port.

In Topic: Creating a COM port for serial communication with Netduino GO!

27 December 2014 - 06:20 PM

You need a USB to TTL converter to create a a serial port on the PC which can then be connected to the serial ports on the Netduino Go (I'm assuming that you are using the COM ports on the Shieldbase).  These are been based on FTDI or equivalent chips.


Some things to be aware of:

  1. Netduino COM ports work on 0-3.3V logic levels.  These are different from classic COM ports on PCs which use upto +/-15V to represent 0 & 1
  2. The COM on the Shieldbase should be 5V tolerant for incoming signals but will only be able to output 3.3V for logic 1.

Hope this helps,


Thank you Mark, that is what I was trying to say but failed miserably, lol.


I knew I was forgetting something.

In Topic: Creating a COM port for serial communication with Netduino GO!

26 December 2014 - 11:52 PM

Yes.  I'm referring to a USB to 9 pin serial cable adapter.  It allows your USB port to function as a serial COM port with an assignable (usually) COM port number.  It behaves just as though you have a serial port on your laptop, and allows you to talk to a serial port implemented on a Netduino or other hardware (PIC, Arduino, anything with a hardware serial port and internal UART).


The problem that you're running into is that (to my knowledge, and someone please correct me if I'm wrong), the USB port on the Netduino cannot be used for serial communication in it's native form.  You would have to write a library to allow the USB port to function as a serial device.  It could be done, (I think), but it would knock out the debugging functions of the Netduino, as it can't function as a USB device and a serial device at the same time.  I can't verify this at the moment, as I can't find the code I was looking for on my PC, so I could be entirely wrong about this.


The TI and Stellaris boards may have had a serial monitor implemented in their firmware which allowed you to connect with Putty through USB, but to my knowledge, the Netduino does not allow this.  I currently have a Netduino attached to my PC spitting out a serial stream, and I can't connect to the stream with Putty.  Also, I don't have a serial port in Device Manager to connect to.  The only way that I was able to connect to the serial stream was to use my USB to serial converter.

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.