Skip to content

Testing with Arduino

Naveen Saini edited this page Aug 30, 2017 · 5 revisions

To test the working of single axis sampling, here we are using arduino for simulating the waveforms of the sensors, this can be extended for multi axis sampling, but this page is limited for single axis. Specifically only Arduino is not required we can do this with any suitable Microcontroller board, we can also use another Beaglebone, but since I only have one spare board i.e. Arduino Uno, so we go ahead with it.

  1. Get Arduino app, from arduino.cc and any arduino board, like arduino Uno, and once app is installed paste this simple code into new sketch then verify/compile and upload it to board. Here we create two outputs from Pin 7 & Pin 6 , 7 works here as tx simulator and 6 as rx simulator.They output wave at rate of 12 kHz.

     void setup() {
    
       pinMode(7, OUTPUT); 
       pinMode(6,OUTPUT);} 
     void loop() {
       digitalWrite(7, LOW);
       digitalWrite(6, LOW);
     for (int counter = 0; counter < 4; counter++) {
       digitalWrite(7, HIGH);
       delayMicroseconds(41);
       digitalWrite(7, LOW); 
       delayMicroseconds(41); }
     for (int i = 0; i < 4; i++) {
       digitalWrite(7, LOW);
       digitalWrite(6,LOW);
       delayMicroseconds(41);
       digitalWrite(7, HIGH);
       digitalWrite(6,HIGH); 
       delayMicroseconds(41); }
     for(int i=0;i<10;i++){
       analogWrite(6,127-i);
       delayMicroseconds(82);}
       delay(500);}
    
  2. connect the circuit as shown in this diagram, before plugging in any live input ensure boards are in ON state, also consider this circuit is just a prototype make suitable modifications if required and forward those improvements to me

circuit

  1. Login into BBB and change access to root user,as we done in intermediate testing page, follow steps to start sampling and you would hopefully see the results, here we should consider only TOF correctness because we haven't added any temp sensor and for wind speed ,since we aren't using 40 kHz sensors but simulators, so it won't be right.

  2. We can verify the correctness of TOF if it comes as this value ,that we can determine easily as we are the one generating waveforms with arduino uno.