FiO Glide – ANT – LDR-ADCDigital IO Demo¶
download all demo files: RF_ADC_IO.7z
Introduction¶
This demo will show you how you can use FiO Glide[name RF2] to read ADC value from LDR (aMG Photocell-A) then control an IO that drive an LED. Then send the read values (ANT protocol) to the second FiO Glide[name RF1], while RF1 also read its ADC value from LDR (another aMG Photocell-A) to control another LED. This second FiO Glide[name RF1] then gather all four values (ADC1,LED1,ADC2,LED2) and send via ANT protocol to the third FiO Glide[name RF0]. RF0 then read all values and send to PC via serial communication, then we use Simulink tools to display and plot values on scope.
Tools used¶
- Three FiO Glide
- Three aMG USB Connect with three USB cables
- Two aMG Photocell-A
- Two LEDs
- Some connecting wires
Connection Diagram for RF1 and RF2¶
Detail Explanation for RF1 and RF2¶
The Vin for aMG Photocell-A module is connect to +3.3V (Pin38) and GND to Pin25. Vsense is then connected to ADC port Pin22 (AIN7), user can connect ADC to other pin if needed. The output pin is Pin20 (AIN5 configured as IO output), this drive LED at the anode, the cathode then connect to GND. Since FiO Glide can drive current up to 5 mA, it is safe to drive an LED with out a current limiting resistor.
Expected Result¶
When user connect USB power to the three boards, LEDs will light up on RF1 and RF2 at office lighting condition. If user put a flash light on LDR with light intensity high enough, then LED will go OFF, and ON again if you remove flash light. This behaviors go the same on RF1 and RF2 modules. The values are sent to host PC and plot on Simulink scope. ADC values show in Volt and LED status show 1 and 0, representing ON and OFF status.
RF2 Model¶
RF1 Model¶
RF0 Model¶
Host Model¶
Limitation and Purpose¶
- The maximum data transmitting rate is 8 Hz (ANT protocol limitation)
- ANT protocol is best for multiple nodes communication on a network
- Each ANT TX/RX block can send/receive up to 8 bytes, for more data, please use more blocks
- For mobile application, user can provide 3V battery to FiO Glide and remove aMG USB Connect
- ANT protocol consume very little power from battery
- For point to point communication, user can use RF block which can provide much higher transmitting rate(100Hz and beyond)
- RF blocks consume much higher power from battery (more than 20x compared to ANT protocol)