Storing data when turned off

Bryang

Member
Hi,
I've set myself a little project... a series of electronic keys to enable time 'credit' for the kid's access to the TV, x-box, etc.

My thoughts are simple resistor keys recognised by the Picaxe ADC pin, I can do a coundown per whoever's key is plugged in per an LCD, and I can turn on/off the power thru a relay - I can do these OK, but how do I log
how much credit they have used so I can continue the countdown next time they plug in their key or turn on the power? I assume it needs non-volatile memory to write time tags to, but I've not done any memory stuff before - any suggestions out there how to shortcut this aspect of my project?

Thanks, Bryan.

 
 

moxhamj

New Member
What a fantastic project idea! Once you get it working this could make a great electronics magazine article. One option would be to use the little 8 pin i2c bus eeprom chip to store the time remaining. There is info on this in the picaxe documentation. I presume you could have a master key that resets the time (and if so, you would need to keep it well hidden!)
 

hippy

Ex-Staff (retired)
Depending on the type of PICAXE, you have up to 256 bytes of non-volative storage on-chip which will be retained when power is removed. have a look in the manual at the EEPROM, READ and WRITE commands.

The only thing to bear in mind is that this Eeprom, like most others, has only a limited number of writes ( about 1 million ) which, although a lot, can be used quite quickly if you write to the Eeprom too frequently ( reads do not wear it out ).

Writing to Eeprom once every second may wear it out in under two weeks, once a minute would give about two years of life. Because you'll probably only be writing when a key is in place and the TV is on, that should extend the lifetime. There are also software tricks to extend the lifetime, but they probably won't be necessary.
 

moxhamj

New Member
There is a solution that involves only writing the data to the eeprom when either a key is removed OR when the power goes off, but the complexity of a "power going off" circuit might not make it worth while. Hippy's idea of writing infrequently (eg once a minute when the key is in) probably is the simplest. The LCD isn't absolutely vital - even simpler could be a buzzer with a series of warning beeps in the last 5 minutes. One can think of one of these time boxes for each computer, the TV, xbox. Kids get to use the master reset key when they have cleaned their rooms?!
 

Bryang

Member
Hi,
thanks for suggestions.
I think 1-minute incriments will be more than adequate, and hopefully within a year or two the kids may have learned how to manage their credit limits.

