Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
JawnV6
Jul 4, 2004

So hot ...

Bad Munki posted:

As an example, say you have your one accelerometer aligned with the direction your car travels, front to back. Then you park on a hill. Your accelerometer reads some portion of the gravity vector and shows your car accelerating (albeit slowly) forever. By the time you get up in the morning, your car has slowly crept up to a thousand miles an hour, without going anywhere a tall! That's why you need a gyro, to be able to measure the direction your car is facing and nullify that portion of the gravity vector. Same thing happens when you go around a corner.

This is going to be a one-off prototype to prove out the concept. I'm going to be hand-massaging the data anyway. Probably triggering a capture at the start of a straight shot of 1-2 blocks, ignoring all turns, just correlating two sensors over very short, very measured distances. I might even be taking video depending on how much assistance I get.

Adbot
ADBOT LOVES YOU

Bad Munki
Nov 4, 2008

We're all mad here.


Like I said, a basic arduino can be built for practically nothing, and I doubt the arduino itself will be the limiting factor here, so the answer to the original question is probably yes, the arduino can do it* and you should go for it.






*With caveats on what "it" is. :haw:

Delta-Wye
Sep 29, 2005
Are you married to the accelerator concept? Honestly, integrating the acceleration from one axis is going to be largely useless for anything but drag-racing style movements (straight for a relatively small window of time with known beginning and end points).

I would be tempted to tap into the wiring harness and read the PWM output from the wheels.

JawnV6
Jul 4, 2004

So hot ...

Delta-Wye posted:

useless for anything but drag-racing style movements (straight for a relatively small window of time with known beginning and end points).

That's exactly what I'm doing :) It's a bit of fitting the problem to the available sensing, but this should be enough to prove the concept that I'm going for. This is one of ~4 prototypes I want to have ready by early next week, so this kind of cheat is acceptable.

Bad Munki
Nov 4, 2008

We're all mad here.


I like the tapping into the PWM from the wheels (basically what I said: a rotary encoder on the wheels, just through an already-present mechanism.) But if the goal is to have a black box you can just set somewhere in any car, that won't really work because it requires poking around in the car.

If the goal is a completely atomic black box and it's really just drag activity, it might work well enough. No wheelies, though, that'll dick things over again. But if that is the goal, you know you could just grab the accelerometer data from practically any smartphone and spend five minutes hacking out a little app for it to log runs. There's probably already a million apps out there for free that would do just that and could spit out the data to a csv or something that you could later process. As a proof of concept for "will accelerometers alone work," that might be your actual best bet, assuming you have a smartphone and aren't some sort of luddite. :v:

Bad Munki fucked around with this message at 23:01 on Aug 1, 2013

JawnV6
Jul 4, 2004

So hot ...
The unique aspect is what the other sensor's grabbing, it's just that with those data points alone I can't infer anything. I need to know how far down the road I've traveled for it to be of any use. I don't want to go rooting around in the car if I can just carefully control my initial trials to get that aspect.

Turns out a couple coworkers had accelorometers handy, so I'll probably be field testing it by tomorrow. I'll just spit it to a csv, do a few runs, and postprocess them back at my desk.

Delta-Wye
Sep 29, 2005

JawnV6 posted:

That's exactly what I'm doing :) It's a bit of fitting the problem to the available sensing, but this should be enough to prove the concept that I'm going for. This is one of ~4 prototypes I want to have ready by early next week, so this kind of cheat is acceptable.

This video has a pretty good explanation of the problem you're facing. The presenter is a dude from invensense; I presume he is knowledgeable on the subject of IMU sensors :v:

Sensor Fusion (Watch the next couple minutes as he goes through the double integral stuff)

Bad Munki
Nov 4, 2008

We're all mad here.


Thanks, that's what I was trying to get at but your link was way more thought out and explicit. :):hf::)

Mantle
May 15, 2004

What if you bought one of those $10 ODB2 Bluetooth sensors from deal extreme and read the data from that?

Delta-Wye
Sep 29, 2005

Mantle posted:

What if you bought one of those $10 ODB2 Bluetooth sensors from deal extreme and read the data from that?

gently caress bluetooth. If you wanted to go that route, get a SPI/UART/I2C->ODB converter and just talk to it directly with the arduino.

wolrah
May 8, 2006
what?

