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.

Fahdil

Member Since 04 Oct 2012
Offline Last Active Mar 20 2019 10:44 AM
-----

#56314 Extensive driver for the MCP23S17 I/O expander

Posted by Fahdil on 23 February 2014 - 09:56 PM

It's clear enough for me... God thanks....

 

so.. for the LCD display,, there is no easier way to mix it with microLiquidCristalclass.

var lcdProvider = new GpioLcdTransferProvider(MCP23S17.Pins.GPIO_12, // RSMCP23S17.Pins.GPIO_11, // enableMCP23S17.Pins.GPIO_PIN_10, // d4MCP23S17.Pins.GPIO_PIN_9, // d5MCP23S17.Pins.GPIO_PIN_8, // d6MCP23S17.Pins.GPIO_PIN_7); // d7var myLcd = new Lcd(lcdProvider);myLcd.begin(16,2);

and..... maybe a little modification on LcdProvider Class....  ^_^

but First thing to do is lookin for the chip on the market. hepfh.... :blink:




#56147 Extending Analog Input using 4017 and 4066

Posted by Fahdil on 17 February 2014 - 05:58 PM

My project Goal is "Netduino Read 9 or more Analog Sensor".

 

Here I'm using Netduino+, with RTC on A4 and A5. so I just have 4 left more analog pin, but I used to read 9 analog sensor continuously. So I come with 4017 and 4066 to drive Analog Reading alternately.

 

here my schema:

Posted Image

 

Q0 => Humidity Sensor

Q1 => Distinguish-er (not a sensor... just a voltage divider to return 2.2v )

Q2 => Temperature

Q3 => Air Pressure

Q4 => Reset if you don't attaching any  more sensors.

Q5 - Q9 (we can add more sensor) but in my case I just need to use 3 sensor in a single analog pin.

 

whenever we trigger 4017,  it will send a 3.3v logic consecutively from Q0 to Q9 (except you reset it on middle).

 

This is one block of 4017 and 4066 as switcher. we can trigger the 4017 clock by using a single digital pin as output port. here, every 15sec netduino trigger 4017 to switch the analog input.

if (_getDistinguisher){    Distinguisher.Read(); //read analog input    while (Distinguisher.value < 2000) //millivolts    {	Switcher.Switch(); //trigger 4017 to switch the channel (send positive triger 50ms)        Distinghuiser.Read();        Thread.Sleep(490);    }    if (Distinguisher.value > 2000) // if analog input reads 2v    { Switcher.Channel = 0; _getDistinguisher = false; } // then reset the chanel}if (_Second % 15 == 0) //do switch every 15 sec.{    if (_timeToSwitch)    {        Switcher.Switch();        if (Switcher.Channel == 0 || Switcher.Channel == 4) { Switcher.Channel = 0;         _getDistinguisher = true; }        _timeToSwitch = false;    }}else { _timeToSwitch = true; }

and we can read analog input alternately, here I use a simple code: (read 3 Analog sensor in asingle Analog Pin)

switch (Switcher.Channel) //these all Analog Read from Analog_GPIO_A0{   case 0:	Distinguisher.Read();        _currentReadValue = "Ch 0: " + Distinguisher.valueToString;//to display on Lcd        break;    case 1:        AirTemprature.Read();        AirTemprature.Collect(AirTemprature.value);        _currentReadValue = "Ch 1: " + AirTemprature.valueToString;        break;    case 2:        Humidity.Read();        HumidityContainer.Collect(Humidity.value);        _currentReadValue = "Ch 2: " + Humidity.valueToString;        break;    case 3:        AirPress.Read();        AirPressContainer.Collect(AirPress.value);        _currentReadValue = "Ch 3: " + AirPress.valueToString;        break;    default:	break;    }

Here's my note:

4017 is not always start with channel 0 on the start Up. That's why I do this (keep read and switch until we got the distinguish-er. 

    while (Distinguisher.value < 2000)    {	Switcher.Switch(); //trigger 4017 to switch the channel        Distinguisher.Read();        Thread.Sleep(490);    }

I'm still work with the code... so I cant attach it yet :P (sorry)... I will attach it soon.... :)

 

Cheers ^.^V




#55703 Analog input resolution &

Posted by Fahdil on 28 January 2014 - 12:55 PM

Hi

 

If the ADC resolution is 12 bits (from 0 to 4095) why I only obtain a 10 bit result (0 to 1023) ?

 

and more: Why the line in red (reference [color=#ff0000;]pot1[/color]) do not compile ?

 

which literature that explain the analog input has 12bits? as i know Netduino has limit the analoginput to 10bits. see Hardware Specification.

[color=rgb(255,0,0);]AnalogInput[/color] pot1 = new AnalogInput(Pins.GPIO_PIN_A1); // DO NOT COMPILE ! !

 

it's bcoz you're using both:

using Microsoft.SPOT.Hardware

using SecretLabs.NETMF.Hardware;

 

the netduino with 4.2 framework has the ambiguity. try to delete "Microsoft.SPOT.Hardware".




#43051 BlinkyVB -- first Netduino app using Visual Basic

Posted by Fahdil on 09 January 2013 - 04:04 AM

Yes it's done.... btw thanks




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.