Python Forum
acquire 20Hz electrical signal
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
acquire 20Hz electrical signal
#1
Hello, I expose my problem: I want to acquire a signal various frequency (alternating sinusoidal 0.2mV alternative with the help of a program in python.) I need a sampling frequency 8 times greater.  I'm am on a pcduino card.
For 1Hz the signal is correct, but for 20Hz is doesnt work.
I think is a sample problem.
Have you have idea, or solution.
Thanks  Smile

#!/usr/bin/python
# -*- coding: utf-8 -*-
from pyduino import * # import fonctions Arduino
import numpy as np
import time

#measurement time
temps=10 #second
end=time.time()+temps
f=open("/home/ubuntu/data/text/TensionsA2.txt","w") # open file
start=time.time()
while time.time()<end:
                start=time.time()
                mesure=analogRead(A2) #read analog value
                tension=mesure*3.3/4095.0 #conversion
                
                print("tension",str(tension))
                out=str(tension)
                f.write(out+"\n")
                elapsed=(time.time()-debut)
                print("Time to run",elapsed+0.00625)


pass # wait 10s
f.close()
Reply
#2
for $12.50, you can get the TI Launchpad http://www.ti.com/lsds/ti/tools-software...g&rec=true
which has 2 analog input channels and each with a sample rate of one million samples/second total 12 channels
datasheet here http://www.ti.com/lit/ds/spms376e/spms376e.pdf
There are many other launchpad solutions http://www.ti.com/lsds/ti/tools-software...hpads.page
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020