Mantle posted:

What if you bought one of those $10 ODB2 Bluetooth sensors from deal extreme and read the data from that?

OBD data, even at the rarely supported high rates, is probably less useful for any sort of position estimation than an accelerometer would be. Bluetooth shouldn't make it any worse, but it still won't be great no matter the interface.

Sagebrush
Feb 26, 2012

wolrah posted:

OBD data, even at the rarely supported high rates, is probably less useful for any sort of position estimation than an accelerometer would be. Bluetooth shouldn't make it any worse, but it still won't be great no matter the interface.

OBD will at least give you a highly reliable speed value. You won't be able to measure geometric displacement (though you'll only barely be able to do that with an accelerometer anyway) but you can get the distance traveled pretty easily.

Mantle
May 15, 2004

Delta-Wye posted:

gently caress bluetooth. If you wanted to go that route, get a SPI/UART/I2C->ODB converter and just talk to it directly with the arduino.

Why shouldn't he just do this? I don't think it's necessarily clear that using an accelerometer is part of the goal of this exercise or if it's simply a means of "tracking a car's location."

JawnV6
Jul 4, 2004

So hot ...
So yeah, got some decent data.

Accelorometers are garbage poo poo for idiots. I was driving the car myself, I have a video out the window, and I still can't figure out what the accel data is saying. Is there a cheap Arduino GPS module? Do I have to worry about words like 'constellation' or do they just spit (location, confidence) intervals?

Delta-Wye
Sep 29, 2005

JawnV6 posted:

So yeah, got some decent data.

Accelorometers are garbage poo poo for idiots. I was driving the car myself, I have a video out the window, and I still can't figure out what the accel data is saying. Is there a cheap Arduino GPS module? Do I have to worry about words like 'constellation' or do they just spit (location, confidence) intervals?

Almost all (actually all?) consumer gps units spit out NEMA strings. They're easy to parse RS-232 serial data.

http://en.wikipedia.org/wiki/NMEA_0183

It's been a while since I've played with a GPS module, but I think the one I had had a few settings so you could change modes and get different data (raw data, lat/long, etc). I'm not really familiar with arduino-specific options, but GPS usually isn't terribly expensive although it sure looked that way when I was a poor-rear end student and playing with it.

Powdered Toast Man
Jan 25, 2005

TOAST-A-RIFIC!!!
I just picked up a Digispark starter kit. IT'S SO DARN CUTE!!! :neckbeard:

I think the first thing I'll do is make a temperature-driven RGB LED with it.

saint gerald
Apr 17, 2003

Bad Munki posted:

Be sure to post a trip report just for informational purposes. :)

OK, so we're a few days in and have completed about half the projects. I'm really thrilled with our progress so far -- this kit is the PERFECT progression from Snap Circuits. While making the first one or two projects he picked up basic circuit theory (current, voltage, resistance), Kirchoff's Second Law, and even touched on Ohm's Law, qualitatively. We grabbed the Snap Circuits components and a multimeter a few times for some practical experiments and demonstrations.

The projects (there are 15 or so) are progressive, well structured, and really well written up -- they're just right for teaching tools. When we got to including LEDs in the circuits, it explained current-limiting resistors in some detail, for example, and does the same for decoupling caps when it introduces servos later on. It's really easy to teach this stuff just following the book (and pulling out the meter to test things as we go).

He's a bit slower/less keen to grasp the programming concepts, but I think that'll come with time.

In absolute value terms, it's not a good deal. You get an Arduino Uno, an assortment of LEDs, resistors, diodes, capacitors, and sensors including photoresistors, pots...various switches, lots of jumpers and connectors, a servo motor and a regular motor, a nice big chunk of breadboard, an LCD display, a piezo speaker, and a couple of as-yet unidentified ICs. I know I could probably cobble together all that for about half the price of the kit. But you wouldn't get the book, which is absolutely excellent, and lots of little bits and pieces (like gels to go over the photoresistors, cardboard press-out pieces to make a really cool zoetrope, etc.). With that in mind, and the convenience of having the whole thing Primed to my door in two days, I'm happy enough.

Long story short, it's perfect for a teaching tool and this sort of father-son experimentation. It's poor value if you're just looking to fool about with an Arduino and don't need the extensive handholding.

