Mag Lock System - Startup Check

Vespen:
Edit:
Excuse my ignorance with the bootloader, the only discernible way I could see this working with my present understanding would be if the board was recognized. At all.

To burn a bootloader, you'd program another Arduino as an ISP programmer, connect it to your board/chip, then burn the bootloader with that second Arduino. The one having the bootloader burnt to it doesn't have to be connected to the computer at all.
I have an ISP programmer and boards to hold ATtiny84, ATtiny85 and ATMega328P chips for the process, but using the above method is almost identical. The second Arduino is an ISP programmer.
Check out Nick Gammon's page here:- Atmega bootloader programmer

Steve: On the two failing together I did happen across something interesting a couple of hours ago. According to the OEM, Win 10 has a few known issues with connecting and, in some cases, cease to recognize a board either entirely (albeit still showing it in the DM) or the more likely, failure in the IDE. The solution was rolling back to 1.6.5. I didn't immediately notice issues with the others while still on 1.6.7, but the program environment itself was strangely slow to act. I did a total removal in reinstall to roll it back, greased lighting. Very strange.

Do you mean that the problem is now fixed?
(I use V1.6.5, and have no plans of upgrading any time soon due to the various issues with V1.6.6 and V1.6.7.)

So there is in fact a method for programming it without the need for the PC to interface with the 'dead' board. That is phenomenal. Seems like I learn more about these little boards daily, it's outstanding.

I have an ISP programmer and boards to hold ATtiny84, ATtiny85 and ATMega328P chips for the process, but using the above method is almost identical. The second Arduino is an ISP programmer.

Would you mind if I asked what the particular purpose of this would be? One of, if not a more obvious, I would guess would perhaps be a rescue unit for situations that could potentially be just like mine. Secondly, I could see this being used for the programming of a unit that is part of an installation (immobile) to avoid the need to rip the unit out and go through all those pains. Granted, I admit fully that I have no yet read the page so my understanding could be quite lacking. Perhaps it only reprograms the original settings?

Regardless,

Do you mean that the problem is now fixed?

100% honesty, I have no idea. I do know that the other boards are behaving normally thanks to 1.6.5 as is the IDE. I sat the injured/dead board aside and have encased a SainSmart clone which will serve as the test unit. My parts are slated to arrive tomorrow, a slew of 'em, so I may attempt to resurrect the little guy at that point. I feel I led you, and the other posters, on a crazy side track. Granted, it was extremely beneficial. Nevertheless, I don't want to seem like I'm wasting your time. To that end I'm going to try to focus back in on this creature (I've been looking at CNC kits, and that's just a terrible idea :grinning: I'll never get this done if I don't quite gawking bahaha.)

All this said, I'm presently starting fresh with the breadboard and situating the wiring. I'll touch back in shortly once I get it set and fire it up (after... I check the pins at least three times...)

Vespen:
Would you mind if I asked what the particular purpose of this would be? One of, if not a more obvious, I would guess would perhaps be a rescue unit for situations that could potentially be just like mine. Secondly, I could see this being used for the programming of a unit that is part of an installation (immobile) to avoid the need to rip the unit out and go through all those pains. Granted, I admit fully that I have no yet read the page so my understanding could be quite lacking. Perhaps it only reprograms the original settings?

I make my own custom boards for each of those chips, with onboard hardware depending on the project. I only use my UNO boards for basic prototyping when I'm planning to use a '328P, or for testing code ideas etc.

I could just put ISP headers on each board, but that takes up a bit extra board space, makes PCB layout harder since I mostly use single-sided PCBs, and limits what can be connected to the MOSI, MISO and SCK pins without adding extra jumpers, so I made separate programming boards for each chip, with a ZIF socket on the '328P programming board to make it easier to insert/remove chips..

