Circuit

I currently have a curcuit with the following setup.
A motion sensor triggers a row of 5 leds to light up. The light only comes on if it is dark enough thanks to a photo cell. All of this is handled through software and the Arduino.

Not knowing enough electronics juju to design my own circuit, is it possible to do soemthing similar without an Arduino?

Basically I want a small circuit that triggers a light to come on at night based on detecting motion.

Thanks.

You could certainly do it without a full Arduino board, but you'll probably need a microcontroller of some sort to drive the logic.

Check out http://www.arduino.cc/en/Main/Standalone

and just google: standalone arduino - Google Search

I'm sure with enough EE knowledge, you could make it work without a microcontroller at all, but that's way beyond my level. :slight_smile:

Google somthing like "motion detector light schematic" for the electronics, there are lots of hits.

IMHO, if you are not an EE, then I think it will be harder without a small microcontroller than with.

Would you be okay using something like an ATtiny?
e.g. http://www.newark.com/jsp/search/browse.jsp?N=500003+1001919&Ns=PRICE_PLS_001_PRICE1|0&Ntk=gensearch_001&Ntt=ATtiny&Ntx=mode+matchallpartial&locale=en_US&appliedparametrics=true&getResults=true&originalQueryURL=/jsp/search/browse.jsp%3FN%3D500003%2B1001919%26Ntk%3Dgensearch_001%26Ntt%3DATtiny%26Ntx%3Dmode%2Bmatchallpartial%26No%3D0%26getResults%3Dtrue%26appliedparametrics%3Dtrue%26locale%3Den_US%26catalogId%3D%26prevNValues%3D500003%2B1001919

You could use the Arduino IDE to develop the code.

The ATiny might work. Never tried one before. I might try that - Thanks.

There are several examples on the playground and the web of building an "Arduino on a breadboard".

It feasible to make something like an Arduino with only three parts. Normally a few more for a nice voltage source. An Arduino can be used to program a raw chip, so no need for a programmer.

The ATtiny chips are the same, again as little as three parts. The difference between an ATmega and ATtiny is ATtiny have fewer peripherals and pins.

IMHO, if you are not an EE, then I think it will be harder without a small microcontroller than with.

Or you could go here:

And use that information to do some lookup on his "Engineer's Mini-Notebooks", buy copies of all of them (they should be required reading for Arduino newbies), and find the circuit in there to do what you want with a minimum of headache.

:slight_smile:

IMHO, if you are not an EE, then I think it will be harder without a small microcontroller than with.

Or you could go here:

Forrest M. Mims III

And use that information to do some lookup on his "Engineer's Mini-Notebooks", buy copies of all of them (they should be required reading for Arduino newbies), and find the circuit in there to do what you want with a minimum of headache.

Here's my $0.02 worth.

If your near term goal is to learn about electronics, you could give Forrest M. Mims III and publisher $19.95+10*$12.95 average (10 Engineer's Mini Notebooks that I saw at Amazon, but maybe more).

If you are quite 'academic', and like traditional text books, you might also consider The Art of Electronics. It is $89 at Amazon, and superb, but it not for everyone.

You do have a concrete project that you want to do, so it would be very a good focus for learning. You have understood the problem, and have a working solution.

If your near term goal is not to learn lots about electronics, but just enough to make your project, then you could go along other paths.

For example, you could exploit the fact that an ATtiny is significantly more controllable than most analogue electronics that you can build and debug unless you have test equipment, and ATtiny is probably lower cost. Also, you have many of the skills and much of the knowledge already. In fact you have a working project, which you might transfer to a lower cost device.

So you could spend a few $ on experiments with an ATtiny, use your Arduino to program it, and also develop useful skills. Then choose.

The nice thing about an ATtiny-based approach is you could change some of its behaviour after the electronics is built, by changing firmware. So, for example, you might want the light to come on for only an hour after dark. That would be quite a lot to add using non-programmable electronics.

Up to you.

Thanks for the comments everyone. I think I'll try ATiny and will definitely check out those Forest Mims books.
Any advice on how to program an ATiny?
Can I just stick it on a breadboard?
Do I need a special cable to program it?

Cheers.

Not knowing enough electronics juju to design my own circuit, is it possible to do soemthing similar without an Arduino?

I think I've seen small lights that can be put in closets and such that turn on when a person enters. There also is a room deodorant spray gizmo that is motion activated. Swap the spray action for LEDs. I need to find them at the store to get one just for tinkering.

Any advice on how to program an ATiny?

To put a program into it, use your Arduino. Look at: Arduino Playground - MegaISP
To write the program, develop it in the Arduino, choose an ATtiny with the subset of the Arduino's peripherals you need, and use the Arduino IDE to generate the program.

Can I just stick it on a breadboard?

Yes, there are some examples found by google. The :Arduino on a breadboard" examples show you the applicable options too.
An ATtiny is very similar to an Arduino's ATmega.

Do I need a special cable to program it?

Follow the MegaISP, and you'll see they use the Arduino as the programmer, with some bits of ordinary wire.

HTH

There also is a room deodorant spray gizmo that is motion activated. Swap the spray action for LEDs.

The spray action is a little solenoid, so very straightforward to do.
The one I bought had a big lump of black gunk (epoxy?) over what looks like an 8-pin micro (tracing the circuit as best I could).

Is this a good ATiny to use for this project?
http://www.newark.com/atmel/attiny48-pu/8-bit-mcu-4k-fla-1-8-5-5v-pdip28/dp/03P2039

So, for example, you might want the light to come on for only an hour after dark. That would be quite a lot to add using non-programmable electronics.

Because using a 555 timer is hard...?

I understand what you are saying, gbulmer, and I also realize that in many cases using a microcontroller over discreet components can have certain advantages. But there are possible disadvantages as well, and all of this should be weighed by the designer.

I have a feeling we are "raising the next generation" of electronics engineers to do everything using a microcontroller, with all the benefits and pitfalls that entails. The greatest benefits are the reprogramability and lower parts count for certain designs (not all designs). The downsides are putting trust into the designer of the CPU (and code) to not have made any mistakes that could cause a dangerous situation to occur (hmm - wide open throttles, for instance?).

Its understanding and knowing when to use what that is important (indeed, also understanding when to use electronics at all could be a component of this); without having a base of understanding of discreet electronics, you don't have the capability to make these decisions as well as you might.

Most of this certainly doesn't apply to this project, but what about the next?

Will we see more instances in the future of devices failing (possibly in catastrophic fashion) because of greater usage of embedded processors and code in situations where discreet electronics would have been a better or more reliable solution...? I realize that embedded systems have been around for a long while, and I certainly don't want them to go away - but one shouldn't have to use an entire CPU to blink an LED, outside of learning digital I/O and control (even a 555 timer is overkill for that application!).

:slight_smile:

Pauly, yes that looks fine.
It has an internal 8MHz oscillator, so need for crystals and capacitors there
It has analogue input
It has plenty of I/O
It has timers

I should admit, I was thinking of an 8-pin thing like an ATtiny45
http://www.rapidonline.com/Electronic-Components/Integrated-Circuits/Atmel-Microcontrollers/ATtiny-8-bit-AVR-Microcontrollers/77049
That gives 6 I/O's. Along with a FET to switch the LEDs, an analogue input for the light sensor, still I/O's for buttons and stuff.

So the ATtiny48 should be more than enough, it's almost a whole ATmega!
I did look at Newark, and it is one of the lowest cost parts, which is good.