SO...now I want a project of my own. I want to build an RFID immobilizer for my project car, which will hopefully double as a G-meter. For this I'm going to need a couple of relays -- one to go on the car's ignition circuit, and one to go on the fuel pump line just in case. I think I want latching relays so they'll stay on (or off) regardless of whether the Arduino is powered. I know how to drive a regular relay: a transistor, and a diode to prevent a nasty spike as the magnetic field collapses. But how do you do it with a latching relay?

MiNDRiVE
Nov 8, 2012

Powdered Toast Man posted:

I just picked up a Digispark starter kit. IT'S SO DARN CUTE!!! :neckbeard:

I think the first thing I'll do is make a temperature-driven RGB LED with it.

How is the quality of the board? Jacked up solder joints or does it actually look good?

extravadanza
Oct 19, 2007
I wake up early to get to work (up at 5:15am, work starts at 6:30) and the sun doesn't peek above the horizon until I'm at work. I was looking at investing in one of those Phillips wakeup lights that slowly get brighter over 20 minutes or something and birds slowly start chirping louder and louder until it's your set alarm time, in which an alarm would go off to wake you up. Those things cost like $60-70! I have a perfectly good arduino uno sitting around unused which could *hopefully* do this cheaper.

I was looking at making the arduino control my bedside lamp, but it looks like buying or making dimming modules for wall outlet power is really expensive!
http://www.inmojo.com/store/inmojo-market/item/digital-ac-dimmer-module/

So, my next thought is to power some kind of low voltage LED array (I think the arduino supports 5v and 12v, maybe?). I'm not looking to light up the room, just enough to try to trick my Circadian Cycle into thinking it's morning at 5:15am so I'm not a drowsy mess in the shower and getting dressed. I'm looking to not spend more than $15-$20 bucks on this. Does it sound possible? Can an arduino uno accurately keep time on it's own through programming? I see there are clock modules available. I'm pretty much totally new to this.

Supplies I have available are Arduino, project wires, breadboard, assortment of resistors/caps etc.

Delta-Wye
Sep 29, 2005

extravadanza posted:

I wake up early to get to work (up at 5:15am, work starts at 6:30) and the sun doesn't peek above the horizon until I'm at work. I was looking at investing in one of those Phillips wakeup lights that slowly get brighter over 20 minutes or something and birds slowly start chirping louder and louder until it's your set alarm time, in which an alarm would go off to wake you up. Those things cost like $60-70! I have a perfectly good arduino uno sitting around unused which could *hopefully* do this cheaper.

I was looking at making the arduino control my bedside lamp, but it looks like buying or making dimming modules for wall outlet power is really expensive!
http://www.inmojo.com/store/inmojo-market/item/digital-ac-dimmer-module/

So, my next thought is to power some kind of low voltage LED array (I think the arduino supports 5v and 12v, maybe?). I'm not looking to light up the room, just enough to try to trick my Circadian Cycle into thinking it's morning at 5:15am so I'm not a drowsy mess in the shower and getting dressed. I'm looking to not spend more than $15-$20 bucks on this. Does it sound possible? Can an arduino uno accurately keep time on it's own through programming? I see there are clock modules available. I'm pretty much totally new to this.

Supplies I have available are Arduino, project wires, breadboard, assortment of resistors/caps etc.

The arduino will not be able to keep accurate enough time for what you're trying to do. The best solution is to get a real-time clock module (an 'rtc') and these are usually pretty easy to interface with. Something like this: https://www.sparkfun.com/products/99

To do the lights, an LED strip is pretty much the way to go.
Nonaddressable strips: https://www.sparkfun.com/products/10261
Cheap, but need 12V and three mosfets to control the brightness. Very easy to control.

Addressable strips:https://www.sparkfun.com/products/11272
Usually run off of 5V which is nice, but you won't need to address individual LEDs for what you're doing. Also, more expensive :)

Mini-LEDs: https://www.sparkfun.com/products/680
Something like this?

You can get tons of these sorts of things on eBay for cheap (straight from china baby!), I would check there if you're on a budget. But in a nutshell, that's what you need. If everything can be powered off of 5V, it would be easy to use a AC->USB adapter rated for enough current (I see 2.~A ones for sale for pretty cheap all the time) to power the whole thing.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

