count hours

hi

i’m new to Arduino, just got it week ago with serial 4x20 LCD

already got the basics, but i have a few question, maybe basic too:

  1. i need to count hours when Arduino is running is it possible to use EEPROM and Millis or I’m definitely need something like DS1307?
  2. how can i measure AC voltage?

thanks,
Anton

EEPROM has a relatively-limited number of erase/write of about 100K guaranteed.
Depending on how often you intend updating your counters, this may or may not be a problem.

A/C measurement? Bridge rectifier.

sorry i didn’t get about EEPROM number erase/write. Could you please explain more?

so if i will count Millis and write new digit to EEPROM in like every 5 minutes will it be fine?
power up->read EEPROM address->count → write new digit

will this work?

yes A/C measurement. should i use something like LM2940?

i want to build multifunctional display for my jetski

EEPROM has a limited number of times you can overwrite a given location.
There are lots of variables, but the manufacturers only guarantee that you can do this 100 000 times per location.

If you write to an EEPROM location every five minutes, then 100 000 / 5 = 20 000 minutes = just short of two weeks.
You could get a little clever by then writing that data to a different address in EEPROM, but it’s down to you to keep track of where all your data is written.

An LM2940 is a regulator, used to regulate DC voltage.
I don’t think it would be much use with AC.

What were you thinking of measuring?

now it’s pretty clear for me about EEPROM

thank you very much!

i’m trying to measure RPM
i have i wire goin from HALL IC thru CDI which gives DC 12v when engine is stopped and AC when engine is running

what should i use in this case?

Do you really mean AC, or simply a pulse train?

He probably means a “pulse train” (square wave pulses) coming off of a Hall Effect Sensor.

Posted by: nau Posted on: Today at 14:57:11
now it’s pretty clear for me about EEPROM

thank you very much!

i’m trying to measure RPM
i have i wire goin from HALL IC thru CDI which gives DC 12v when engine is stopped and AC when engine is running

nau, have you observed the pulses (what you call AC) by oscilloscope? What are the peak volts of the pulses? Are the pulses directly from the engine shaft?
These pulses are probably in numbers proportionate to engine rpm.
Does your jetski already have a tach?

One method used for measuring RPM by electronic tach is:
taking pulses from the ignition (or where ever) feeding them to an LM2917 frequency to voltage converter (lm2917 - Bing) and (http://cache.national.com/ds/LM/LM2907.pdf)
The LM2917 will output a varying dc voltage, which varies in amplitude in proportion to the pulse frequency of the input. Pulse frequency is (should be) proportionate to rpm.
(http://cache.national.com/ds/LM/LM2907.pdf) gives diagrams.

Another thing you could try.
Since the hall effect pulses are probably proportionate to rpm (I’m supposing here), 1)apply those pulses to your arduino,[be sure the pulses are at the proper peak voltage, (5v?)(3.3v?) or less?, before feeding them to your arduino] 2) code the arduino to count the pulses per second. 3) you might need to use some math to display the counted puses as rpm.

I’ve used both of these methods on a motorcycle. I save the counted pulses per second on an SD CARD. :sunglasses:

ups

just check wiring diagram
seems to be it’s like cpu fan
one wire from coil is connected to positive battery connection
and other is connected to negative through voltage regulator

how should i make connection?

should i connect like this?

pakrat, thanks for input
no i didn’t check with oscilloscope
all i did is just checked wiring diagram, seems to be pulses is goin from shaft. My ski had a tach (ic burned on it) ::slight_smile:

there is 12V, how should i connect it to Arduino?

If you write to an EEPROM location every five minutes, then 100 000 / 5 = 20 000 minutes = just short of two weeks.

I think you mean 100 000 * 5 = 500 000 min = 347 days

There is a guy who is adding arduino to his motorcycle in the Exhibition section (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1244069576) You can get an idea of how to connect to the power source if you read thru some of the entries there.

Basically take power from the main battery + terminal (+12v on MC). Then it has to be brought down to +5v (if thats what your arduino operates at. Does your arduino have a 5volt regulator ? Some have 3.3v) The - (neg) terminal of your battery will probably be connected to the engine block or the frame or chassis of your machine. That will be considered (called) ground (gnd), its that way on cars, MC’s, lawn tractors so probably the same on the jetski (although I’ve never looked that closely at a jetski). The arduino will also need to be connected to ground, you will be able to find the ground (gnd)connection on the arduino, there are more than one. One of the terminals of the arduino volt. regulator is ground also, usually you would connect input ground to that.

Read some of those entries in(http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1244069576). There are a couple of entries about the power source connections. One of the last entries suggests connecting from the +12v battery term to a 9v regulator first. Digi-Key Part Number 497-1447-5-ND (L7809ABV) about 94 cents. DIGI-KEY(http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=497-1447-5-ND) , then to the arduino 5v regulator. :sunglasses:

Kitep, 347 days is more than enough for 10 lifes of PWC :slight_smile:

pakrat, thank you very much

thats good point, i will stick with L7809ABV to feed my Duemilanove
but how should i connect a sensor?

here is my wiring diagram
it’s 12V on the coil…

seems to be MPGuino solve the same issue

can i connect my sensors like this?

i just leave only input details in original scheme