Pandauino? presentation website is launched !
Dear web-surfer, after quite a long time designing the Freq_LF_HF board and preparing content, Pandauino? webiste is now launched! What do you think about our logo?
The Arduino compatible precision frequency counter Freq_LF_HF can communicate over an I2C serial network. In the example presented below we will be using Feq_LF_HF board in master mode to send frequency values to an Arduino Nano board in slave mode. It only takes a few lines of Arduino code on each device and relies on the standard library WIRE.
The name I2C refers to the fact that it is a serial 2 wire (synchronous, half duplex) communication protocol. Hence we have to establish the SCL (clock) line and SDA (data) lines between the respective pins of the 2 boards. We should also link the ground pins.
Using this protocol we could add many peripherals to a network, all connected to common SCL and SDA wires, but only one peripheral will be configured as master. All others will respond to the master in slave configuration. These 2 lines must be pulled-up to the power voltage (5 volts).
Freq_LF_HF SCL and SDA lines have 510 Ohm series resistors for protection. A good value for pull-up resistors would be between 4.7 KOhm and 20 KOhm. It depends on the total capacitance of the lines, and sot it depends on the number of devices on the I2C bus. For more information you can read Using the I2C Bus.
Using I2C to feed frequency measurements from Freq_LF_HF to an Arduino Nano board
To assemble this frequency measurement toolchain we need to connect the pins like this:
I2C share data – master sending values code
I2C slave receiving values code
Instead of using I2C to feed frequency measurements we could also use the other buses available on Freq_LF_HF: Serial (for longer distances) and SPI (for faster communication) to achieve the same goal.