ADC-11 & VB capturing triggers

Post general discussions on using our drivers to write your own software here
Post Reply
Posts: 2
Joined: Thu Sep 01, 2005 3:26 pm

ADC-11 & VB capturing triggers

Post by reckface » Thu Sep 01, 2005 3:37 pm

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?

Advanced User
Advanced User
Posts: 656
Joined: Thu Jul 07, 2005 12:41 pm
Location: St Neots, Cambridgeshire

Post by Michael » Wed Sep 07, 2005 9:13 am


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 - Tech Support
Pico Technology
Web Support Forum

Posts: 2
Joined: Thu Sep 01, 2005 3:26 pm

Post by reckface » Wed Sep 14, 2005 1:34 pm

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: Select all

  ' 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
  '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.

Post Reply