You can go even cheaper if you don't need color by buying LED light strips of one color from amazon.

Control them from the arduino by wiring in a 12 volt power supply and a mosfet.

You can get a really bright spot by mounting the cut strips on a square surface and soldering the strips together.

To make timing really simple, figure out a good wakeup duration for fading in the lights with PWM, and plug in the power supply and arduino to an outlet timer from a hardware store set for when you want the lights to begin, and have it run the routine on powering up. It'd be trivial to add on a piezo speaker to add a buzz after the routine is over if you still aren't up. The arduino clock should be okay for waking you up over 20 minutes - 2 hours. It just wouldn't keep good time over days.

EDIT: Considering you'll need the LED, mosfet and power supply at least, you're probably out about $30. The timer outlets are a really common gadget, so I'm not factoring that in, but I guess you can add $5 if you don't have it.

TVarmy fucked around with this message at 21:05 on Aug 8, 2013

echinopsis
Apr 13, 2004

by Fluffdaddy

Hey thanks for this link! it's nice to find an electronics retailer that ships overseas for less than $50 and isn't dealextreme!!!

blaise rascal
May 16, 2012

"Duke, Duke, Duke, Duke of Pearl...."
This post was about a good deal on microcontrollers, but that deal is over now.

blaise rascal fucked around with this message at 23:59 on Aug 10, 2013

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer

extravadanza posted:

I wake up early to get to work (up at 5:15am, work starts at 6:30) and the sun doesn't peek above the horizon until I'm at work. I was looking at investing in one of those Phillips wakeup lights that slowly get brighter over 20 minutes or something and birds slowly start chirping louder and louder until it's your set alarm time, in which an alarm would go off to wake you up. Those things cost like $60-70! I have a perfectly good arduino uno sitting around unused which could *hopefully* do this cheaper.

I was looking at making the arduino control my bedside lamp, but it looks like buying or making dimming modules for wall outlet power is really expensive!
http://www.inmojo.com/store/inmojo-market/item/digital-ac-dimmer-module/

So, my next thought is to power some kind of low voltage LED array (I think the arduino supports 5v and 12v, maybe?). I'm not looking to light up the room, just enough to try to trick my Circadian Cycle into thinking it's morning at 5:15am so I'm not a drowsy mess in the shower and getting dressed. I'm looking to not spend more than $15-$20 bucks on this. Does it sound possible? Can an arduino uno accurately keep time on it's own through programming? I see there are clock modules available. I'm pretty much totally new to this.

Supplies I have available are Arduino, project wires, breadboard, assortment of resistors/caps etc.

I ended up building this kit last winter after spending lots of time pondering how to do thus last year. Combined with a cheap outlet timer, it works great. http://www.amazon.com/gp/aw/d/B001IRQDRS

Sagebrush
Feb 26, 2012

saint gerald posted:

SO...now I want a project of my own. I want to build an RFID immobilizer for my project car, which will hopefully double as a G-meter. For this I'm going to need a couple of relays -- one to go on the car's ignition circuit, and one to go on the fuel pump line just in case. I think I want latching relays so they'll stay on (or off) regardless of whether the Arduino is powered. I know how to drive a regular relay: a transistor, and a diode to prevent a nasty spike as the magnetic field collapses. But how do you do it with a latching relay?

Same way, I think? Except that you send a single brief pulse (test, but probably 200ms is plenty) to toggle between the states instead of staying constantly on or off. The latching system is mechanical, just like those power buttons on stereos or whatever that push down and lock to turn on power.

Do consider though that this is really just security through obscurity...anyone can easily defeat something like this by finding the relay and shorting it with +12v. A well-hidden killswitch would be pretty much just as effective. If you're okay with that, though, go for it!

extravadanza
Oct 19, 2007

n0tqu1tesane posted:

I ended up building this kit last winter after spending lots of time pondering how to do thus last year. Combined with a cheap outlet timer, it works great. http://www.amazon.com/gp/aw/d/B001IRQDRS

Did you think about using LEDs instead of a traditional light bulb? I figure I don't need it to be like a sun-in-my-room bright... but LEDs aren't the best at filling a room with light. I worry LEDs won't be bright enough. It looks like those controllable dimmer boards may be a necessity if I wanted to go the full lightbulb route.

