Need to communicate with arduino without being able to change the Source Code

Hello,

So I have a weird project. I'm not an expert by any stretch of the word so please excuse me if the question is stupid.

To be able to get the gist of what I want to do I'll just tell you the project itself.

I'm creating a safe that only opens in preset times. The uses for this aren't something I'm comfortable with sharing but the gist is that I'm trying to control certain habits.

Since I want something practical and cheap I went the the absolute cheapest simplest option which only consists of a stepper motor and the arduino. It is controlled via serial and whenever I want to open the safe I will connect it via USB to my phone. It should check the time and then open if the time is right. After it opens it lets me set the next time it should open and then it closes.

Sounds simple enough. Until I was hit with two realizations. First is that the arduino has no clock module built in. And second is that I can just connect the arduino and upload a different source code to open it any time. Now I really don't trust myself not to open the safe randomly unless it would take me a lot of work (+2 hours). preferably the only way to open should be when it is time or if I physically break it (and with this thread as a proof.. I'm not the best hacker around so it doesn't have to be NSA approved).

The Safe itself and how to assemble it isn't a problem, neither is writing the code which took me less than one hour of copy pasting and modifying. But I still can't solve the two problems mentioned above.

The solutions I came up with (which are all impractical/expensive IMHO) and I'd love easier ones I'm sure exist.

1- Connect the arduino to the internet and control it that way (expensive).
2- Connect it via bluetooth (still expensive).
3- Booby trap it so if I try to send any signal through any pins other than the ones that control the motor it would disconnect/fry the arduino. This way I can just let a friend choose the pins and assemble it. Then keep the source code at his PC (Risky, any mistake would ruin both the safe and possibly the arduino)

Those are the solutions I came up with, which I'm sure should work. But I'm absolutely sure that there is another way I didn't think of.

As for the "time" problem, the only 2 solutions I came up with are either buying a module or checking the time using the mobile which will get the time from the internet, encrypt it (very simple password/encryption), then send it to the arduino to be decrypted and checked. Problem with this approach is that it means I have to sacrifice the Source for the Android app if I manage to make it in the first place (never tried.. but know some java and I think I can pull it off). But either way it's too much work and I'd rather something way more simple using only serial and nothing else. Especially since this project isn't something I'm doing for a hobby but it's something I actually need desperately (I know that similar products exist online.. but they are too limited since I plan to expand on this project in the near future).

I reckon a servo would be a lot easier to use than a stepper motor.

I don't understand why you consider Bluetooth to be expensive. Using bluetooth would allow the Arduino to be physically inaccessible for uploading code.

You can add a Real Time Clock (RTC) module to an Arduino.

AFAIK it is not possible to connect an Arduino to a phone using USB.

...R

Robin2:
I reckon a servo would be a lot easier to use than a stepper motor.

I don't understand why you consider Bluetooth to be expensive. Using bluetooth would allow the Arduino to be physically inaccessible for uploading code.

You can add a Real Time Clock (RTC) module to an Arduino.

AFAIK it is not possible to connect an Arduino to a phone using USB.

...R

It's expensive as in I don't have the parts and I can't spare money (University student here). I already got an RTC since it's cheap which solved one problem.

Robin2:
AFAIK it is not possible to connect an Arduino to a phone using USB.

It totally works. You just need an OTG cable and there are apps on the app store that opens serial communication. Works just like on PC.

The HC-05 Bluetooth module is less than $1 from China.
If that is "expensive", then you need to be finding else to do.

ieee488:
The HC-05 Bluetooth module is less than $1 from China.
If that is "expensive", then you need to be finding else to do.

Sadly I live in Jordan. Here it costs around $20 and shipping it from overseas and waiting two months is an issue.

Have you a second Arduino?

If so maybe you could use it instead of the phone and create an infra-red link with the Arduino that controls the lock. This Serial IR Thread may be of interest.

...R