My thoughts on the 'master' key... having 2x key slots, so that the master key can also be plugged in, and having a couple of buttons, to be able to add (or subtract) onto the credit left on the slave (or should that be kid's?) key. That's the main reason I thought of the LCD, so I can see the credits left, and the number of credits I'm adding on. I'm happy to post the end result.

footnote: she who must be obeyed has suggested I put a counter on the exercise bike we have in front of the TV, so that they can gain credit by exercising (I think she really meant MY credits!)

Bryan.

 
 

jwhooper

Senior Member
I have been trying to find a shutoff solution to keep my sons (13 and 14) off the computers late at night.

Being a software developer, I wrote a Windows service to shut down the computer during forbidden hours. They changed the system time. I had the service update the time from the internet. They changed the time zone. I used GMT. They disconnected from the internet and changed the time.

I'm sure they will experiment and shut down my service from the task manager if necessary. Also, if they look hard enough, they will discover the "abort" command to the awful Windows shutdown program.

Anyway, I can see great value in a hardware solution to this type of problem. My dream is a device that must be present for the computer to operate, with its own internal clock, that shuts down the computer during forbidden hours.

I thought about x10 home automation to shut off the power, but they would use the hot plug or get an extension cord.
 

thelabwiz

Senior Member
The "dongles" used for software protection (must have the device for the software to run) are available in USB and parallel port versions. Some have an internal clock.
Probably not cheap (last I checked, they wanted $50US for most of the evaluation kits - haven't priced them recently).

If you're interested, I can provide company names.

John
 

inglewoodpete

Senior Member
Have you thought of an non-computer solution? Like a PIR burglar alarm in the basement - perhaps have it armed by its own PIN controlled time clock.

It's first test should be quite memorable! See if you can catch it on video ;o)
 

KMoffett

Senior Member
jwhooper,

I hate to say this, but the best solution, long term, is to "be the parent". In trying to play "technical games" with them...you will lose. Think about what this is teaching them about respect for you, and authority in general.

Sorry for the interuption...Now back to our regularly scheduled thread. ;)

Ken
 

thelabwiz

Senior Member
The x10 solution will only work if you use a fixture mounted module (wired inside the PC case) so it can't be bypassed by plugging the cord into another outlet.
The XPFM is about $16US plus shipping from ebay express:
http://cgi.ebay.com/X10-PRO-Inductive-Load-In-Line-Module-120-VAC-15A-XPFM_W0QQitemZ9722803434QQihZ008QQcategoryZ40976QQcmdZViewItem

I agree with "be the parent". This hardware solution only fixes one problem. The "peopleware" solution fixes this and future problems.

John
 

jwhooper

Senior Member
One should not presume that I am unable to "lay down the law" and dominate my teenaged sons. Maybe I simply have no life, and nothing better to do than play technical games with them. It's fun.

I take it that most here don't really NEED to automate things, and often could buy whatever they need off the shelf for less money, especially if one's time is worth anything.

In this spirit of fun, I am looking for clever ways to deny access to a computer during certain hours.

My sons have helped me build computers before, but I wonder if they would think to look inside, or if they would notice an innocent looking circuit board with a clock that sent a power off signal to the mainboard pin?


 

hippy

Ex-Staff (retired)
They'd probably not spot the unit inside the monitor which simply blanked the display for most of a minute once activated wirelessly from elsewhere. They'd soon get bored of 10 seconds on, 30 seconds off but it wouldn't prevent them closing down Apps and the PC.
 

jwhooper

Senior Member
Ah, that is a fine idea. Hadn't even thought of the monitor. All I have to do is figure out how the PC indicates that the monitor should sleep, and then hijack it.
 

pbunyan

Member
the monitor goes into sleep mode when there is no signal present, but it is plugged in, (i dont know how it tells when its plugged in, but if its not plugged it it comes up with "not connected"), so you could have a dongle that goes in-between the two and shuts of the sync signal, or the color signals, but leaves the rest connected, which may work

i wouldnt try opening the case of a CRT, just in case you where thinking of it, as the high voltages can easily kill.

Edited by - pbunyan on 22/09/2006 17:56:43
 

jwhooper

Senior Member
Yes, I was certainly looking for a way to avoid opening the case. I almost killed myself trying to dislodge something that fell inside a window air conditioning unit. I used a big screwdriver, like a big idiot, and ended up getting bounced around on the floor for a few seconds.

If I can't do it on the low voltage side of things, I call in my father-in-law, a licensed electrician.

I need to take a peek inside the computer to see if there is any change of sending the signal from there. If not, the cable is worth a try.
 

thelabwiz

Senior Member
Maybe a screen saver that is triggered by time instead of inactivity?
Have it run as a system service so it's not readily found and killed.

The high voltage in a monitor can knock you back, but it's such low current that you're more likely to be injured by the things you bump into while jumping back from it. I did TV and communications radio repair for a number of years and am much more worried about the mains voltage on exposed terminals in the case than I am about the multi-kilovolts that light up the CRT.
The high voltage at the TV transmitter where I once worked was much more of a concern - 5800 volts at 10 amps (yes, that's more than 50 kilowatts). Needless to say, we had grounding probes with number 6 wire connected to the cabinet frame and a long insulated handle for ensuring all the capacitors were discharged before putting a hand inside the cabinet. Any maintenance that required opening a cabinet door mandated having two people - one to open and discharge, the other as emergency help.

John
 

Bryang

Member
Hi,
this thread has gon further than I thought it would...some interesting comments:)

I still think that having a 'credit' system is the way to go for me, the idea being that they might learn a bit more about managing limited time resourses, similar to managing any income they may make in the future (we live in hope!)

So, back to my first idea of the key, I think now I'll now make up my own 'smart' dongle to do the managing/tracking with an 08M, that I'll put into a DP9 housing, with the rest of the electronics in a box to plug into the wall socket. I figure the key will most likely be lost or otherwise killed before I wear out the write cycles of the PICAXE.

My question is, if I'm then plugging & unplugging (in effect) the PICAXE while there is still power to it, will I need to protect it from spikes, etc? Would this be a case of a cap & a resistor on the +5V pin? any suggestions? or is it robust enough to cope with repeatedly plugging & unplugging 'hot'?

Hopefully I'll actually get a couple of hours to get into it tomorrow, so any suggestions would help.

Thanks, Bryan


 
 

thelabwiz

Senior Member
If the PICAXE will be on the "key" that is plugged in/out, ideally you would have "sequenced" connections - ground pin first, then signal pins, then power pin.

This is a little difficult with a db/de9 connector as all the pins are the same length.

Just provide a pull up/down resistor on each pin and a small ceramic capacitor to ground on each signal pin that's used. That mey be overkill, but I don't know what the static electricity levels are in your house during winter.

John
 

MPep

Senior Member
Bryan,

What a fascinating idea. First time I have read it is just now.

What about the following idea:
get a memory card [SIM card type], integral EEPROM, for each kid. The time period could be stored per person. Provide a slot for the SIM. This way you don't ruin the PICAXE by using all the memory for every user. This should significantly prolong EEPROM life.

The only thing required would be as serial number (or equivalent). You read the serial number as identity, read 'remaining' time etc.

SIM cards however require an external clock, and have data out and data in. So I2C is not an easy option.
[i suppose you could connect DO and DI together, have't tried it though]

But the idea may prompt you in the right direction.

Edited by - MPep on 24/09/2006 22:22:03
 
Top