echinopsis
Apr 13, 2004

by Fluffdaddy
So these are going to be some baby questions but I've finally got the board in my hand and I'm messing around but I'm also a total morone so

If I am using an external power supply (say a PSU from an old PC) am I meant to connect the ground from the board to the ground from the PSU? Same with the 5v and 3.3v rails? I understand you might want to do that conceptrually to make sure everything is running on the same voltage but.. well, seems like poo poo could get hosed up?

And transistors. I have a small laser module I want to run but of course the UNO doesn't have the current, so presume I can use a transistor to do this? My electronics are shameful but I do believe that should work? Anyone got any good links to a site that shows what kind of transistor is appropriate in which situations etc? I have coming on free shipping from China (GOD I LOVE IT SO MUCH) an array of transistors but I won't know what to do with all of them..


I'm sure to have more questions as my worthlessness continues to shine through. Forgive me

saint gerald
Apr 17, 2003

Sagebrush posted:

Same way, I think? Except that you send a single brief pulse (test, but probably 200ms is plenty) to toggle between the states instead of staying constantly on or off. The latching system is mechanical, just like those power buttons on stereos or whatever that push down and lock to turn on power.

I thought you had to reverse the current in order to flip the relay back the other way?

Sagebrush posted:

Do consider though that this is really just security through obscurity...anyone can easily defeat something like this by finding the relay and shorting it with +12v. A well-hidden killswitch would be pretty much just as effective. If you're okay with that, though, go for it!

Yup, this is not anything particularly stealable or valuable (to anyone but me). It tends not to go far out of my sight anyhow.

It's marginally better than a hidden killswitch, in that someone watching you start the car can't get any clues as to how it's done. If you have a hidden switch they'll see you reach up into the wheel-well or behind the seat or whatever; this way they'll just see me doing something vague with a keychain on one side of the dash, and that won't do them any good without the RFID tag. The main thing is delaying them, and that's one reason why I want to go with a fuel cut-off as well as an ignition kill.

It's also better because it's ARDUINO RFID BIG RED START BUTTON, of course.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

echinopsis posted:

So these are going to be some baby questions but I've finally got the board in my hand and I'm messing around but I'm also a total morone so

If I am using an external power supply (say a PSU from an old PC) am I meant to connect the ground from the board to the ground from the PSU? Same with the 5v and 3.3v rails? I understand you might want to do that conceptrually to make sure everything is running on the same voltage but.. well, seems like poo poo could get hosed up?

And transistors. I have a small laser module I want to run but of course the UNO doesn't have the current, so presume I can use a transistor to do this? My electronics are shameful but I do believe that should work? Anyone got any good links to a site that shows what kind of transistor is appropriate in which situations etc? I have coming on free shipping from China (GOD I LOVE IT SO MUCH) an array of transistors but I won't know what to do with all of them..


I'm sure to have more questions as my worthlessness continues to shine through. Forgive me

You don't have to power a 3.3V rail on the uno, only 5V. The board provides its own 3.3v as a convenience for peripherals. It has a built in regulator that turns the 5V in to 3.3V out.

Most of the time you can just power the board off of usb. If you want to hardwire a separate power supply for some reason, use the pins of the barrel connector. I wouldn't try powering it from the .1" header pins labeled 5V and gnd, as I'm pretty sure this would bypass a diode and filter I think that are between the power input and those pins, again these are meant as outputs for peripherals.

For basic "turn this poo poo on/off", mosfets rule and can typically handle many amps of current if necessary.
Heres a simple tut
https://www.youtube.com/watch?v=Te5YYVZiOKs

P.S. tone down the pitiful me routine, its grating.

peepsalot fucked around with this message at 19:51 on Aug 9, 2013

echinopsis
Apr 13, 2004

by Fluffdaddy

peepsalot posted:

P.S. tone down the pitiful me routine, its grating.

:qq:



Thanks, that video was handy, and makes me wish I had a bunch of MOSFETs coming in the post and not a selection of bipolars. Oh well

Now I'm pretty sure the bipolars *can't* do AC but I heard MOSFETs are basically symmetrical and the drain and source are (for all intents and purposes) interchangeable, does this mean current can flow either direction and hence it can be used to control AC?


I have an idea in mind to control a bird incubator/terrarium's heat/light (just a 60w light bulb) with arduino, is a MOSFET enough or do I really need to isolate the circuits?

