K8055 digital inputs

Hi,

What voltage and current can be supplied to the digital inputs of the K8055 borad. I would like to connect an output from my house alarm to one of the digital inputs and thus if the alarm is triggered I will get 12 volts and have some software monitoring the K8055 which will then send an email or text

Any help greatly appreciated
/Kevester
ps: I am more familiar with the software world.

The ULN2803 driver is rated for 30V maximum input, 12V will be fine…

Many thanks for the response

Much appreciated
/Kevester

No damage but this connection doesn’t work.
There are pull-up resistors at the digital inputs of the K8055.
If you connect the S0 output to the digital input this way, the digital input is all the time high.

If you have a modern electronic kWh meter then you may simply connect the S0- to the GND and S0+ to the digital input of the K8055.

No need for the 12V external voltage. The internal +5V of the K8055 is enough for the S0 output to operate.

Hello VEL255,

Thanks for the reply.

My K8055 and kwh meter with s0 interface are working perfect together.
Adding 2x K8067 now for temp monitoring :slight_smile:

Greetings Bgrr

Looking good. :slight_smile:

I have searched the forums for the most efficient way to scan the digital input of my 2 k8055 cards. I am using the following code:

'Card Input Scanning
Sub Input_Scan()

        'Card 0 Digitals
        SetCurrentDevice (0)
        In1 = ReadDigitalChannel(1)
        In2 = ReadDigitalChannel(2)
        In3 = ReadDigitalChannel(3)
        In4 = ReadDigitalChannel(4)
        
        'Executes Card 0 Input conditional Subroutines
        Exhaust_Fan_Control

'This Loops the routine every 1 second
Application.Ontime Now + TimeValue(“00:00:01”), “Input_Scan”

This seems to load the CPU unecessarily. Is there a way to always monitor the inputs? I am using excel (VBA) on XP SP2, and the cards are controlling most of the house.

Cheers Markus

I assume this is using VBA in Excel or some other Office application.

The problem is that the .OnTime method runs a constant loop in Excel which gobbles a lot CPU resources when only Excel is running. The good news is that it does yield to other applications when CPU time is requested, the bad new is that if no other apps need time it will use 50% or so of the CPU’s time.

This is the same as the DoEvents function of VB/VBA, it passes off to other apps but if no other apps need CPU time the VB/VBA loop runs full-tilt and keeps the CPU busy.

There really isn’t a work-around for this, to be honest Excel is not a viable environment for doing what you want to do. In VB you could use a timer control to fire the scan every second with minimal CPU usage.

In these threads you’ll find some VBA example code using the timer in Excel:
viewtopic.php?f=3&t=2377
viewtopic.php?f=3&t=300

Thanks for the replies, I will try the timer code and have a play with that.

The system is working well, the need for the fast digital input scanning is that I have installed Bathroom fan switches with interposing relays to the cards and hence the need for the cards to pick up the change in status. Currently you have to briefly keep you finger on the pushbutton switch so the card has time to pick it up.

One more question I cannot get the 2 cards to be recognised if I use a powered USB Hub, I am currently using 2 seperate cables and ports on my computer for that. Has anyone go any ideas on how a powered USB hub could be utilised, as my system is growing to 3 cards???

I have just finished building a thermistor opamp circuit to gather the temperature of my solar storage system this wont require such speed for the analouge polling.

Will keep you updated if anyone is interested

[quote]One more question I cannot get the 2 cards to be recognised if I use a powered USB Hub, I am currently using 2 seperate cables and ports on my computer for that. Has anyone go any ideas on how a powered USB hub could be utilised, as my system is growing to 3 cards???[/quote]I connected two K8055 cards to a powered HUB and everything seems to work OK.

Thanks for the prompt reply. Your API Windows timer solution works! I am now scanning at 100ms and it does what its supposed to do.

I will try the powered USB hub again.

One more question that I have just come accross; I have two cards connected and am scanning input 3&4 on card 0 using the setcurrentDevice (0) command. If they are true then I am running a routine calling for output 1 & 2 on card 1 to turn on (using setcurrent device 1 ) it all works except when my computer only has card 0 connected then the inputs 3 & 4 switch on output 1 & 2 on the same card (0) even though it states setcurrentDevice 1 prior to setdigital1 etc.

Is this normal?

When using the powered HUB, there may occur problems to detect the connected cards if the power adaptor of the HUB is disconnected and reconnected “on-the-fly”.
In this case disconnecting and reconnecting the K8055 cards from the HUB doesn’t help. The LED LD8 flashes two times and stays on. This indicates the card is not detected by the PC.
In this case you have to disconnect and reconnect the USB cable connected between the USB HUB and the computer

[quote]One more question that I have just come accross; I have two cards connected and am scanning input 3&4 on card 0 using the setcurrentDevice (0) command. If they are true then I am running a routine calling for output 1 & 2 on card 1 to turn on (using setcurrent device 1 ) it all works except when my computer only has card 0 connected then the inputs 3 & 4 switch on output 1 & 2 on the same card (0) even though it states setcurrentDevice 1 prior to setdigital1 etc.

Is this normal?[/quote]This seems to be normal. If only one card is connected then the SetCurrentDevice() works like that. It doesn’t disconnect the single card connected.
Also calling SetCurrentDevice (2) doesn’t change anything, if only cards address ‘0’ and ‘1’ are connected. The last “valid” card stays selected.

Just thought I would let you know for anyone else who is playing around with the K8055 cards. The API Timer routine cause some of the outputs to stay on and on some occasions I could not controll the second card after initiating the outputs. This is with reading inputs on 1 card and initiating outputs on another.

Double checked the code and then swapped over the computer from a xp machine to a windows 7 machine. Retested everything even running excel 2007 and it works without a flaw! Am now scanning at 100ms and the CPU loading is minimal.

Cheers Markus