Page 1 of 1

[solved] Components

Posted: Thu Aug 25, 2011 12:31 pm
by dbasnett
Are there components for the Sensor (EB003) and Relay Board (EB038)?

Re: Components

Posted: Thu Aug 25, 2011 12:36 pm
by Benj
Hello,

The sensors can be read using the ADC components and the Relays can be controlled using either an output icon or a LED / LEDbank component.

Re: Components

Posted: Thu Aug 25, 2011 2:17 pm
by dbasnett
If I want to use Port E for the Sensor Board data (without other sensors), am I correct to use ADC channel 5 and 6 (RE0(AN5) and RE1(AN6) respectively)?

Re: Components

Posted: Thu Aug 25, 2011 2:38 pm
by Benj
Hello,

It depends on which chip you are using but yes the pins on PortE are usually analogue.

The LDR is bit 0 of the port and the Pot is bit 1 using the default patch setting.

Re: Components

Posted: Sat Aug 27, 2011 8:22 pm
by dbasnett
On the EB003 I have left the default jumper on (J5).

I added two ADC components and left them at the default for Ext Properties.

ADC0 reads the LDR and ADC1 reads the POT. What I am not clear on is what the settings are in Ext Properties, and should I assume they are correct?

The POT seems to work correctly when I read ADC1 as byte. 0 = off ... 255 = full on, and values between those as it is turned. Should I expect anything else?

The LDR seems to return larger byte values when it is darker, and smaller when lighter, though I never receive 0 or 255. How should the LDR value be read?

Re: Components

Posted: Sat Aug 27, 2011 9:52 pm
by medelec35
dbasnett wrote: What I am not clear on is what the settings are in Ext Properties, and should I assume they are correct?
It's fine leaving external Properties as they are, unless you want to change pot from rotary type to slider for example. This is just an aesthetic, the characteristics are the same.
dbasnett wrote: The POT seems to work correctly when I read ADC1 as byte. 0 = off ... 255 = full on, and values between those as it is turned. Should I expect anything else?
Nope that about it. turning pot clockwise will reduce value.
dbasnett wrote: The LDR seems to return larger byte values when it is darker, and smaller when lighter, though I never receive 0 or 255. How should the LDR value be read?
That is how it should work. As more light falls on the LDR, its resistance decreases, pulling down the voltage on the port pin (ADC0), hence bytes will reduce.
The less light that falls, then LDR increases its resistance. the resistor that is connected between LDR and +5V pulls the port pin voltage higher so bytes increase.

Martin

Re: Components

Posted: Sat Aug 27, 2011 9:56 pm
by dbasnett
Is it normal for the LDR never to be 0 or 255? Just curious?

Re: Components

Posted: Sat Aug 27, 2011 10:55 pm
by medelec35
dbasnett wrote:Is it normal for the LDR never to be 0 or 255? Just curious?
Oh sorry. Yes its normal for bytes not to go to 0 = 0V or 255 = 5V. So the board is working like it's suppose to.
Reason being, even with loads of light on LDR it will not be a short circuit (if it was s/c then bytes = 0).
And with no light it will not be open circuit, just a higher resistance. (if it was o/c then bytes = 255).

Martin