ADC-11 & VB capturing triggers

 
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
Author Message
reckface
User
User


Joined: 01 Sep 2005
Posts: 2

PostPosted: Thu Sep 01, 2005 3:37 pm    Post subject: ADC-11 & VB capturing triggers Reply with quote

I need to sample an on/off signal from channel 1 of the ADC-11. All I want is when ever someone touches a switch it notes the time. I don't really want voltage measurements just a 1 or 0.
With the sample VB project I get numerous readings of meaningless voltages even when there shouldn't be any.
1. How can I programmatically capture the time only when triggered?
2. Why do I get large seemingly random mV values when there is nothing connected to the channel?
3. Why does get_times_and_values return large (sometimes negative) numbers for the times?
Back to top
Michael
Guru
Guru


Joined: 07 Jul 2005
Posts: 93
Location: St Neots, Cambridgeshire

PostPosted: Wed Sep 07, 2005 9:13 am    Post subject: Reply with quote

Hello,

Thank you for your post.

I shall answer your questions in order.

1: Use the adc11_set_trigger and write a VB command to place a date/time stamp in an adjacent field.

2: You are picking up ambient noise.
3: As above.

If you are using the ADC-11 to capture these these ON/OFF times, you should feed a 2-2.5v supply to a normally open switch. Set the trigger threshold to the supply voltage(this must be in ADC counts!) on a rising edge.

I hope this gives you some direction.

Best regards,
Michael
Back to top
reckface
User
User


Joined: 01 Sep 2005
Posts: 2

PostPosted: Wed Sep 14, 2005 1:34 pm    Post subject: Reply with quote

Thank you very much for your response, you have accurately described my problem. I will try your suggestions.
I do have a further question though: How come using the same 1.5V battery, with the pico software behaves consistently without any noise issues? What I want to do is almost identical to the Pico software, except I want to do it realtime without having to export the spreadsheet to process the data.
This is the code in a timer routine (taken from sample code provided):
Code:
  ' Trigger enabled,
  ' Auto trigger after 1000 ms
  ' Rising trigger on channel 1 at threshold 512 (512=1.25V)
  ' No delay
  ok = adc11_set_trigger(True, True, 1000, 1, False, 512, 0)
  ' 10 samples in 20 ms
  ' channels 1 and 2
  channels(0) = 1
  channels(1) = 2
  us = adc11_set_interval(20000, 10, channels(0), 1)            'Set time period of readings
 
  value = adc11_get_value(1)         'Get ADC count
  'ADCV1
  'volts = value * 2500# / 1023      'Convert ADC count to mV
  'ADCV2 and V3
  volts = value * 2.5 / 4095
  List1.AddItem Str(volts) & " V"  'Print voltage to listbox1
  lblVoltage.Caption = "Voltage: " & volts & " V"

It starts with a value like 2V sometimes when it should be 0, and then seems to respond to my applying the battery voltage, but it is inconsistent.
Please examine my code and see if there's any way I can improve it.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
All times are GMT
Page 1 of 1

 


Pico Technology topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group