This is for a fourth grade science project. The only part I need help with is as follows. There is a revolving disk. When the disk is in motion we want power from the battery to light the LED. When the disk stops, the light should go off. Using an Arduino system can we achieve this? I hope it is simple enough for 9 year old to do (of course I will watch any soldering) and I know I can get parts from my local radio shack, but don't know what package or parts to buy. Can anyone help me?
-
3\$\begingroup\$ Can you give us details of the disk, do you have access to the control systems with that (the switch turning it on, the control system for it, such) or do you have to completely gather information external to the system only being able to see the disk? Are we talking a disc similar to a record spinning or something different? \$\endgroup\$– KortukFeb 13, 2013 at 21:30
-
\$\begingroup\$ Can the disk simply be attached to a generator of sorts? If the wheel is turning, the light is on. \$\endgroup\$– dext0rbFeb 13, 2013 at 23:54
-
1\$\begingroup\$ Not every problem requires an arduino. In fact, no problem requires an arduino. This is doable many ways using very few basic components, without any sort of microprocessor. \$\endgroup\$– John UFeb 14, 2013 at 10:02
-
3\$\begingroup\$ A centrifugal switch would do it. You could use the Arduino as the flyweight. \$\endgroup\$– gbarryFeb 14, 2013 at 22:50
1 Answer
Various ways you could do this, here's a few:
If you have access to the power lines of the disk, then (assuming it's not high voltage) tap a line from those to the Arduino input. If the supply is higher than 5V, use a voltage divider to lower the signal as necessary. Arduino would need to share ground with the disk supply.
If it's high power, a hall current sensor or current transformer could be used to isolate the Arduino. You could also put a small magnet on the disk to use with a hall sensor.
If you don't have access to the disk power source, then you could use a black/white pattern and reflection sensor (example) or if the disc has holes an IR LED on one side and photodiode/phototransistor on the other (you would need an opamp for the photodiode option). Apply output signal of phototransistor/diode /reflection sensor to an Arduino input and look for changes on it.
Note that you don't actually need an Arduino (or any microcontroller) to do this, you could just use the sensors output with a simple transistor + LED circuit (if the sensor is one with a pulse output such as the optical detection would be, then as long as the disk is spinning fast enough, the LED will appear to be continuously on due to POV. If it's slow the LED will flash - if you want it to be continuous then you would need to low pass filter the signal)
Example Circuits
Okay, no information has arrived about the setup, so here are a couple of the most basic ways of doing this based on the disk supply option. I have assumed a +12V supply for the disk, and the Arduino is running from +5V:
Arduino Signal Option:
The above circuit could probably be used for between a +5V and +40V disk supply with any general purpose NPN. The signal is inverted, so the Arduino needs to adjust for this in software.
We could have used the most basic option of just a voltage divider, but the transistor offers some protection to the Arduino input from transients or surges on the disk supply. A 5V zener could be added to the input side also (for either option)
Simulation:
However, why do we need the Arduino when we can just do something like this:
If we just reduce the base resistor to allow for the LED current requirements, then we can light an LED directly. The above circuit uses around 15mA for the LED (most typical 5mm LEDs have a max of 20mA) which is fine for an indicator - anywhere between 5mA and 20mA should be adequate indoors.
Assuming a conservative gain of 50, the base resistors current is calculated using:
(12V - 0.7) / (15mA / 50) = 37.6kΩ
47k is a typical value in the ballpark, which adds a little less base current, but unless you are using a power transistor with a terrible current gain this is not an issue (even though gain drops at saturation, the Vce will be very small)
Simulation:
-
\$\begingroup\$ For this question a schematic of how to hook things up might be useful to the OP as they have said they dont really know how to do it. \$\endgroup\$– KortukFeb 14, 2013 at 0:55
-
\$\begingroup\$ @Kortuk: yes I agree - I could ideally do with the answers to your comment first though, since we don't know which of the above options are possible or the OP wants to try. I'll wait a few hours and if no answer is given I'll add one (or a few depending on time available here) \$\endgroup\$ Feb 14, 2013 at 1:14
-