Introduction: Bluetooth Voice Controlled Moving Lamp

Bluetooth and voice control, this two topics are close to each other when it comes to Arduino. A lot of people want to make something with bluetooth, and some of them want to use voice control. There are a lot of project of bluetooth controlled, robots, cars, boats, drones and so on. And they are cool, I like them, but I prefer to make more original things, that have never been made before or at least add something new to old, well known things. When I am making this kind of projects I feel like Neil Armstrong when he was the first man on the moon :D Just kidding, but I like creating new things that have never been made before, because I can :)


So what I wanted to make in this project? Basicly a lamp, everyone know what is a lamp but for last few hundreds of yeas when you wanted to move your lamp you have to make this by hand. And this is a simple task, but imagine this kind of situation, that I faced with very often, you are soldering something, in one hand you have soldering iron and tin in second hand. So if you want to move a lamp you have to stop soldering move the lamp and start again. That's annoying! And here my lamp comes, to overcome this problem I added a voice control over bluetooth. So if dream about controlling your lamp with your voice, you want to solder more efficient or you are such a lazy person :) this project is perfect for you! Without more talking let's see what we will need to make it.

LINK TO VIDEO IF YOU USE APP

Subscribe to my channel: https://goo.gl/x6Y32E

Like my Facebook fan page: https://www.facebook.com/Nikodem-Bartnik-18911577...

Follow me on Instagram: https://www.instagram.com/nikodembartnik/

Step 1: What We Will Need?

There are no all of the components on the photo above because I forgot about putting them on it :) Sorry, here is the list of all things that we will need with links to banggood and gearbest:

We will also need 4 3D printed parts, stl files with water mark (my name you can find below) If you want to get stl files without watermark you can buy them really cheap here: https://cults3d.com/en/tool/bluetooth-voice-controlled-moving-lamp

Step 2: Bottom Plate

Put servo cable in hole on the side of servo container and screw servo down with M2 screws.

Step 3: Rotary Disk

To servo that we mount previously we can screw down 3D printed disk that will hold rest of our lamp. Make sure that you use small screw, otherwise it will be impossible to mount servo. Simply put the servo in place and leave cable on the back of the servo. Screw it down with two M2 screws. Make sure that everything is ok and screws are tightened.

Step 4: First Arm

First arm is the one with my name and place for servo at the end. Firstly you should put cable inside special hole that hide the cable and make it look cleaner and better (later I also put right there servo cable, you also should, so do it now, because later you will have much more work to do so). Cable should be long enaugh to connect LED with relay so keep that in mind. When cable is in place you can mount the arm on the disk and servo as shown above, be careful because it is easy to broke this part. Screw arm to servo with M2 screw. On the top of the arm you have to put last servo (remember about servo cable) and screw it to arm with long M2 screw. Make sure that everything is solid :)

Step 5: Second Arm (top Arm)

Again we can start by putting cable in hole (the same cable that we put in first arm in previous step). And the same as before fix arm to the servo shaft with M2 screw.

Step 6: Diode Installation

It's time to install diode in arm but firstly we have to solder it to cables. So take of the insulation, twist the cables, put shrinkable sleeves on the cables, and solder them. Remember about polarity and colors. In my case grey is + and black is -. At the end just put led diode in hole at the end of arm. It should stay in place without any glue.

Step 7: Pull the Cable

You will propably have to much cable between the arms, just pull it on the down side.

Step 8: Top Servo Cable

To put servo cable in hole you have to cut out it's connector. To the end of the cable you can solder cable from different servo so it will be long enaugh to easily opconnect to Arduino. Don't forget to insulate everything to make it safe. Shrinkable sleeves are the best for that but black tape is also good.

Step 9: Frame Finished

Frame is finished all cables are in place connectors are soldered, now we can connect electronics.

Step 10: Electronics Connection

Here is the schematic of connection. The small led diode symbolize 12V LED diode that we put in the frame before, I just didn't find the exact part in fritzing. It is much easier to connect servo motors if you have arduino with connectors for servo and you don't have to use breadboard. I have 2 channel relay but you can use single channel relay, no problem. To make it cleaner I put all cables from lamp in cable sleeve (I am not sure if this is proper name). We don't have to connect RX of Bluetooth module to arduino because we will only transmit data from Bluetooth module to Arduino, not the other way.

Step 11: Arduino Code

Explanation of the code is in the comments. There is one thing that can be unclear. When lamp is moving forward not only middle servo is moving, also the top one, it is needed to make lamp point in the same direction, otherwise it would be hard to control the lamp. The rest of the code simply reads the data from Bluetooth and move the lamp to a proper position. There are also for loops to move lamp slowly just to protect servos and lamp from destruction.

