Show Posts
Pages: [1] 2 3
1  Using Arduino / Sensors / Detecting button presses on a 120V button on: April 17, 2014, 01:55:09 pm
At work we have a large industrial mixer that I use. It's from probably the 1960s and everything is ancient on it. I've already set up a modern thermocouple setup to take temp readings and log them on a laptop. I realized it'd be nice to detect button presses on the control panel (start/stop, plus 4 speed buttons, plus clock start/stop and a clock reset button) and tie that into excel macros to record the status along with temp and time.

I thought that'd be relatively easy, connect all the buttons to an arduino in parallel to their existing circuits. But then I opened the cabinet up and realized this isn't low voltage signal buttons. They're switching full 120V AC and sending that as signals over to the electrical panel that actually runs the motor.

So, is there an easy, cheap, safe way to detect button presses on something like this? I haven't mapped out the buttons fully yet (they've got 4 connections on the back, not two, and it looks like maybe they're wired in series somehow, but the wiring is very nicely done with no slack in heavy-gauge wire and the labels are so old they've mostly fallen off, so it'll take some time to trace it all out and figure out what it's doing. On the other hand, the wires go from the buttons over to a nice terminal strip, so wiring in would be dead simple....)
2  Topics / Device Hacking / Re: Controlling IR blaster box with arduino on: August 19, 2012, 09:49:31 pm
Success!

Hooked up the arduino to the IR box, and it's working great.

Connection I used was to hook a PWM pin to R21 and ground to ground. Plugged in the IR blaster and started the program on the arduino - worked perfectly. Got lots more range than the old IR LED setup I had.
3  Topics / Device Hacking / Re: Controlling IR blaster box with arduino on: August 19, 2012, 05:58:22 pm
Ok, had a few minutes to play with it...

1. Noticed that under the blue wires from the transformer it's labeled 12VAC. The component labeled U1 (next to the biggest cap) is a 78L05 voltage regulator. So all the diodes and stuff there is converting the AC to DC, and then the VR is dropping it from 12 to 5, right?

2. I did stick a multimeter on the output of the voltage regulator. It's giving a nice 5.05V and I saw about 90ma between it and ground. That's not powering any LEDs or anything at that point though.

So, I'm guessing I shouldn't power the arduino (probably a teensy) off that voltage regulator. What powering THIS off the same power source as the teensy (probably a basic AC to USB adapter)? Just bypass the all the power regulation stuff on this board completely. Thoughts?
4  Topics / Device Hacking / Controlling IR blaster box with arduino on: August 17, 2012, 07:01:45 pm
Trying to make an IR blaster to control some toys. I've got working code that will drive an IR LED and it works, but I wanna up the power significantly. I was looking for something else and found an older RF-IR box from an old remote control. Don't even have the remote any more, so I opened it up. Looks like I should be able to hack it to control the LEDs via my arduino, but wanna make sure I'm not going to fry anything here (not an expert by any stretch of the imagination - I know just enough here to know I need to ask the experts!)

Here's the board in the IR blaster (much bigger pics if you click on them, but they're still just cell phone pics so not the greatest):


IR front by mostlytechnic, on Flickr


IR back by mostlytechnic, on Flickr

Obviously the top right (of the lower pic) is the transformer (runs off normal AC, not a wall wart) and in the very corner is a jack for an external IR blaster.
Across the bottom are the 4 IR LEDs, a red LED for showing the signal, Q6 (just left of center at the bottom) is the transistor driving the LEDs, and a couple resistors (one's between the microprocessor and the transistor; one's in series with the LEDs).

On the other side (top pic) there's the RF section under the metal shield (which I don't care about), a processor in the center (also don't care about), and other stuff.

So, tell me if I'm following this right. The center pin on the right hand side of the main chip goes off to R21, which then goes over to the center pin of the transistor (sorry, don't have the board with me right now to get the numbers off the transistor to see exactly what it is). Looking from the green side of the board, the right leg of the transistor goes to the huge trace, which I assume is ground? The left leg goes to R20 and then off to the LEDs.

So, here's my questions (again, don't have the board here to start checking stuff with a multimeter)...

1. To use an arduino to control the LEDs, I'd connect the output pin to R21? Or more likely, see what voltages this things running at R21 and possibly go output-new resistor-transistor? And then connect ground from the arduino to somewhere....

2. What's all that going on near the transformer? I see 4 diodes? on the brown side and small caps on the green side, plus a bigger cap and another transistor? (U1) on the brown side - all where the blue power wires from the transformer connect. Is that power stabilization? Voltage regulation? Something else?

3. I'll check the voltage coming out of the transformer - assuming it's in an ok range, any reason not to power the arduino off it?
5  Using Arduino / General Electronics / Re: Preferred circuit layout for running LEDs from transistors on: November 04, 2011, 11:17:29 am
Yeah, the cabling is pretty much set already. I'd originally planned to do parallel LEDs, so wired things in prep for that. This odd method of doing series here is just a way to not undo too much other stuff.
6  Using Arduino / General Electronics / Re: Preferred circuit layout for running LEDs from transistors on: November 04, 2011, 09:44:30 am
Oops... did my math wrong (calculated it as 1/Rt = 1/(R1 + R2) instead of 1/R1 + 1/R2)

