I would like to make a standalone data logger connected to a simple switch or sensor. I want the device to save date and time for when the switch is on/off. Then I want the data in .csv on my computer.
I'm not an engineer, computer scientist, programmer or even hobbyist. I just wanna get data quick and easy but I can't find any commercial product for this. After intense googling, I can only conclude that Arduino is the way to do it. So how would you explain to a ten year old girl how one might build and program this device, as small, simple and cheap as possible? What hardware must I have?
I use thew lascar USB devices for data logging and can certainly recommend them. 32000 bits of data are stored. fastest sample rate is 1/second which gives 8 hours worth. I normally use 1/minute on my wind turbine, which gives me around 21 days.
So... are you saying I need a voltage meter? What would I need that for? I'm not interested in measuring the level or strength or whatever of electricity. How would I connect it to the switch and what would it print for me?
I want the device to save date and time for when the switch is on/off.
I'm not interested in measuring the level or strength or whatever of electricity.
I wonder how with such little knowledge you would even think of implementing this with an Arduino. A switch is a device intended for use with electricity.
So here is how it works:
Use a battery, your switch and a voltage data logger. All of these devices should have 2 connections:
Battery: positive and negative. Let's call them B+ and B-
Voltage logger: positive and negative (but does not matter since you are not interested in any values, only if the switch is on or off). Let's call them M+ and M-
Switch: 2 identical connections, let's call them S1 and S2.
Connect B- to M-
Connect B+ to S1
Connect S1 to M+
For gould measure you could add a 1M resistor between M+ and M- but this should be not necessary.
Once you have this setup completed the voltage meter should log 0V for switch open and the battery voltage for switch closed.
If I remember it right 168 has 1k EEProm --> ~1byte per Event. So the events must not be more than 256 seconds separated. --> You can log for about 4000 minutes or 2-3 days or am I missing something?
Only 512 EEPROM. Sorry I was thinking 328 with 2k Ram. 300 events would be more realistic with 1k. Unless you only wanted 30 seconds accuracy. Then I could do events that are 2 hours apart. 4 hours apart would take an extra byte. That is not a limitation. If you wanted it to standalone for 10 days then it would only be able to log about 4 events per hour, assuming none happen while you're sleeping. Seems a little tight for 1k of Ram. How about 1 minute resolution? Or 328. Or SD card.
Best way is probably something like an arduino nano, sd card + slot, then just plug the sd in the computer and read your data, you probably could do the whole thing for 30$, and the time would depend on the size of the sd card
say you get a 2gb card which is like 2.1 billion bytes or something like that, and every event is something like
3/30/12 12:07 off,
3/31/12 14:08 on,
So that'd be about 2147483648/16== 134217728 events which I think if it switched every minute it'd last you 255 years, longer if its not done every minute, assuming if my math is right,
but at that point I think you would need a more accurate clock to be even close to good