#include
String command; String value;

//I don't know why I named them like that. Servo servo_rotation; Servo servo_tilt; Servo servo_height;

int step_delay = 50;

void setup() { Serial.begin(9600); servo_rotation.attach(3); servo_tilt.attach(5); servo_height.attach(6); servo_rotation.write(90); servo_tilt.write(90); servo_height.write(100); //that's for relay pinMode(7, OUTPUT); digitalWrite(7, HIGH); }

void loop() { while (Serial.available()){ delay(10); char command_char = Serial.read(); if (command_char == '#') {break;} command += command_char; } if (command.length() > 0) { Serial.println(command);

//sometimes when you say counter clockwise it sends it together or separately so we have to have right there two if if(command.indexOf("*counterclockwise") >= 0) { value = command.substring(17, command.length()); for(int a = 0; a < value.toInt(); a++){ if((servo_rotation.read()+1) >= 0 && (servo_rotation.read()+1) <= 180){ servo_rotation.write(servo_rotation.read()+1); delay(step_delay); } } }

if(command.indexOf("*counter clockwise") >= 0) { value = command.substring(18, command.length()); for(int a = 0; a < value.toInt(); a++){ if((servo_rotation.read()+1) >= 0 && (servo_rotation.read()+1) <= 180){ servo_rotation.write(servo_rotation.read()+1); delay(step_delay); } } }

if(command.indexOf("*clockwise") >= 0) { value = command.substring(10, command.length()); for(int a = 0; a < value.toInt(); a++){ if((servo_rotation.read()-1) >= 0 && (servo_rotation.read()-1) <= 180){ servo_rotation.write(servo_rotation.read()-1); delay(step_delay); } } }

if(command.indexOf("*front") >= 0) { value = command.substring(7, command.length()); for(int a = 0; a < value.toInt(); a++){ if((servo_tilt.read()+1) < 140 && (servo_tilt.read()+1) > 50){ servo_tilt.write(servo_tilt.read()+1); } if((servo_height.read()-1) < 150 && (servo_height.read()-1) >= 0){ servo_height.write(servo_height.read()-1); } delay(step_delay); } }

if(command.indexOf("*back") >= 0) { value = command.substring(5, command.length()); for(int a = 0; a < value.toInt(); a++){ if((servo_tilt.read()-1) < 140 && (servo_tilt.read()-1) > 50){ servo_tilt.write(servo_tilt.read()-1); } if((servo_height.read()+1) < 150 && (servo_height.read()+1) >= 0){ servo_height.write(servo_height.read()+1); } delay(step_delay); } }

if(command.indexOf("*up") >= 0) { value = command.substring(3, command.length()); for(int a = 0; a < value.toInt(); a++){ if((servo_height.read()-1) < 150 && (servo_height.read()-1) >= 0){ servo_height.write(servo_height.read()-1); delay(step_delay); } } }

if(command.indexOf("*down") >= 0) { value = command.substring(5, command.length()); for(int a = 0; a < value.toInt(); a++){ if((servo_height.read()+1) < 150 && (servo_height.read()+1) >= 0){ servo_height.write(servo_height.read()+1); delay(step_delay); } } }

if(command.equals("*on")) { digitalWrite(7, LOW); }

if(command.equals("*off")) { digitalWrite(7, HIGH); } }

command=""; }

Step 12: Android App

I am an Android programmer, but I decided to use an app from Google Play instead of making my own, because it is easier for you to download it directly from Google Play instead of installing an apk file (I am aslo a little bit lazy :).


Here is link to this app, it is very popular and a lot of people used it in Arduino projects, but nobody before have made a voice controlled lamp ( ͡° ͜ʖ ͡°)

https://play.google.com/store/apps/details?id=robo...

How to connect to your bletooth module?

Just click 3 dots in upper right corner and choose connect robot, then choose your bluetooth module.

How to send command to Arduino?

After connecting to your bluetooth module, just click the microphone icon and say what you want to send to Arduino

Step 13: Some Problems

While building this lamp I also faced some problems, that I want to let you know about.

My first problem was that top servo was broked. To replace it, I should take out the cable from this hole and put different one, but this is difficult so I decided to cut out cables from the old servo and solder them to the new one. And it is fine right now, you can see it on the first photo above.

Second problem was that first arm (the one with my name) wasn't tight enaugt with servo shaft so I used some glue to fix that, now it is ok. On the photo above you can see that there is glue around the shaft.

Step 14: Finnaly Working!

After solving those 2 small problems my lamp finnaly works. Here you can see how :) As you can see while soldering I put my phone under wrist so I can easily click on screen to control the lamp.

