[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself


View post   

File: 107 KB, 600x600, 11021-01a.jpg [View same] [iqdb] [saucenao] [google]
610374 No.610374[DELETED]  [Reply] [Original]

I have an arduino project I would now like to move to a circuit board and to make permanent.

It's a box with a keypad that upon entering the correct code, moves the position of the motor inside the box and allows the person to open it. A security box, I guess.

I was just wondering, do I need the 16Mhz crystal on the circuit board as well/any other components from the arduino itself apart from the ATMega328 or can the project be moved to the circuit board with the ATMega alone along with my components used in correspondence to the project?

>> No.610376

>>610374

If you don't need to change the code, you can just make a state machine, w/ latches. No MC needed.

>> No.610380

I have no idea if Arduino allows you to change the oscillator settings, but probably not.
If not, you'll need the crystal and the two capacitors around it. A 100nF power supply bypass capacitor is good to have and depending on your power supply, you might also need a regulator with the associated components.

>> No.610384

>I was just wondering, do I need the 16Mhz crystal on the circuit board as well
If you are taking out the ATMega from the Arduino boar then you need the 16Mhz crystal as well. Unless you can change the fuses to set on internal oscillator.
>any other components from the arduino itself
only what's described in the datasheet for ATMega328

>> No.610409
File: 544 KB, 500x308, YgrK01u.gif [View same] [iqdb] [saucenao] [google]
610409

>>610376
MC?

>>610380
Yeah it'll be a 9v battery but i'm planning on using a 5v regulator. So the crystal and the two capacitors? Okay.

>>610384
>If you are taking out the ATMega from the Arduino boar then you need the 16Mhz crystal as well. Unless you can change the fuses to set on internal oscillator.
I have no idea what the latter means so it's probably best I use the crystal and the two capacitors.
>only what's described in the datasheet for ATMega328
I guess I should give that a read huh?

Thanks for the help guys, guess i'll wait till the crystal and capacitors arrive before I test the circuit on a breadboard.

Also, do you guys have any good tutorials for the bluetooth modules and/or the Xbees? If any spring to mind that you have used in the past. If not, you needn't go out of your way to have a look. Just another question.

This is the Xbee I have
>ebay.co.uk/itm/271241119496?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

My bluetooth module
>ebay.co.uk/itm/Interface-Base-Board-Serial-Transceiver-Bluetooth-Module-For-Arduino-MEGA-UNO-R3-/271062162602?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item3f1c905caa

>> No.610417

>>610409
He means that you can put together some transistors and base the code on that.
No need for a microcontroller. Unless ofcourse you want to be able to change it on the fly.
I can't help you with the latches since i've never done it before but I have a general idea of how you would do it.

>> No.610419

>>610417
>and base the code on that.
code = passkey != software
I really should proofread

>> No.610423
File: 675 KB, 480x270, 1393732245852.gif [View same] [iqdb] [saucenao] [google]
610423

>>610417
>>610419

Ah okay I understand. And because I understand what you've said, I think i'll stick with keeping the crystal and capacitors. Seems a bit out of my league.

>> No.610835

>>610409
microcontroller

>> No.610838

what happens when the batteries run out?

>> No.610844
File: 16 KB, 500x435, Switch-20.jpg [View same] [iqdb] [saucenao] [google]
610844

>>610835
basically what I was suggesting was some sort of safety vault with no software.

>>610417
One could setup the states progression from inside the box, with some switches.

Of course, for large codes this could be not very practical.

Still, simpler than using microcontrollers and programming.

Don't forget Arduino timeouts after a few hours.

>> No.610847
File: 23 KB, 400x233, stateMachine.png [View same] [iqdb] [saucenao] [google]
610847

>>610844

also, some simple math:
for a case-sensitive alphanumeric code, one would need 62 symbols, therefore 6 bits for each word woud suffice.

For a 5 symbol code, one would need 30 switches, or 4x8-fold switch arrays to set tue code.

>> No.610852

>>610844
It sounds like the OP already has the required software.

>>610847
Why so many symbols?

>> No.610857

>>610852
>required software.
Just giving hints on how to do things differently.

>so many symbols
>ABCDEFGHIJKLMNOPQRSTUVWXYZ
>abcdefghijklmnopqrstuvwxyz
>0123456789

There's 62. Of course one could also use only numbers, but that makes it harder to remember.

>> No.610861

>>610847
This state machine have fixed length symbol.
It also hard to read matrix keypad without microntroller.

Of course, i also think OP can use shift register, EEPROM and some gate logic. The idea is to to compare entered symbol serially with eeprom content.

But tbh, it's too costly compared to a single microcontroller doing all those things.

Rather than wasting on such electronic, might as well use steampunk style latch. eg: Use mechanical gear to release latch one by one, until finally box open.

>> No.610862

>>610857
Giving hints how to design it when its already designed... Well, maybe he wants to make another at some point.

>62 symbols
Have you ever seen a safe or a door lock with so many keys? Actually, have you ever seen one which allows other characters than 0-9 in the code?

>> No.610873

>>610862
>62 symbols
A high school combination lock might have 100 numbers (symbols) on it, and at least many old fashioned safes used to be the same way. Using ASCII, as for a passphrase, has something not too far from 62 symbols, IIRC, for a more modern example of security.

>> No.610875
File: 938 KB, 1280x1456, 1393992457592.jpg [View same] [iqdb] [saucenao] [google]
610875

>>610838
I'm hoping to have the batteries on the rear of the box but if not it isn't too much of a problem if they're inside. The box isn't for me, it's part of a package for someone else. It's intended for a one time use.

>>610844
The box will have a on/off switch so I don't think the timing out will be a problem. The code itself isn't very large. It's like 40-60 lines of code.

Although you say it may be simpler to use switches, i'll stick with the arduino since it's basically done. All I have to do is move it onto a circuit board after farting around with it on a breadboard.

>>610847
>>610857
The keypad i'm using is one with 0123456789*#. No letters on there.

>>610861
I was thinking about taking the mechanical route earlier but I chose to stay in my comfort zone.

You guys are too competent for me I tell you.

Also guise, apparently the ATMega328 has an internal 8mhz clock so I may use that. That would mean I don't need to purchase/use an external 16mhz clock & the capacitors.

>http://arduino.cc/en/Tutorial/ArduinoToBreadboard
On the section titled Minimal Circuit (Eliminating the External Clock)

>> No.610878

>>610873
Lol, I expected that reply and that's why I said "keys" and "other characters than 0-9". Because from the user's point of view, it's still a number lock. The fact that you can enter two numbers at a time is just an implementation detail. An electronic implementation wouldn't have 100 keys, just 10.
Now, nothing would prevent from labeling the mechanical lock's disk differently, with 100 symbols, but no manufacturer does that. Or at least such locks are very uncommon novelty items.

>> No.610881

>>610875
>Also guise, apparently the ATMega328 has an internal 8mhz clock
Yes, that has been mentioned already. However, it's likely that you can't change the oscillator settings from Arduino software, as it would break the bootloader. Changing the oscillator fuses with a dedicated programmer is easy, if you happen to have one.

>> No.610885

>>610878
You're probably right; the weakest point would not be the code but the rest of the security.

>> No.610900

>>610881
Ah yeah right, sorry.

What does it mean to change the oscillator settings? The arduino tutorial sounds like it allows you to use the internal clock. I thought that would be it?

It says todownload a sub folder that they stress to be necessary for it to work, could that be what you're thinking of?

I'm sorry if I sound naive/idiotic, I ony recently picked up electronics and the arduino up as a hobby recently.

>> No.610948
File: 43 KB, 640x480, keypad.jpg [View same] [iqdb] [saucenao] [google]
610948

>>610878

A common security problem is forgetting the right key.

By using a greater number of symbols, the same key is written in a shorter form (easier to remember) for a solution space just as manifold.

>pic related
>use # or * as shift key

>> No.610960

>>610900
Go download the microcontroller's documentation. It'll explain everything.

>> No.610962

>>610900

There is a way to change Arduino's timer's settings, but that will change many more things.

For example, for PWM period modulation.

I never looked much into it.

>> No.611633

>>610900
>>610962
It can all be done through the arduino IDE. Just look up a tutorial on burning the bootloader into a fresh chip. It lets you choose your frequency, 8Mhz is the fastest you can go without a crystal.

It's really fucking simple shit if you look into it.