element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum A couple of Arduino libraries I wrote, AS3935 lightning detector and TCS3471 color/light sensor
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 36 replies
  • Subscribers 405 subscribers
  • Views 4035 views
  • Users 0 members are here
  • sensors
  • prototyping
  • arduino
Related

A couple of Arduino libraries I wrote, AS3935 lightning detector and TCS3471 color/light sensor

Former Member
Former Member over 12 years ago

A bit of a shameless self-promotion image I wrote two libraries for two interesting sensor chips, first is AS3935 lightning detector chip, that can warn you about coming storm while it is still 40 kilometers away and the second in high dinamic range 16bit resolution color and light sensor chip TCS34717. Both libraries in my opinion are interesting in the way communications are implemented, library code does not access any other library, like SPI or Wire, directly, but rather relies on user sketch to provide functions to communicate over SPI or i2c bus, which makes them usable with almost any imaginable setup and scenario.

Both libraries can be downloaded from my github - https://github.com/raivisr?tab=repositories

 

And break-outs if anyone is interested in these, can be purchased here - https://www.tindie.com/shops/TAUTIC

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 10 years ago

    I found solution.

    I use AS3935 and eth shield with SPI interface, but when i must read from AS3935 i must set SPI_MODE1,  instead of SPI_MODE0.

    Now all seem to work, but how i can test AS3935, and my setup is correct ?

    Noiser Floor = 2

    Spike Rejection = 2

    Watchdog Treshold = 7

     

    Someone has optimized configuration ?

    Tnku

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago in reply to Former Member

    simply change a chip select line of one of the attached devices and adjust the code to initialize the device to use the new pin ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to Robert Peter Oakes

    Yes. I used pin 9 for as3935 cs, pin 10 is set default for eth.

    but u need a trick. Before read or write to  as3935 set spi_mode1 and after change to spi_mode0.

    To see my project at work go to http://meteo.ispica.org

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago in reply to Former Member

    No tricks, the SPI library supports this directly using

    "SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0))"

    putting in your settings of course image

    See https://www.arduino.cc/en/Reference/SPISettings for details

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago in reply to Former Member

    Nice project, I will keep an eye on it for pending lightning image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to Robert Peter Oakes

    Tnk u Peter.

    if anyone needs the code can ask.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to Robert Peter Oakes

    Hello Peter today in my town there is a bad time with lot of lightining, but my AS3935 does not detect anything.

    Arduino Leonardo is powered by POE, with a switch of Nilox, and is apparently working. In fact, the detection of the temperature and humidity, as well as sending to the web server function. BUT AS3935 NO !

    So I decided to feed the board with a battery and stabilize the voltage to 7V. Magic, I found lots of lightning. But now another problem arose, taking the reference network http://www.blitzortung.org/ distances detected does not correspond example, if my AS3935 says 30km in effect is at least 60,

    if it say up to 8 km it is at least 30, and if it say 1km, instead the lightining is 10 / 15km far.

    May depend on what?

    Thank you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ss123
    ss123 over 7 years ago in reply to Former Member

    I need code interfacing As3935 with arduino uno using SPI

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • ss123
    ss123 over 7 years ago in reply to Former Member

    I need code interfacing As3935 with arduino uno using SPI

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube