Can I send a TTL pulse out of EmotiBit to synchronize with other devices?

Created by Nitin Nair, Modified on Fri, 13 Dec, 2024 at 3:51 PM by David ten Have

Yes!


You can drive one of the available digital output pins on the Feather with a small code change in the loop section of EmotiBit_stock_firmware.ino. Instructions to build EmotiBit firmware can be found in the documentation.


Adding digitalWrite(ledPin, ledState); can be used to toggle on and off any of the unused digital pins on the Feather (e.g. ledPin = 16 sends a pulse on pin 7 of J11 in the EmotiBit schematic shown below). See the full M0 Wifi Feather pin numbering chart at https://learn.adafruit.com/assets/46250.



A couple important notes:

  • You'll likely need to connect the output of the digital pin and GND to the synchronization input of your other device. Depending on your other device, you may need to optically isolate this connection to avoid creating a large ground loop that can cause noise. For safety, you should also NEVER have EmotiBit electrically connected to anything powered from the wall while wearing EmotiBit -- always use electrical isolation (e.g. optical isolation) with sufficient safety ratings to avoid injury from surges coming from wall power.
  • You can change the on/off time of the TTL pulses, but be sure to never use a delay() function inside the loop(). The BlinkWithoutDelay example in Arduino IDE shows how to create a timer without using the delay() function.


Note also that if you want to log the time of TTL pulse generation in EmotiBit's data stream, you can call addPacket similar to emotibit.addPacket(millis(), "U1", &ledStateFloat, 1, 0). All typeTags from U0 to U9 will be perpetually kept free of other data streams so that users can utilize them for their own streams of data. A full list of all typeTags in use by EmotiBit firmware can be found in EmotiBitPacket.cpp.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article