I’ve been playing around with the K8055 and checking out the demo that came with it. I’m somewhat of a newbie with Visual Basic and I have no idea how to get a value from the digital input channels on the K8055.
What I want to do is, get a voltage reading from the digital input channel and display it on screen. Can someone point me in the right direction or shed some light on this problem of mine?
The only way to read the digital input states are the functions ReadDigitalChannel and ReadAllDigital. The first returns boolean True or False depending on the voltage of the digital input (High or Low). The second function returns the status of all the five digital inputs in the five LSBs of the return value (returns Long in VB6, returns Integer in VB 2005, VB.NET etc.).
See the example code:
…
Dim i As Long
…
i = ReadAllDigital
…
Can I come back on the original post subject please?
I am trying to read a digital temperature exported from from a Picaxe chip circuit. As VEL255 suggests in his earlier post, I am getting a result of “1” from Readdigital channel, and “31” from readalldigital. I am expecting a result of 19 (Celcius).
How should I get the correct reading please? This is the only digital input I am using on a 110 board. The picaxe sends fresh readings every few seconds.
Thanks
Is the PICAXE sending the data in parallel or in serial mode? If in parallel then you can get readings from 0 to 31.
You got reading 31. It indicates that all the PICAXE outputs connected to the digital inputs of the 110 board are now ‘0’.
Do you have any circuit diagram of the PICAXE temperature sensor?
If you have, convert it to JPG or PNG format.
Then you may use some free image hosting services (e.g. servimg.com/) to upload the image and to get a link to it.
I have rebooted things and am now getting a consistent reading of “1”, which I assume is the total of all the five digi channels statuses, as I have only one input connected.
I noticed that disconnecting the 110 board gave me a reading of 31 again, so that must have been what I was reading before.
What I am not getting is the actual reading from the picaxe. I have a couple of DS18b20 sensors feeding a picaxe 18A and LCD display. I wanted to export the readings into the Velleman using the SERTXD command in the picaxe code. I can see that this is sending ok from the Picaxe by looking at the Picaxe terminal screen.
I have taken the ground of the Picaxe circuit to ground of the 110, and the output pin of the Pic to Digital Input 1
Am I right in thinking the 110 can accept a signal like this?
It seems that you are sending serial data to the K8055 digital input. These inputs are not intended for that kind of data. They are only simple status inputs detecting if the input is low or high.
There are five buttons on the board to test and demonstrate this function.
You can read the status of the button (pressed or not pressed) to your program.
Using ReadAllDigital you can read all the five inputs (buttons) at the same time.
Using ReadDigitalChannel you can check one channel (button) status.
You have to convert the temperature data to parallel form in the PICAXE. Feed this parallel data to the five digital inputs of the K8055. The only problem is that with five bits the value range is only 0 to 31.
Thank you for this clear explanation. I had misunderstood.
It is a pity that there isn’t a better manual to back up this excellent product and I do appreciate the effort you make to supply assistance to all of us asking what must seem very stupid questions.
I had hoped I had overcome the problem of the 110 board being incompatible with the DS18B20. I’ll go and find another way of getting the data into the pc, maybe using the Picaxe Serial Terminal facility.
[quote=“Pedro-C”]Thank you for this clear explanation. I had misunderstood.
It is a pity that there isn’t a better manual to back up this excellent product and I do appreciate the effort you make to supply assistance to all of us asking what must seem very stupid questions.
I had hoped I had overcome the problem of the 110 board being incompatible with the DS18B20. I’ll go and find another way of getting the data into the pc, maybe using the Picaxe Serial Terminal facility.
Thanks again.[/quote]
Hi…I’m trying to sollve the same problem as you…And before i bought VM110 i was sure that i could read data from temperature sensors…Now i know that it’s impossible to do this by using digital inputs, but can we do this by using analog inputs? Can we read input voltage and convert it ?
Anybody know?
I am running two LM335 temp sensors through the analogue inputs, having taken a 5v supply from the jumper to the +ive input.
This works, but not as well as I hoped.
The sensors change voltage output by .01V per degree Celsius.
Across the zero to 100C range I am interested in, I get an analogue range of approx. 70 points, so each point change represents about 1.5degrees. This is using the multiplier resistors (R8 &R9) at 4.7k.
To add to this I can see quite a bit of movement in the analogue results from the circuitry, so I get occasional jumps of a degree or two, which is irritating.
The analogue score uploads to Excel where it is converted in a lookup table and logged and graphed every minute.
If I could find a way of using the full 255 point range from the voltage range of 1 volt (ie 2.75V-3.75V) then I could improve the accuracy, but I am a newbie to electronics and don’t know how I could do this.
Let me know if you want a copy of the excel sheet and code, or if you know how I might increase the analogue range.