Step 15: List of Commands

  1. Clockwise [number] - it will rotate the lamp clockwise with the given degrees, numer means degrees

  2. Counterclockwise [number] - it will rotate the lamp counterclockwise with the given degrees, numer means degrees

  3. Front [number] - lamp will go forward with given degrees, number means degrees.

  4. Back [number] - lamp will go backward with given degrees, number means degrees

  5. Up [number] - lamp will go up with given degrees, number means degrees

  6. Down [number] - lamp will go down with given degrees, number means degrees.

  7. On - lamp will turn ON

  8. Off - lamp will turn OFF

Step 16: Conclusion

If your laziness is beyond scale, this project is definitely for you :) But to be serious it is very useful for soldering and any kind of job when you have both hands busy. It is also just fun to make, and basically everything voice controlled is awesome!
Feel free to ask questions in the comments, leave a <3 if you like my project and vote for it if you love it!
Subscribe to my channel: https://goo.gl/x6Y32E

Like my Facebook fan page: https://www.facebook.com/Nikodem-Bartnik-1891157704439330/

Follow me on Instagram: https://www.instagram.com/nikodembartnik/

Thanks for reading, have a great day!

Comments

author
RicardoA56 (author)2017-09-14

this is a good even scalable project

author
Nikus (author)RicardoA562017-09-14

Thanks! What do you mean by scalable?

author
RicardoA56 (author)Nikus2017-09-14

Hi thats means that your project could be the base to build another

author
Nikus (author)RicardoA562017-09-16

Ok :)

author
gravityisweak (author)2017-09-15

You did some great work here! It's amazing what is possible to build in our own homes these days. I do have a question for you, what is the purpose of the relay here if you are only using a 12v LED? Is it really necessary?

author
Nikus (author)gravityisweak2017-09-15

Thank you! Yes it is :D of course relay is overkill in this project but I wanted to keep things simple, to make it more begginer friendly, so I decided to use relay. You can use transistor for that I just don't wanted to put there breadboard and relay is simpler to connect. Thanks for comment!

author
gravityisweak (author)Nikus2017-09-15

Thanks, I only ask because I'm sure your electronics skills are much more advanced than mine and I'm still trying to learn and make sure I understand what is happening here.

author
Nikus (author)gravityisweak2017-09-16

Sure no problem, I am here to help :)

author
Anshu AR (author)2017-09-15

Awesome!

:)

author
Nikus (author)Anshu AR2017-09-15

Thanks!

author
IgorF2 (author)2017-09-14

Good job!

Now I'll have to add some servos a a bluetooth on my 3d printed lamp! :D

https://www.instructables.com/id/3D-Printed-Articu...

author
Nikus (author)IgorF22017-09-14

Thanks! Your project is awesome :)

author
RicardoA56 (author)2017-09-14

congratulations

author
WannaDuino (author)2017-09-12

1 the STL of the arm is MISSING, has a goggle arm???????????

2 did you fix the STL with your glu problem so that OTHER PEOPLE dont have the same PROBLEMS??

author
Nikus (author)WannaDuino2017-09-13

There are all of the stl files. And about this problem, model was ok, but this part was broken in one place and becuase of that I needed glue.

author
WannaDuino (author)Nikus2017-09-14

aah oke, thanx, i love it, i will make it in honor of you.

www.wannaduino.com

author
kksjunior (author)2017-09-12

Amazing! Nice Photographs, and the video too is neatly presented. You've my votes! Why don't you add this to the "Lazy Life Challenge"?

author
Nikus (author)kksjunior2017-09-12

Thanks! I was thinking about adding it to lazy life, it suits it perfectly :) But you can enter max 3 contests and I decided it will be better to choose those.

author
LukeK1990 (author)2017-09-11

Nice project, congrats :)

author
Nikus (author)LukeK19902017-09-12

Thanks!

author
chrisjlionel (author)2017-09-11

Excellent work. Voted for all 3 contest.

author
Nikus (author)chrisjlionel2017-09-12

Thank you so much! That means a lot!

author
aCuriousCreator (author)2017-09-12

This is crazy cool :D Amazing idea and well built!

author
Nikus (author)aCuriousCreator2017-09-12

Thanks! :)

About This Instructable

7,133views

132favorites

License:

Bio: Hi, my name is Nikodem Bartnik. I live in Poland, I'm 18 years old. I like to program and create robots, devices and things ... More »
More by Nikus:Bluetooth Voice Controlled Moving LampIce Fidget Spinner MoldDIY LED Panel
Add instructable to: