peter_m Posted May 28, 2013 Posted May 28, 2013 Hello! My Rescue Helicopter (9396) is about to be delivered ( ) and I have this idea to put enormous amount of LEDs in it. I have a plan to use Arduino to program proper blinking sequence. I was thinking about mounting also 2 M-motors to motorize rotor and functions. I would love to control them via Arduino but I do not have an idea how to connect motors in a proper way. Has anyone ever done it? Thanks in advance for any tips! Quote
Someonenamedjon Posted May 29, 2013 Posted May 29, 2013 (edited) You need to modify your wires then. Edited May 29, 2013 by Someonenamedjon Quote
peter_m Posted May 29, 2013 Author Posted May 29, 2013 I have cut PF extension cable . Hmmm http://www.eurobricks.com/forum/index.php?showtopic=44711 <- here I found a solution how to add custom battery to cable cut in such way. But still I do not know how to connect C1 and C2 to Arduino and how will I be able to drive the motor from Arduino while it outputs only 3.3V and 5V? Shame I have never been into electronics before... Still - any help / tips will be much appreciated! Quote
DLuders Posted May 29, 2013 Posted May 29, 2013 @ peter_m: Scroll two-thirds of the way down this webpage on Philo's website to see the "Power Functions Working" wiring diagrams, like this one: Quote
reibuehl Posted May 29, 2013 Posted May 29, 2013 (edited) The C1 and C2 lines use 9V PWM. To control them with an Arduino, you will need to use two PWM output pins to drive a transistor that will switch the 9V from the LEGO connector. Have a look at this http://www.w9xt.com/..._switching.html article which explains the principle. Edited May 29, 2013 by reibuehl Quote
Burf2000 Posted May 29, 2013 Posted May 29, 2013 You could buy a bricktronic shield to run them off the Ardunino Quote
Someonenamedjon Posted May 29, 2013 Posted May 29, 2013 Or you can get brick pi and control nxt motors. Quote
sten Posted May 30, 2013 Posted May 30, 2013 As reibuehl already said you need to use a transistor. However, if you want bi directional motor control, the simplest and cheapest way (though bulky) is to use a DPDT relay and 2 transistors. This is a good schematic and some explanation http://www.me.umn.edu/courses/me2011/arduino/technotes/dcmotors/bidirectional/bidirMotor.html. To control the speed of the motor you need to use PWM (pulse width modulation) which essentially pulses the voltage which results in a lower average voltage and thus a lower speed. The pins that can be used for this depend on the model of Arduino. The code to do this looks something like this: analogWrite(motorpin,88); // the number can be anything from 0 to 255 with 255 being continuously on and 0 being off. This describes it in more detail http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM. I hope this helps some. Also, keep in mind that Arduinos can only provide a limited amount of current (an Uno can give 40 mA per pin and not much more than that total) and many LEDs going will max this out. Which would require you to use more transistors. Here is a good all around Arduino resource with everything from programming to wiring https://docs.google.com/viewer?a=v&pid=sites&srcid=dW1uLmVkdXxtZTIwMTF8Z3g6NWMwYTgxZTVjYjIxZThjNg Quote
peter_m Posted May 31, 2013 Author Posted May 31, 2013 Thank you everyone for great tips and resources! If I manage to accomplish what I have planned for my 9396 I will prepare a separate thread with pictures and description :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.