any benefit to doing a pair of 10R in series vs a pair of 39R in parallel?
7  Using Arduino / General Electronics / Re: Preferred circuit layout for running LEDs from transistors on: November 04, 2011, 09:34:12 am
Ok, did some more thinking about the series method. Here's what I came up with:


SeriesLEDs by mostlytechnic, on Flickr

Does that look ok? (I just noticed that I labeled the one resistor as 22R when it should be 18R for 200ma to the LEDs. It'll probably actually be a pair of 1/2w 10R 39R in parallel or a pair of 1/2w 10R in series.)
8  Using Arduino / General Electronics / Re: Preferred circuit layout for running LEDs from transistors on: November 04, 2011, 05:14:26 am
At first I was sure that it HAD to be parallel to work for my layout, but thinking more, series might work... 12V will be easy to source for this, so I'd go with that. Put all 7 in series and just always use them all, or make some dummy resistor plugs like you suggest. Does make it a bit simpler to not need resistors at each LED, just one in the main box. Now, my calc suggests from 12V for 7x 1.2v LEDs at 200ma each, I'd need an 18R 1W resistor. That's still in the "too low of a resistor" category that got this all started smiley Is that a problem here or should that work ok? I'd probably make that out of a couple 1/2w, since I've got a 1/2w assortment on hand, but no 1w on hand.

I'll draw up a new schematic in a little while, but would it matter that there's 30 or more feet of cat5 between the series LEDs and multiple plug junctions along the way? I might hook it all up (with just jumpers where the LEDs will be) and make sure it's got continuity and that resistance is low enough to ignore.
9  Using Arduino / General Electronics / Re: Preferred circuit layout for running LEDs from transistors on: November 03, 2011, 12:22:17 pm
kkman20xx: Yep, I've used both those sites to calculate. However, for the design I'm doing, series LEDs will be a problem. I really need parallel.

I am not sure why you think you will get a low duty cycle with data. IR has to be modulated normally at 38KHz but can be between 32 and 48KHz depending on the receiver. During the time of the pulses you will have a 50% duty cycle. You can't average it over a long period.
you're right, I was averaging it over too long. This is a 38kHz system, so yeah, it'll be at 50% for a second or so, then off for a while. So it needs to be designed to handle a 50% duty load, which these LEDs should. I'm only planning to run them at 200ma.

Quote
I see what you are saying about the transistors, yes you need a separate base resistor for each one. You calculate the base resistor by taking the current you want to switch and dividing it by the minimum gain of the transistor from the data sheet. This gives you the base current you need. When feeding the base from an arduino output you will get 5V out (for the purposes of this calculation) and the base voltage will be 0.7V when the transistor is on. Therefore you calculate the resistor to have this current flowing down it with 5 - 0.7 = 4.3V across it. You might want to make the base current a bit larger to be on the safe side. No harm will come by having this up to 10 times larger than it needs to be.
If driving lots of transistors from the one output make sure the base currents they require does not exceed about 30mA, if it does use more than one output and split your transistors over these outputs.
Ok, lemme see if I'm getting this then. My transistors are just a bag of generic P2N2222. Googling, people seem to calculate using 25-100 as the gain. So that'd mean a base current of 2-8ma, for a 200ma output. Running 7 then would need 14-56ma, so it could be fine or not off a single output pin. Wikipedia says these should have at least 100 gain, so it'd likely work (my test setup used 4, with no base resistors, and it worked fine, but I only ran it a little while).
Assuming gain of 100 means base current of 2ma, so a resistor of 2150R or less (obviously, there isn't a 2150 exactly)


Ok... rethinking the design a bit...
If you were starting from scratch and wanted to run 7 LEDs in parallel at 150-200ma each, from 1 PWM output, how would you do it (cheap of course is always good...)
10  Using Arduino / General Electronics / Re: Preferred circuit layout for running LEDs from transistors on: November 03, 2011, 10:21:37 am
Yes, these are sending an IR signal, so pretty low duty cycle. Probably <1%. And no, not a serious project. Just something to control some model train stuff in the basement. I've had issues with the IR remote working reliably to all the receiver locations, and I wanted to build my own control interface, so I'm doing this. This is just the output side.

Due to the way I'm setting them up physically, putting LEDs in series won't work. I'm basically running cat5 cable with splitters along, and then having modules that plug in at any of the points that have the LED and resistor in them. I figured I'd build 7 modules, each connecting to a different line of the cat5 wire, so that way it doesn't matter which are plugged in or in which location.

11  Using Arduino / General Electronics / Re: Preferred circuit layout for running LEDs from transistors on: November 03, 2011, 10:01:33 am
Quote
As a rule of thumb if a resistor for an LED turns out to be lower than 33R (ohms) then you need some better way of limiting the current like a constant current supply. At these sort of loads you also need to consider the gain of the transistor and calculate the value of the base resistor.
And this is why I come here for help smiley I'm running everything off a 5V 2A external power supply. So I calculated the resistor for the LEDs based on 5V supply, 1.2V LED, and desiring 200ma (so that 7 of them is drawing ~1.4A). That came out to be 18-19R, so I am planning to use 18Rs. Is there a better way to do it? How much effect does the transistor have?


Quote
I am having a hard time thinking how you can put one resistor in series with 7 outputs and 7 transistor bases. So you must not be understanding the concept of a series base resistor.
The transistors/LEDs are all running from the same signal, just spreading the IR signal over a wide physical area. So I was picturing pin -> resistor -> 7 transistor bases. Or should it be pin -> 7 resistors -> each resistor to a transistor?
12  Using Arduino / General Electronics / Re: Preferred circuit layout for running LEDs from transistors on: November 03, 2011, 09:28:20 am
I'm actually using IR LEDs, 1.2V, pushing them to 200ma (they're rated at 100ma continuous or 2A at a short enough pulse). My calculated series resistors on the LEDs are 18ohm if I remember right.

I have not built circuit 2 - that's just the way I'd do it if I didn't know otherwise. I'm more experienced in "bigger" electric stuff like household wiring, so circuit 2 is the way my mind intuitively wants to do it.

Since I'm going to be using 7 (not just the 2 shown), that's too much for the transistors I have. I could get a more powerful transistor that can handle switching 2+ amps and run the LEDs in parallel, or I could use multiple transistors in parallel. Since I've got em, I was going to use 7 small transistors so that there's no parallel LEDs - each LED has its own "power supply" if you will. That seems like a safer method since the LEDs will be spread out on cat5 cable, ranging from a couple feet to 20+ feet away.

But you're saying I also need a resistor between the teensy and the transistor base? Assuming I stick with the 7 transistors, can that be 1 resistor or do they each need their own? That resistor is to keep from frying the transistors with too much current to the base? (a quick googling doesn't indicate that the teensy has them, so I'll add it)
13  Using Arduino / General Electronics / Preferred circuit layout for running LEDs from transistors on: November 03, 2011, 08:42:56 am
I'm working on making an IR remote system. I've got some IR leds that I'll be running at the end of cables, with a central box containing the arduino/power/etc. (before looking at the circuits below - yes, I know that on a teensy you have to use pin 10 for the IR library - this was just neater to use this pin for the example)

Looking into this, it seems like all the circuits I see are laid out like this:


TransistorLayout1 by mostlytechnic, on Flickr

Power supply goes to the LED, then the LED is connected to the collector, and then the emitters connect together to ground.

Is there any reason it's not done like this:


TransistorLayout2 by mostlytechnic, on Flickr

Would the 2A power fry the transistors? (I'm using 2n2222s, so they're rated for 600ma - the resistors are letting 200ma thru the LEDs). This just seems more intuitive to me than the first layout.

I'm planning to have 7 LEDs and 7 transistors. That's based off the tv-b-gone design, using individual transistors to switch IR leds. The electronics box will contain the teensy, transistors, and an RJ45 jack. The LEDs will be on the other end of some cat5 cables and splitters. So 7 wires of the cat5 will be for the 7 LEDs, and the 8th will be a shared either gnd or 5v, depending on which circuit layout I use.

(oh, while I'm at it... any issues with using a single pin to switch 7 transistors like that? I know on the tv-b-gone they added a transistor to switch the transistors, but that isn't using the same microcontroller)
14  Using Arduino / Project Guidance / Re: Building a train control board (Lego trains) on: October 28, 2011, 09:32:57 am
I think the illuminated switches I have don't need resistors. From playing w/ both a meter and hooking them up, I think they've got a power, gnd, and signal connection and they switch the signal between the power and gnd. So no resistors needed. I'll double check again though to be sure...
15  Using Arduino / Project Guidance / Re: Building a train control board (Lego trains) on: October 28, 2011, 08:21:25 am
Ok, now the throttle box (working on the physical part now, so the wiring will probably happen this weekend).

It'll have an RJ45 to connect to the arduino box. On that, there's 5V, gnd, and 6 signal wires. My box has 3 rotary pots (they're built into the levers, so I don't ahve any data on them, but the arduino reads them just fine when I tested). There's also 3 switches (they're illuminated, but I used standard on the diagram below to keep it simple)

Here's the basic wiring I'm planning:


LegoTrainRemoteThrottle_schem2 by mostlytechnic, on Flickr

Now, I was planning to have this connected in parallel to the arduino board for the gnd and 5v wires - meaning directly to the 2A supply. Is that any issue? Do I need to do anything to cut that down to something in the mA range? Just don't wanna fry anything...
Pages: [1] 2 3