echinopsis fucked around with this message at 21:03 on Aug 9, 2013

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

echinopsis posted:

:qq:



Thanks, that video was handy, and makes me wish I had a bunch of MOSFETs coming in the post and not a selection of bipolars. Oh well

Now I'm pretty sure the bipolars *can't* do AC but I heard MOSFETs are basically symmetrical and the drain and source are (for all intents and purposes) interchangeable, does this mean current can flow either direction and hence it can be used to control AC?


I have an idea in mind to control a bird incubator/terrarium's heat/light (just a 60w light bulb) with arduino, is a MOSFET enough or do I really need to isolate the circuits?
Your BJTs are probably fine too, but they are current controlled rather than voltage controlled as MOSFETS are. You will want to send enough current into the base to reach saturation(using a resistor to limit to the proper value), check the spec sheets for your part numbers to see what that is and what current they are rated for.

Drain and source are not interchangeable on a MOSFET. You can't switch AC with a single MOSFET. Its possible with a more complicated circuit and multiple mosfets, but you're better off just using your transistor to power a relay(you could also get a solid state relay) for handling AC.

peepsalot fucked around with this message at 22:02 on Aug 9, 2013

echinopsis
Apr 13, 2004

by Fluffdaddy
Yeah that's the impression I'm getting. Problem is I want to essentially "dim" the bulb to make the incubator the correct temperature. I guess I could thermostat style and switch it on and off but that's less appealing


peepsalot posted:

You will want to send enough current into the base to reach saturation(using a resistor to limit to the proper value), check the spec sheets for your part numbers to see what that is and what current they are rated for.

Cool this is a good simple explanation of what I need to achieve. Saturation is only required if using as a switch right?

quote:

Drain and source are not interchangeable on a MOSFET.

I don't mean to doubt you but I read on other places on the net that they basically are... After a bit of reading I can still see why AC would be an issue but yeah

Delta-Wye
Sep 29, 2005

echinopsis posted:

Yeah that's the impression I'm getting. Problem is I want to essentially "dim" the bulb to make the incubator the correct temperature. I guess I could thermostat style and switch it on and off but that's less appealing


Cool this is a good simple explanation of what I need to achieve. Saturation is only required if using as a switch right?


I don't mean to doubt you but I read on other places on the net that they basically are... After a bit of reading I can still see why AC would be an issue but yeah

