which arduino need expert opinion

Hello, I am transitioning from building discrete components to using a micro processor. There are several Arduino boards, clones, etc. I have only (3) tasks that need to be performed in this project.

  1. dark sensor, LDR wakes processor at dark and puts it in sleep mode at daylight.

  2. a clock upon waking, counts to 20 minutes and sends a HIGH OUTPUT (5v) for 12 seconds.

  3. Upon a high signal from a PIR (in the dark) it also sends a HIGH OUTPUT (5v) for 12 seconds, HOWEVER...the board must wait 10 seconds longer (delay) before excepting another signal from the PIR.

I am at the beginning of this transition and hope to learn a great deal from the good people on this forum.

Thanks

www.xyproblem.info

So what is you actual question?

If you are new to Arduino I would start with an Uno and go through the examples in the IDE. For this project you could use an UNO, a RTC, a LDR or photoresistor.

maybe a smart question?. prefaced by, I don't need a bunch of bells and whistles, I need to perform the (3) stated tasks. major consideration are size, power consumption as it is battery operated and of course it can do the tasks. so which is the smallest, simplest, easy to work with that can accomplish my goal?

could I use a nano? is there something better?
can a nano be put into deep sleep?
can unused in and outs or anything else that is not absolutely required be disabled?

how would you use the photo resistor? I would use a LM339 comparator circuit, perhaps I forgot to mention I don't want to build discrete components any more. so do you have a simpler solution to achieve hysteresis? the examples I have seen using LED's, they get brighter as the LDR get less light. I need either on, or off.

my thought is one could measure the resistance of the LDR at a given time = light value, allow a window and tell the controller any where between X and Y go ON or OFF? that's with a question mark. I am totally new to this but I am an avid reader and learn quickly. I just have to be pointed in the right direction.

in short, I don't want to experiment right now. I want to determine if a task can be accomplished, which components will be required and accomplish the task.

You should be able to use a Nano along with the other components I suggested.

my thought is one could measure the resistance of the LDR at a given time = light value, allow a window and tell the controller any where between X and Y go ON or OFF?

Yes, this should be easy to do.
Read the time from the RTC, then read the light value and either turn it on or off.

Also see Nick Gammon's page on power saving techniques and sleep.Gammon Forum : Electronics : Microprocessors : Power saving techniques for microprocessors

The best Arduino for a first project is an Uno because almost all the software and add-ons work with it.

When you get the project working and have more knowledge of the system you will be able to decide if another board would be suitable for the long-term version of the project.

You say "I don't want to experiment right now", but if you are new to Arduinos that is exactly what you will be doing. Learning cannot be avoided except by paying someone else to build the project.

...R

ANY Arduino wil work GREAT.

your requirements are at the beginner level.

UNO is the recomenede one for all the reasons in post #5

your post says 1 input and 2 outputs.

all very simple. you should get this done with minimal problems.

Fredric58:
so which is the smallest, simplest

These requirements are contradictory. Small is not simple. Start with an UNO (large and simple) and then once you have it all worked out, transfer to a smaller Arduino.

could I use a nano? is there something better?

Yes, you could use a Nano and yes there is something better. An UNO is simpler. A Pro Mini will have lower power consumption but it requires a separate programmer (complex.)

can a nano be put into deep sleep?

No it can't but you are asking the wrong question. The microcontroller should not sleep in the way that you have asked. What are you really trying to do?

can unused in and outs or anything else that is not absolutely required be disabled?

Yes, read Gammon Forum : Electronics : Microprocessors : Power saving techniques for microprocessors

how would you use the photo resistor?

With another resistor - the Arduino can't measure resistance directly as it only measures voltage. There must be a zillion online tutorials for this. The Arduino starter kit includes an LDR and projects 4 and 6 seem to make use of it.