Another benefit is that a bootloader is no longer needed when a chip is programmed via ISP insted of serial, leaving more room for the program itself. That's not so critical with the '328P, but essential with the ATtiny84 and ATtiny 85 since they have very limited code space. (They're little 14-pin and 8-pin chips respectively.)

The third advantage is that a stand-alone board uses far less power, since there doesn't need to be a USB to TTL chip, power LED or 3.3V regulator, and a lower power 5V regulator can be used.

For most projects, I set up the chips to run at 8MHz on the internal oscillator, too, so the pins usually used for the crystal can be used as extra I/O pins. Another essential for the little 8-pin ATtiny85 chips.

I've never yet used a full-blown Arduino board in a final project.

Oh, and also, as you mention, it can be easily used just for simply burning a bootloader for a chip to go into an Arduino board, without the extra hassle of setting up an Arduino as an ISP programmer. (MY ISP programmer, a "USBASP", only cost $2.56 delivered, so cost wasn't an issue at all. :slight_smile: )

This is a simple example of the custom boards I mentioned. I wanted to reduce the number of pins needed to connect a keypad, without using the crude resistor network method, and also wanted to retain the full features of the "Keypad" library, so made this to read the keypad with that library using an ATtiny84 chip, which then communicates with the host board via I2C, so only two I/O pins are needed instead of 8:-

My initial response to that post was more of a face than a combination of words...

:o

Update:

Frankly that is superb. I love clean work. Absolutely. Love. It. I feel like every reiteration of my desktop sees more time into cable management than actual install. Was this a PCB you cut yourself? I did see the designations on the reverse but they aren't immediately familiar to me, say as a brand.

I completely understand how this could be a huge advantage! I'm absolutely certain I have been probably flaunted my inexperience with Arduino throughout the thread with such comments but BAM! I have so many projects floating about in my head that it is just crazy. Granted I hadn't sat down for my usual hour of research before starting any project, just a principle I've found has kept me from totally FUBARing a new idea... but still, that's exciting just to read through seeing as I was weighing out options based on how many full units I had laying about. To be plain, I have to ask if you'd be open to me picking your brain with regarding some of the above mentioned, aside from a few other projects? Obviously within reason and well and away of anything personally proprietary. Perhaps PM me if so? I don't know policy for the forums as far as off-topic or crazy long threads. Either way, any consideration is appreciated as much as the assistance already provided!

To the project at hand:

Minor delay on the breadboard wiring, had a NAS pack it in and fail on my home server. Had to help swap that back out.

Given that the current layout... Here:

It occurs to me that I have only accounted for the "test" circuitry in getting to understand the process of making this whole addition work (the system check, that is). The original file uses a few more relays. Would it be quite difficult to expand it? Or perhaps just a replication of the components to the left of the 15k for instance?

Vespen:
Was this a PCB you cut yourself? I did see the designations on the reverse but they aren't immediately familiar to me, say as a brand.

"Control Electronics" is me. I've got all of the stuff here to design and etch my own boards. It's one of my favourite parts of the hobby.
Thanks for the kind words on the results. I take pride in trying to make neat, clean boards. The copper is coated with a layer of PCB lacquer, so it never oxidises and loses that shine.

To be plain, I have to ask if you'd be open to me picking your brain with regarding some of the above mentioned, aside from a few other projects? Obviously within reason and well and away of anything personally proprietary. Perhaps PM me if so? I don't know policy for the forums as far as off-topic or crazy long threads. Either way, any consideration is appreciated as much as the assistance already provided!

No problems at all. There's nothing proprietary in my methods. To avoid cluttering this thread more than I already have, I'll PM you with a little more info. Now back to business.....

To the project at hand:

Minor delay on the breadboard wiring, had a NAS pack it in and fail on my home server. Had to help swap that back out.

Given that the current layout... Here:

It occurs to me that I have only accounted for the "test" circuitry in getting to understand the process of making this whole addition work (the system check, that is). The original file uses a few more relays. Would it be quite difficult to expand it? Or perhaps just a replication of the components to the left of the 15k for instance?

Yep, I thought I'd mentioned this.
You're right - you only need to "replicate the components to the left of the 15K" resistor, then tack additional stages on at that junction, (the junction of the diodes and R5). Then when any of the relays fails to operate, a 'LOW' will be present at the digital I/O pin, (D7).

Yep, I thought I'd mentioned this.
You're right - you only need to "replicate the components to the left of the 15K" resistor, then tack additional stages on at that junction, (the junction of the diodes and R5). Then when any of the relays fails to operate, a 'LOW' will be present at the digital I/O pin, (D7).

Excellent! Alright. To get moving again I am going to check the original schematic with my board and ensure I don't botch another controller (tiny waterfalls are evidently rare) and then, pending that and prior to more complex wiring, I will sketch out my understanding of the additions and toss it up. Sound agreeable?

Vespen:
Excellent! Alright. To get moving again I am going to check the original schematic with my board and ensure I don't botch another controller (tiny waterfalls are evidently rare) and then, pending that and prior to more complex wiring, I will sketch out my understanding of the additions and toss it up. Sound agreeable?

Yep. :slight_smile:

Update!

Hey! For anyone who's been reading this I'd like to post a couple of messages that got excluded from the ongoing thread here. My advanced apologies for leaving anyone hanging, I got a bit overzealous with some unrelated messages and jumped track briefly. I'm going to put the couple of missed bits between Steve and myself below and resume from there. OldSteve has agreed to allow me to back up and repost these missing bits.

Thanks again Steve, honestly if you hadn't pointed it out I may have missed it entirely.

Vespen:

I wonder if you have every run across/created yourself a small circuit to help protect against this? Is that even possible? I've seen voltage protection/prevention systems before but obviously 99% of those are control with complex systems. I'd wanted yield to far more knowledge than what I have and ask before I go on a wild goose chase.

-This was in reference to previous posts regarding a dead Arduino and protecting the build later on down the line.

OldSteve:

Protection is provided on the barrel jack for DC power input - a series diode.
For other pins used as inputs, it's not hard to add protection in the form of series resistors and diodes from ground to pin, then pin to Vcc. It's not worth the expense and effort though. It's better to just make sure things are done properly before connecting power.

Vespen:

Copy that, very good. I'll move along then. This does bring me the the next logical line of thinking. Given that the magnets/strikes use a fair amount of power (granted nothing staggering) I'm assuming I'll need to either provide two separate power sources or create a circuit to distribute it such a:

Primary IN: 24V (from 120VAC already installed in location)
Split 1: 14VDC > Mags/Strikes
Split 2: 9VDC > Arduino Unit

This sound about right?

OldSteve:

9V sounds fine for the Arduino. Regarding the other stuff, if 14V is what they need, all you need to ensure is that the supply can provide enough current for them. You'll need to check their ratings vs that of the regulator that you choose for that.

Regarding those magnets/strikes, I guess you mean they're coils/electromagnets. You'll need protection diodes across the DC supply to the coils. A 1N4002 or similar will do the job, as close as possible to the pins, with the cathode towards the more positive connection.

Flyback Diode.JPG

Regarding those magnets/strikes, I guess you mean they're coils/electromagnets. You'll need protection diodes across the DC supply to the coils. A 1N4002 or similar will do the job, as close as possible to the pins, with the cathode towards the more positive connection.

This is actually one of the few components that won't need any outside interaction other than bringing power in. The magnets and strikes are complete, I was able to find the strikes for relatively low cost and the magnets were just dumb luck. Lower door is 600LBS breaking force and the upper door is 330LBS.

I'll post links to these tomorrow once we close up shop, just for reference.

OldSteve:
A 1N4002 or similar will do the job, as close as possible to the pins, with the cathode towards the more positive connection.

Very common misunderstanding.

Whilst convenient and not generally making a great difference, the diode should not be on the solenoid end of the interconnecting cable.

You have to think carefully about the reason it is there to understand why.

Paul__B:
Very common misunderstanding.

Whilst convenient and not generally making a great difference, the diode should not be on the solenoid end of the interconnecting cable.

You have to think carefully about the reason it is there to understand why.

Since it's there to protect the driving transistor from the negative spike generated by the coil when it's de-energised, surely placing it directly across the solenoid terminals achieves this?

OldSteve:
Since it's there to protect the driving transistor from the negative spike generated by the coil when it's de-energised, surely placing it directly across the solenoid terminals achieves this?

It may do, but if it is the transistor that needs to be protected, then the diode should logically be at the transistor end.

I have explained this on a number of occasions.

The inductive "spike" is generated by the transistor switching off. The coil merely behaves such as to maintain the current flow. The placement of the diode makes little difference to the current flowing through the coil, but if adjacent to the coil, then the current in the interconnecting cable is interrupted precipitously and that may propagate an inductive impulse to other areas.

If the diode is placed in proximity to the switching device and the supply bypass capacitor, then it is only the current in the loop of those three components that changes impulsively, the current in the interconnecting cable follows that in the coil which undergoes an exponential, not instantaneous decay. The voltage transient is essentially the same at all points along the interconnecting cable.

Paul, that's just your opinion. I was taught to always place the diode as close as possible to the inductor.

To quote the Wikipedia article on flyback diodes:-

To minimise the antenna-like radiation of this electromagnetic energy from wires connected to the inductor, the flyback diode should be connected as physically close to the inductor as practicable. This approach also minimises those parts of the circuit that are subject to an unwanted high-voltage — a good engineering practice.

That was fom here:- Flyback diode

I could dig up many other references to this, and they all say exactly the same thing. In the following post on electro-tech-online, towards the end:-

The diode should also be mounted close to the coil rather than
far away.

You're entitled to your opinion, but I'm entitled to disagree, and still recommend placing the diode close to the inductor, as I was taught.

I can't help noticing that in the four pages of this thread you haven't made a single positive suggestion to help Vespen with his project. You've only replied to argue with my suggestions when I try to help, picking on minor points. Nothing better to do?

And that is why Wikipedia is not accepted as an academic source.

Ad hominem eh? Sounds like you are on shaky ground! You are confusing an explanation with an opinion.

For anyone following the thread related to my initial post, please disregard this and skip forward to the next post related to the magnet locking and system check circuitry. I apologize for the break in focus.

Allow me to repeat myself, the magnets are self-contained. Protection from the aforementioned was built into the units and is not necessary. Each of them, including the strike plates, are isolated entities which only receive incoming voltage to pass it along.

No disrespect Paul, but the above would only just pass as constructive information for other readers by a small margin. What you're writing may be factual information backed up by your experiences or education, that much I can accept. While I am obviously the most inexperienced individual in this thread, I'm also the purpose for it to exist. I put it up to ask the advise of those more experienced and knowledgeable than myself. I didn't put it up to create a staging ground for a measuring contest nor has OldSteve, or anyone else, attempted to manifest one.

While I do not have an opinion qualified enough to comment on the proper use of diodes, I know very well the trials of being the least knowledgeable person in a room. Though I am thick or stubborn enough to ignore it, this isn't the case for everyone.

For many others lacking the same education/experience in a certain topic or field, running across a bickering match between two seasoned individuals, much less when one seems insistent on turning it into a contest, either in a thread of their own or threads they have found while looking for help with their project, can see it as overwhelming when the debate contains information, relevant or not, being thrown around like spears. It can deter them from reaching the information that may help them further down the respective thread or, worse, stop them from asking questions out of the fear of being humiliated for not knowing enough. Read those posts above again and explain what a new person to electronics but trying to learn will gain from that.

I ask that you offer your opinions constructively or not at all. Having looked back, it does seem like the only comments you've offered so far have been deliberate barbs aimed at proving how much more you know. Being unprovoked I can't say I understand why but I will say that if this is all you have to offer, I do not need your help. Please disregard my thread and spare me your opinion. Someone else, in some other thread on some other topic could greatly benefit from how much you know about what is covered here on the forums.

So far, in spite of efforts to respond to you in a positive and constructive manner, you have only posted lecturing masquerading as advice which seems to be aimed at proving you know more than someone else. You have arrogance confused with being advice.

And that is why Wikipedia is not accepted as an academic source.

Ad hominem eh? Sounds like you are on shaky ground! You are confusing an explanation with an opinion.

No one will benefit from this.

Steve:

I'll have to pull up the datasheets again but here are the model numbers:

Magnets: VIS-ML300 by Visions
Strikes: Leviton 79A00-1 12VDC Strike (Lock)

I'll put those up in a bit, we had some power outages and I'm having to sort the outlets feeding, of course, my workroom.

Vespen:
Steve:

I'll have to pull up the datasheets again but here are the model numbers:

Magnets: VIS-ML300 by Visions
Strikes: Leviton 79A00-1 12VDC Strike (Lock)

I'll put those up in a bit, we had some power outages and I'm having to sort the outlets feeding, of course, my workroom.

I just checked them out. They look pretty good.