An ideal mosfet is symmetrical (it's just a pinched channel between the source and drain), but the 'body diode' will conduct in one direction without control. See ye ol wikipedia http://en.wikipedia.org/wiki/Power_MOSFET#Body_diode

Some ideas;

Dimming is usually done in the digital world via PWM, but this is awkward with AC even though a resistive load like a lightbulb should react nicely*. A relay is out because the switching speed is slow and the hardware probably won't survive. A TRIAC can be used to only power the bulb during a small portion of the AC waveform; this is a typical solution in lots of commercial devices; i know this because I've had to replace a bunch of burned out triacs :iiam:. This setup works nice, but you need a zero-crossing detector and a bunch of other junk.

You could also approach the problem as a standard control problem. You have a target heat, and a measured heat, and can just make a quick bang-bang controller. If the measured heat is lower than your target, you turn the bulb on, if it's higher, you turn the bulb off. This is great, but if it's a terrarium with animals and poo poo, they probably don't want to have the light going on and off all the damned time.

Another approach would be to get rid of the AC - it's really the problem. A light bulb isn't polarity sensitive, just current sensitive. It's possible to just take the AC in, full bridge rectify it, and then treat it as a really large DC waveform. Your diodes should be standard rectifier diodes with enough current carrying capacity (60W/120V = .5A, so maybe 1A or so) and your mosfet will have to be rated for both the current and the max voltage (175V or so). There is no reason to filter or regulate it, so the part count ends up being pretty reasonable.

*I'm pretty sure the filament would be okay with this as long as the average temperature is pretty constant so you're not stressing it with constant expansion/contraction but I could be wrong.

Sagebrush
Feb 26, 2012

echinopsis posted:

I don't mean to doubt you but I read on other places on the net that they basically are...

No, they aren't. The solid-state component that switches AC is called a triac. It works more or less the same way as a transistor though.

If you're going to be switching 110v for an incandescent light bulb, you'll ideally want to add in a zero-crossing optoisolator like the MOC3041 to protect your Arduino and prevent you from killing yourself.

echinopsis
Apr 13, 2004

by Fluffdaddy
Interesting... We use a solid 240v here but I don't think that should be an issue. I had thought about using a switching 12v power supply and doing everything from there. 60w at 12v is what 5A? That's not huge is it? http://dx.com/p/sanpu-60w-12v-5a-power-supply-driver-w-switch-for-led-strip-light-silver-228227 I know nothing about the ability for a 240v bulb to run on 12v, even if you keep power at 60w. At least that would make the rest of it easy to solve

echinopsis
Apr 13, 2004

by Fluffdaddy
The other option bandied around is using a servo to control a traditional dimmer. It seems like a terrible workaround but it could be the easiest. Although it's suck to have to use two power sources for such a simple (seeming) thing which is why I perhaps hope using the power supply I could solve all those issues (coz arduino can run off 12v right?)

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

echinopsis posted:

Interesting... We use a solid 240v here but I don't think that should be an issue. I had thought about using a switching 12v power supply and doing everything from there. 60w at 12v is what 5A? That's not huge is it? http://dx.com/p/sanpu-60w-12v-5a-power-supply-driver-w-switch-for-led-strip-light-silver-228227 I know nothing about the ability for a 240v bulb to run on 12v, even if you keep power at 60w. At least that would make the rest of it easy to solve
12V would probably be doable.brain fart thanks for reality check delta-wye. You'd have to find a 12V 60W heat lamp bulb instead, assuming those exist.

The rest of this post is still relevant I suppose.

I've been told, though I haven't measured this myself, that light bulbs draw quite a bit more current when first turning on, since the resistance of the filament increases as it warms up. You should be able to measure the "cold" resistance with an ohmeter to see for yourself if this checks out. P = V^2 / R => R = V^2 / P so a 60W 240V bulb should have a "hot" resistance of 960 Ohms. If the cold resistance is much lower, this could give instantaneous currents higher than 5A. You may want a slightly overrated power supply.

peepsalot fucked around with this message at 23:34 on Aug 9, 2013

Delta-Wye
Sep 29, 2005

echinopsis posted:

Interesting... We use a solid 240v here but I don't think that should be an issue. I had thought about using a switching 12v power supply and doing everything from there. 60w at 12v is what 5A? That's not huge is it? http://dx.com/p/sanpu-60w-12v-5a-power-supply-driver-w-switch-for-led-strip-light-silver-228227 I know nothing about the ability for a 240v bulb to run on 12v, even if you keep power at 60w. At least that would make the rest of it easy to solve

Ohm's Law: V = IR
W = IV

A light bulb can be modeled as a simple resistor.

A 60W bulb consumes 60W @ Vac. If Vac is 240V, then 60W/240V = .25A. To get 250 mA @ 240V, the light bulb has to have a an equivalent resistance of 960 ohms. This is assuming its a simple incandescent bulb, of course.

EDIT: drat, beaten. Worth pointing out that W = (V^2)/R, or 12V^2 / 960 ohms. At 12V your light bulb will be a 150 mW light bulb.

Delta-Wye fucked around with this message at 23:22 on Aug 9, 2013

echinopsis
Apr 13, 2004

by Fluffdaddy
God drat it. Oh well. All good points, it's good to think about these things.. Thanks :]

Adbot
ADBOT LOVES YOU

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer

extravadanza posted:

Did you think about using LEDs instead of a traditional light bulb? I figure I don't need it to be like a sun-in-my-room bright... but LEDs aren't the best at filling a room with light. I worry LEDs won't be bright enough. It looks like those controllable dimmer boards may be a necessity if I wanted to go the full lightbulb route.

I did look at LEDs, but I did this before I got into and really understood stuff like Arduinos. I also realized the same things about LEDs, you've got to have a lot of them, and the color can be a bit harsh with white LEDs. The lightbulb is a lot more warm yellow/Orange and sunrise like than a single color led setup would be. You can also tweak the total brightness of the light by changing the wattage of the bulb.

Of course, I might end up having to scrap it and go with an LED setup eventually as incandescent bulb availability goes away...

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply