element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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 How do i avoid corruption of files when using the datalogger shield?
  • 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
  • State Not Answered
  • Replies 7 replies
  • Subscribers 393 subscribers
  • Views 1352 views
  • Users 0 members are here
  • considerations
  • shield
  • datalogger
  • engine
  • arduino
Related

How do i avoid corruption of files when using the datalogger shield?

Former Member
Former Member over 10 years ago

Hello,

 

I am trying to prototype a solution that would eliminate kfr on my motor bike. What i intend to do is to read out the lambda sensor value, do some math, and send out a modified signal to the ecu.

For this prototyping, i want to log all sensor data for analysys afterwards. My plan is to log all kinds of values to the sd card in a file. So far this is all pretty standard.

 

Here comes the question(s):

-What happens when i cut of the power to the arduino? Specifically what happens to the sd card, and the file that is on it?

  -Since i'll be writing multiple times a second to the sd card, I am guessing i will cut of power to the arduino while writing to the sd card.

  -What happens to the file?

  -Can i start appending without any issues, when i start the arduino again?

  -will there be any kind of fat corruption to take care of?

  -are there best practices? Such as never write to an existing file, but always start a new file when powering up?

-Are there any special considerations that i should be aware of?

-how stable is the arduino combined with the datalogger shield and the lcd shield when used in an electro-magnetic dirty environment such as an engine on a car or bike?

  -Do i need to build special filters on the power supply,

  -do i need a metal casing of some sort to protect this setup?

 

I would like to hear about the theoretical side, but more so if you have real world experiences in any of the above mentioned areas.

 

Thanks

Frank

  • Sign in to reply
  • Cancel
  • gadget.iom
    0 gadget.iom over 10 years ago

    Have you considered connecting the Arduino the permanent 12v supply on the bike, then connecting the switched ignition supply to an input pin (via a relay etc) to enable logging. The Arduino could then detect when the bike is switched off and save the remaining data before closing the file.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to gadget.iom

    This is actually a good idea image I can whip up some resistor thingie so i'll get a positive pulse on some pin. So i would not need a relay.

    Do you know the allowed range of voltage to get a one and what voltages would be a zero for the arduino digital ports?

     

    Other solutions that would make the sd card resistent against corruption would also be great.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 10 years ago in reply to Former Member

    a solution that would eliminate kfr on my motor bike

    What exactly is kfr??

     

    What i intend to do is to read out the lambda sensor value

    Thats all very well but do you know how its configured ?

    Is it a simple resistor type load to ground, or is a balanced circuit.?

     

     

    You could also use a simple transistor to signal the 12v ignition is present.

    If the data you want to collect is only over a certain rev range/particular time then what about having a button to log.?

    You may also want to record some other data such as revs, throttle position, etc, as the reading will change based on these.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to mcb1

    What is KFR?

    kfr is a German term: Konstant Fahr Ruckeln, which is a stutter when driving with a constant throttle and a constant rpm. According to all i have read this happens because of a combination of low fuel to air ratio (or high air to fuel ratio) using a cathalystic convertor and a not so greatly tuned engine management. All recommend solutions i found, i have tried, and they do seem to work a little but not all the way. I want to try a totally new approach that nobody ever seemed to have tried before. Maybe it'll crash miserley, but i have some confidence in the results image

     

    Lambda sensor:

    The lambda sensor is a current source and generates somewehre around 0.9volts (between 0.7 and 1.2V)  with 1microAmp, depending on the amount of oxygen passing the sensor.. So i need to use a high impedance system. I might have been able to acheive all of this using electronics, but my knowledge on this is limited and if/when my solution works, i might go further and try to read throttle position etc and maybe do some other crazy stuff image

     

    The button idea may be a better solution, as this will allow me to generate multipe runs with multiple logs. And it is much easier to accomplish. I'll give this idea some thought.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • bobcroft
    0 bobcroft over 10 years ago

    some two,

    I would urge great caution when working with the lambda sensor.  I have no knowledge of them on motor bikes but I do have knowledge of them on gas boilers and they are an absolutely critical component.  Adding additional circuitry to the sensor could affect its designed operation with what ever it is supplying the measured value to. I do not want to discourage you from your quest but extreme care is needed.           

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 10 years ago in reply to Former Member

    Like Bobcraft says, its easy to upset it.

     

    I'm wondering if you might be better measuring the air/fuel ratio seperately to track down what is causing it.

    I find it hard to believe the manufacturer would allow their bike to have this problem.

     

    You could find it is caused by oscillation in the airbox due to partially blocked airfilter which triggers the symptom.

     

    If Ignition timing is the problem then it's likely to be present at different temperatures.

    For you to feel/notice it then it must be large and would almost present as a misfire.

    You could try adjusting the spark gap closer or changing plugs....

     

    You should be able to simulate this on a rolling dyno, meaning you can control some of the environment and eliminate variables (wind, road surface, temperature)

     

    Out of curiosity what sort of two wheel machine is it.?

     

    BTW the 1 uA is the current source across the resistive sensor. The airflow will change the resistance which then is measured as 0.7 to 1.2v (or 700 to 1200 ohms)

    The external temperature/incoming air temperature will also change the reading.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to bobcroft

    I seem to be missing some understanding of the lambda sensor. Can one of you explain the workings of the lambda sensor? I always thought it is similar to a powersource, but that does not seem to be correct?

     

    The KFR problem (surging in English i beleive) is a well known issue with some boxer engines, and maybe even with 2 cylinder bikes like Harley. This stems from the old days where less pollution became more important and there was little attention to surging etc. My bike, a BMW r1150rt got a revision that eliminates this problem but that is too expensive for me to apply and using the arduino is some sort of a hobby, so i want to finish this image

    And if i have eveything correct, I might want to skew the lambda signal so the engine will run a bit leaner or richer. But first things first.

     

    The plan i am having is to measure the voltage, apply an algorithm to this and sent out a generated voltage, that is similar but slightly different. It will follow the lambda sensor but with a smaller hysteris. If that does not work, then hopefully i would have logged (with the arduino datalogger shield) a lot of lambda values and maybe i can anaylze the data. I assumed i could this using a adc with a high impedance. Can somebody tell me if this is correct? Or do i completely misunderstand this? Btw it is a small-band lambda sensor.

     

    I do not intend to change the other wirings of the sensor, such as the heater. Only the output signal of the lambda sensor will be used.

     

    btw: Great feedback from all of you.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
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