[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
>Making an ambient light/sound system that activates upon
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /diy/ - Do It yourself

Thread replies: 18
Thread images: 2
>Making an ambient light/sound system that activates upon entering my room
>Upon entry ambient lights turn on and a sound file plays
>Using an arduino uno to control lights
>Using RPi to handle wireless communication from motion sensor to arduino and to sound system to play file

I feel like there is a simpler way to do this. An RPi seems like complete overkill for simply sending a message to my light controller. (The lights will be located across the room, and I don't want to run wires that far)

Any suggestions? I'm still new at this kind of thing.
>>
>>955103
holy fucking meme batman.
yea, get rid of the pi and arduino.
>buy atmel chip
>put $2 pir sensor
>program atmel chip to activate lights via relay, music via IR

idfk how youre activating your shit, "Light controller", specify.
hows the sound system turning on?
my method is less than $10 + wire.
>>
i hope it plays the Seinfeld theme
>>
>>955127
>atmel chip
I could do this, (in fact I was probably going to ditch the duino anyway and just use a standalone chip) I'm just using some PWM to control light fades and color cycles.

>Sound system
I was still thinking of ways to get it done. Idealy, I would use a simple speaker that I could upload a simple sound file to (It's gonna say some cringe shit like "welcome home master" and that's all). I considered bluetooth, but again, I'm not sure yet.

I'm just trying to get this wireless and ready to go, I need one system to recognize motion and wirelessly send that information to the second system that will then control the lights and activate the sound system.

Like I said, I'm still new to this.
>>
>>955134
atmel is a manufacture of microcontrollers.
Arduino buys these microcontrollers for pennies, and puts them on a board they have made for pennies, and sells them for an assload of money.

You too can buy these chips, your price is just under $3. You can buy the chips blank or with the arduino bootloader already on it.

The pir sensor, passive infrared, as seen in your picture can be had for $2 on ebay.
it has three pins, power, ground, and signal.

Im sure you can figure out which goes where, run the signal to a gpio on the atmel(arduino), and have that particular pin set to input.
program in C,

setup(){
set pin pir sensor as input();
set pulldown resistor or pull up resistor(); // or do it with a real physical resistor, its not hard.
set pin lights output()
set pin ir() //whatever the tutorial for ir says.
}

loop(){
if(gpio pin is activated){
set pin for light relay high();
send stereo ir code power();
send stereo ir code select cd();
send stereo ir code play();
}
}

You will have to look up the ir stuff, my recommendation to you is just buy the chip with the arduino boot loader, and look into using your raspberry pi's gpio as a programmer for the atmel chip. Look into "avrdude" for the raspberry pi.

ps, do something respectable with this.. dont do some cringe bullshit like you are planning.

have it set the lights to a moderate level, put on some classical music, and make a robot arm to pour you a glass of scotch or whiskey.
>>
>>955103
OP, this sounds cheesy as hell and I'm curious about the specifics. I think you are missing a fog machine.
>>
What is the purpose of the rpi? Why can't you put the pir on the arduino/atmega? Can't they be wired together? If you absolutely can't get them to reach can't you use a esp8266 to save your pennies?
>>
>>955151
>Arduino buys these microcontrollers for pennies, and puts them on a board they have made for pennies, and sells them for an assload of money.
If the board is that cheap to manufacture, then how come none of the Arduino clones are priced at mere pennies as you suggest they could be?

I agree the board itself is probably overkill for that job but I think you're underestimating the total value of all the components that go into those boards. The individual components may be fairly cheap but it does add up.

>>955134
>It's gonna say some cringe shit like "welcome home master" and that's all
This is a sex thing, isn't it?
>>
>>955172
>the boards are not mere pennies
ok you caught me, with their fancy ass paint on the back, unique color scheme, and logos everywhere I'm sure its at least 1.50 per board for them.

>I'm underestimating
https://www.youtube.com/watch?v=sNIMCdVOHOM [Embed]

perf board can be had for a couple dollars, run the traces with solder.

digikey.com
amazon.com
ebay.com

go to these sites and check the prices for yourself. The most expensive thing is the programmer for avrs (atmel chips). A chinese knockoff can be had for 10-20, but as I stated the raspberry pi can compile a copy of avrdude to run off of its arm processor. the gpio will allow you to program this chip without having to buy a programmer.
>>
File: picduino.jpg (1 MB, 2592x1944) Image search: [Google]
picduino.jpg
1 MB, 2592x1944
>>955134
Keep the duino, you'll need a board for the atmega anyway.
>>
>>955172
>This is a sex thing, isn't it

Yeah mostly. I'm in college and wanted to do a little proof-of-concept work. It also helps that I can convince bitches I am Tony Stark with simple shit like this.

>>955151
Alright dude thanks for the program and the idea for IR. I'm going to have to do a little research (as you said) on the specifics and all that stuff, but at least now I know where to start.
BTW my materials right at this very moment consists of an RPi 2, a breadboard, wires, LEDs, a PIR sensor and an Atmega microcontroller. It would appear the IR modules are literally 90 cents a pop, so I think I'll be going with that method.

Once I get the prototype up and running, I'll post it here. Thanks a ton guys.
>>
>>955362
You're welcome.
also what are you referring to as ir modules?
if you are talking about sending and reviving the ir signal for the stereo, there are two components. The ir receiver is basically a transistor that activates wtih ir light, you will probably need that to pull the codes from your remote. If you can find the codes for your stereo online you wont need this.
The other thing is the ir leds, its the same thing as a normal led except it gives off ir light, which you cant and wont see unless you aim a camera at it.

btw that code I posted will not compile as is. I don't remember the exact functions so I just layed out a basic frame work. Youll have to replace everything there with the correct format, and of course provide variables if you want, for example "int light_pin = 13", if you want to be able to just say "light_pin" in ever function that requires it instead of having to remember 13.
>>
>>955372
Yeah the IR Receiver I'll use will be
>http://www.mouser.com/ProductDetail/Vishay/TSOP4838/?qs=yGXpg7PJZCiwO12kec0Sug%3D%3D&gclid=Cj0KEQiAu9q2BRDq3MDbvOL1yaYBEiQAD6qoBqXR5z0HqY0dmuXI9lqHFkQ4fi_OvHqIotV6sAnVZR8aAquo8P8HAQ

The emitter will be
>http://www.mouser.com/Search/ProductDetail.aspx?qs=%2fjqivxn91cf0ArhCI3s%2fUg%3d%3d

And yeah as far as programming, that won't be an issue, I know enough to get a simple project like this going
>>
>>955385
I just looked at the code I wrote yesterday,
That will only have the lights and stuff play while it is sensing motion, use some shit like

bool activate = 0;

if(motion){
activate = 1;
.....

if(reset){
activate = 0;
wait(20000)// give you enough time to get out of the door before the loop looks for motion again
}

and then just use the reset as the light off buttone when you leave the house for the day.
>>
>>955395
Thanks dude, I should have everything up and going as soon as I get my IR sensor in.

Would have an extremely inefficient project going if it weren't for you.
>>
>>955397
lol thanks, I'm just glad to see something actually get built.
I think of this kind of shit all the time, but I never want to order parts so nothing ever gets built.
>>
>>955401
I know anon I fucking hate it. I manned up the other night though and purchased a RPI, ir sensor and rpi camera and plan on making it take pictures whenever it detects motion and then email them to me. I was also thinking of doing the same thing with audio and/or video.
>>
>>956693
sounds like what I'm about to do actually..
I had an rpi because linux+gpio, and I just happened to pick up a hand full of sensors when radioshack went out of business.
I'm going to be setting it up to email me when motion is detected so I can show up and *protect my property*.
Ill be having two versions of this, one will be using a camera, but the other will not be able to use a camera.
Thread replies: 18
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.