Thank you for the info. my situation is this. I have an analog circuit I designed and built that performs these tasks. the problem is making this circuit is extremely labor intensive and any change requires a new drawing. I use toner transfer to copper clad, ferric chloride to etch, drill holes for 32 components, solder wire etc. those of you who design and build your own prototypes understand.

as far as experimenting, I WILL get to that. at this moment though I need to make a micro processor operate in the same manner as my analog circuit.btw I have read nick gammons page, VERY interesting and way over my head at the moment.

so, if the nano will accomplish these (3) tasks, I will use that. the uno is to big.

the RTC? remember beginner here! the RTC is a real time clock, it is also "another" component, which I would very much like to avoid if possible. based on sample experiments and tutorials I have seen already. users have turned an LED on and off for a specific amount of time using the on board clock, using code.

I think it is the same concept, but correct me if I am wrong. when the dark sensor turns on the nano from sleep. can the nano (all by itself) count 20 minutes and send a pin to high for 12 seconds with the proper code. then repeat until the dark sensor switch turns the nano off?

so in other words is the clock really really really necessary?

ANSWERS to 4:17
small is a necessity
pass on pro mini
controller should not sleep-objective SAVE POWER
disabled=excellent
projects4&6-will read

THANKS!

What is it you are trying to do? Are you turning a light on and off? Opening the door to the chicken coop?

You said battery. How much power is available to run the Arduino after the battery has powered the target device?

With some sensible design, an Arduino can be run from a CR2032 button-cell battery for a year or more doing tasks like this.

trying to do, single power source 6 v

  1. turn on arduino with LDR at dark, arduino turns on PIR

  2. wait 20 minutes, activate light 12 seconds, repeat till #4

  3. when PIR activated, turn on light for 12 seconds, wait 10 seconds before accepting another que from PIR. repeat. till #4.

  4. turn off arduino at light.

I read 4 & 6 however no hysteresis in model, or doesn't appear to be.

Show us your analog circuit with 32 components you talking about.

The UNO is only appropriate when you wish to use add-on "shields" which match it. Yes, it is appropriate for initial experimentation. So far I rarely use one and started out in fact, on the Pro Mini.

For actual "end" projects, and unless you do propose to use the "shields", the decision is whether it needs to have continuing USB access. If the answer is "yes", then you use a Nano, if "no", a Pro Mini (cheap ones cost something like $2 US). Either of these has two extra analog input port pins more than the UNO. Being small, you use them as modules mounted on stripboard (after initially on a "breadboard") or your own custom PCB. (You can even put other components under them. :grinning: )

MorganS:
These requirements are contradictory. Small is not simple.
...
A Pro Mini will have lower power consumption but it requires a separate programmer (complex.)

To program the Pro Mini, you need an adapter. They cost all of $2 US (or $1 if you can use a soldering iron). It is in no way complex, you just connect them together when you need to program, and separate them when that is done. Everything else functions the same as using the UNO. There are some special tricks you can do with a UNO as it has two processors, but you are 99% unlikely to want to do that.


Previous!

Paul__B:
To program the Pro Mini, you need an adapter. They cost all of $2 US (or $1 if you can use a soldering iron). It is in no way complex, you just connect them together when you need to program, and separate them when that is done. Everything else functions the same as using the UNO.

I'm in agreement with post #5; while for you and I using a Pro Mini with the adaptor isn't considered "complex", for someone new to the Arduino (and seemingly, microcontrollers in general) - dealing with a smaller module along with an additional plug-in "programming adaptor" may lead to more frustration and trouble.

It's entirely possible that someone new to the Arduino could purchase a slightly non-standard clone Pro Mini and/or a non-standard adapter (cable or otherwise) and not understand how to hook it up - perhaps even damaging one or both items in the process.

Furthermore, most tutorials and projects out there in the wild for the Arduino are geared toward the Uno - add on the different pin layout and such of the Pro Mini, and a beginner might get confused and not be able to get the examples or such to work - leading to further frustration.

These and other reasons are why - for a beginner to the Arduino - I and others recommend starting out with the Uno (ideally an official Uno at that - while they are more expensive than clone Arduino "Uno" boards, they are more likely to work "first shot" - and you don't have to worry or deal with alternative USB driver setups, etc; all of that can be taken on as experience is gained.

@Fredric58:

Look at it this way - the Uno is your learning platform. Yes, it is large (honestly the thing is tiny - you want large, you should have seen some of the 8-bit SBCs from back in the day) - but that makes it easier to learn with; you're not fiddling with a smaller component, you're not wondering whether the pins are contacting the points on the breadboard you are prototyping on - ultimately, you can concentrate (mainly) on the controlling code.

Once you have the code working with the Uno - then you can move the code over to the smaller Pro Mini; since you know the code works, if something isn't working right during or after the transfer - you can be fairly confident it isn't the code - and you can concentrate debugging from there. Plus, having multiple Arduinos can allow you to keep your prototype working - for reference, maybe, as you build the more compact system.

Regarding your project (and while I agree that you seem to be in the territory of an X/Y problem):

  1. You don't need an RTC for this - although you don't say if your situation is timing critical, you can use the Arduino's built-in timers and such and expect the system to be reliable within scant milliseconds (or smaller, most likely) of your goals. I doubt that your discrete solution would be any better, so it is feasible that a coded solution will be just as accurate.

  2. You will need a few - but very few - discrete components to build your system. Besides the Arduino, you'll need the LDR and an resistor (voltage divider), plus you may need a resistor for the PIR sensor (maybe, maybe not). You may need a few other components - but likely nothing on the order of your current discrete component design.

  3. Shields will not be needed - if you are already comfortable with PCB design and have built a discrete component solution on such a PCB - then you don't need a shield. Just a breadboard and some dupont jumper wires.

  4. Even with a standard Uno - it is possible to put it in a "deep sleep" mode where it uses very little power; you can code the system to "wake up" every now and then and have it test the LDR or whatnot for the changes you are looking for, and if it matches, wake up completely - perform whatever task - then go back into a "deep sleep". Note that maximum power savings occur if you use the internal 8 MHz clock and a 3.3 VDC power supply - but that setting up an Arduino to use these settings is not trivial for a beginner.

Again - I urge you to reconsider to use a regular Arduino for implementing your system, at least for this testing and learning phase of your design. Once you have the confidence, then move to the Pro Mini. Good luck with your project.

:slight_smile:

cr0sh:
(the UNO) Yes, it is large ... but that makes it easier to learn with; you're not fiddling with a smaller component, you're not wondering whether the pins are contacting the points on the breadboard you are prototyping on - ultimately, you can concentrate (mainly) on the controlling code.

You must be joking! :astonished:

The Nano has the same pin spacing as the UNO - 1/10". It just happens to be narrower - which means it will fit in a breadboard. It happens not to have the "barrel connector" which is useless half the time anyway.

The code is the same. The driver is different, but (on Windoze anyway; never a problem with Linux) the 16U2 driver is no more difficult to work with than a CH340, FTDI or the (preferred) CP2102.

The suggestion regarding poor pin contact with a breadboard is even sillier! Any problem with using male jumper pins will be no worse with a breadboard than with female sockets on the UNO. The most problematic thing about the Nano (or Pro Mini) pins is how you ever mange to get it out of the breadboard!

@Paul_B, I can't help feeling that all your comments represent a lot of knowledge that you have acquired and which you use subconsciously.

The things that you say are silly may be major obstacles to someone without your experience. Never understimate the ability of a newcomer to get confused. You have only to read a few Threads here to be convinced.

The very fact that you have to say things like "the code is the same" and "never a problem with Linux" means that you are aware of things that a newcomer will not be aware of.

I remain strongly of the view that newcomers should start with an Uno and subsequently make their own informed choice about which other Arduino to use.

...R

Robin2:
@Paul_B, I can't help feeling that all your comments represent a lot of knowledge that you have acquired and which you use subconsciously.

The things that you say are silly may be major obstacles to someone without your experience. Never understimate the ability of a newcomer to get confused. You have only to read a few Threads here to be convinced.

The very fact that you have to say things like "the code is the same" and "never a problem with Linux" means that you are aware of things that a newcomer will not be aware of.

I remain strongly of the view that newcomers should start with an Uno and subsequently make their own informed choice about which other Arduino to use.

...R

As a newcomer myself then I couldn't agree more. People should remember that at some point we were all newcomers (in any field).

I'm 'lucky' in that I have plenty of prior experience with electronics/uC's/ASM/C/C++ so there wasn't much of a culture shock for me. Just a lot of reading.

Not everyone will be in that position though.

Paul__B:
... The most problematic thing about the Nano (or Pro Mini) pins is how you ever mange to get it out of the breadboard!

I use a 'Popsicle' stick, and slowly pry it out from both ends.

because someone said. "ask the right question". I will try again, yes or no answers. I will be as specific as possible. let me preface this. IT IS NOT AN EXPERIMENT, it has been proven using analog. the purpose of this post is to determine whether or not the nano (because it is SMALL) can mimic my already designed old school board. here are 3 questions.

  1. can the nano be turned on with an LDR circuit and begin running it's program, UNASSISTED, meaning, no one around to push any buttons? on at night, turns off at day? Y or N

  2. once turned on by the LDR can a nano send a high signal (3-5v power) to another board every 20/30/40 minutes (which ever I choose, or write into a program) for 12 seconds? and repeat till the LDR says STOP, it is day? Y or NO

  3. once the nano powers UP (at NIGHT) can it power up (turn ON) a PIR which when triggered (for 1 second) will send power to the same (other board) activating that board for another 12 seconds with 3-5 volts. that means SEND POWER to it. the caveat is the nano will need to WAIT 10 seconds AFTER the initial 12 second power up to the "other board" BEFORE accepting another signal from the PIR. Y or NO.

I appreciate the opinions of which board I should "learn on" and all the technical stuff that has been presented. my objective as I understand this board to be, is 1st determining whether the NANO can accomplish these 3 simple tasks. I can already do it with analog.

I am looking for a reply that says

  1. yes
    2 .yes
  2. yes

for you who asked for a schematic, short version is the LDR is a comparator circuit based on a LM339 with (2) trims to set my day and night values. once the circuit opens it powers the PIR and starts a clock based on a CD4060 and a CD4073B AND gate. at dark every (x) amount of minutes it powers another board with a 12 second HIGH signal. the "other board" is also powered by the PIR, which is set to 12 seconds as well. problems arise with analog in that there is a LOT of drift, due to components, temperature etc.

BTW, IF, you are, understand EAGLE or an equivelent and can make a gerber file for my comparator boardr, by all means let me know.

  1. Wrong question.

Imagine that the processor is running all of the time, checking all of its inputs a thousand times per second. Then it has enough information to decide to turn on its outputs, according to the schedule that you programmed into it. If it was switched off, then it can't run your program and can't turn anything else on or off.

Don't think about it as switching the processor off or even 'sleep'. Unless you are using a button-cell battery you don't need to go to those extremes of power saving. The processor should be running your program all the time.

You need to write code that looks at the inputs and stores information, like the time (in milliseconds) that the LDR went dark. This code should always be running, even when the LDR says it's daytime.

  1. Yes.

  2. Almost the wrong question. Yes, you can turn on or off an external device like a PIR. But why? Just program your code to only look at the PIR result after the other conditions have been met.

Please provide a schematic. A description is not sufficient. A pencil sketch is often enough to convey the useful information.

Are we really going to these lengths just to turn on a night-light? Please tell us what you're really attempting to do.

Have you ordered your UNO yet? Once you get it in your hands and start experimenting, you will understand these answers and you might have some idea why your initial questions are irrelevant.