Just wanting to ask if there's a way that an old computer could be like a microcontroller. In the sence that it has a range of pins (standard, PWM and analogue), both input and out put could be emulated by the operating system.
Electronic – arduino – IO Pins for Computer like an Arduino
arduinocomputersiomicrocontroller
Related Solutions
In an industrial environment, the cost of the electrical panel is a tiny fraction of the value of the items that will be processed. Furthermore, the cost of an ordered part (even at industrial premiums) is often actually less than the cost of your custom power supply. Are you factoring in:
- Non-recurring engineering cost (NRE) - The cost to design this power supply should include you working on the design. Your naivety in asking this question indicates that this is likely to take you several days. What's your time worth hourly? And don't just use your salary/2000 working hours per year number; include the cost of all your benefits, insurance, vacation, etc. If it's less than $50/hour, you're doing it wrong. Alternatively, try to determine the revenue that you could be bringing to your company working on something else: The average revenue per employee at Google, for example, is over $1,000,000. If a Google engineer works for one hour to save the company $500 on a one-time purchase, they've only broken even. If you're a public company, it should be easy to find your annual revenue and the number of employees: Go check and see what your time is worth!
- Cost of implementation delay - It could be running in 2 days, guaranteed, if you just bought one, even with quick-turn shipping on the PCBs your custom module won't be ready for a week or more. And that's assuming that it works perfectly the first time. That also doesn't include any testing - you can design it such that it ought to have a wide input range and and good temperature performance, but you don't know that it will until you put it in a temperature chamber. The pre-built supplies have been tested in a temperature chamber and cycled between 0 degrees C and 125 degrees C, do you even have access to one?
- Cost of replacement: You mentioned "Possible volume purchasing", if your boss finds that you need 10 more a year from now it's far easier and quicker to look at the BOM and order 12 of these things (the extras are spares, of course) than to rebuild a custom part. Perhaps you're still at the same desk with the same computer, and you remember the design process and still have the files for it. Or perhaps you're in a new department, and have to be called back. Or perhaps you've moved to a new company and someone else has to try to find the design files, read your notes, and try to rebuild this thing. Been there, done that, got the T-shirt: It's not fun.
If you're trying to boostrap a company on your credit card, sure, it's OK to cut a few corners and value your time less. If you are an established company, or if you have venture capital, it's almost always cheaper to buy the pre-made module.
Assuming your computer takes 12V as an input, and assuming that you want to use 24V as the input (and not 120 or 240V AC, which is more common), just grab one of these Phoenix Contact power supplies (or anything with similar specs, Omron and Sola also make lots of these - It's just that I've used this line before, and don't want to bother looking for others). It's from Phoenix, so you know it's well made and you don't have to worry much about temperature dependence, ripple voltage, or lifetime. Send $200 to Digikey (after shipping) and it will be in on Monday morning when you get back. (It's Friday morning right now for future readers...) On Monday, clip it to the DIN rail in your panel, wire it in, and you've got power. You're done. When you need to replace it, it will still be available (or they'll offer a replacement).
Your boss has the correct attitude in this situation. In industrial engineering, avoid custom parts like the plague. I know, that $200 power supply is just a switch-mode chip, a PCB, a couple small parts on the PCB, a few connectors, and an enclosure - the BOM cost was probably $50. It hurts a little to spend what feels like a lot of money on a power supply, or an industrial rackmount computer, or an I/O card, but it's the better way to do industrial electrical design. Think of yourself not as an architect, designing every detail of the system, but rather as a plumber - you just need to connect everything together.
I think it is threefold:
When power supply of various IC's is not connected before signals on other pins, the semiconductor can act as a thyristor between power supply rails, which results in short circuit the PSU (failing the whole PC) and high power dissipation or blowing the chip(s on the device).
The computer for many devices just isn't aware of them being plugged or unplugged. The operating system will not be able to use it as it is unaware of its existence OR the operating system is trying to use a device that is no longer available. Only few buses are able to cope with hot plugging (eg. USB).
(inductive) power surges due to unplugging can easily blow poorly designed hardware. I blew out the DAC's on my video processor once...
Related Topic
- Electronic – arduino – Efficient way to get multiple analogue voltages out of an Arduino
- Electronic – Is it safe for micro to switch pins from input to output in a loop
- Electronic – Switch on computer with microcontroller
- Electrical – linux – Theoretical max rate of input capture for a USB mouse and possible hardware limitations
- Electronic – Does computer memory record the zero binary state
- Electronic – How to protect microcontroler analogue 0-5V input pins from high/negative voltage
Best Answer
If you mean a VERY old computer: the parallel port on the really old ones (IBM PC) was such an I/O port. On later ones it was a bit more complex, but could still be read and written by a simple I/O instruction.
On current PCs things are not that simple any more, and there are layers upon layers of hardware and software between the CPU and pins that go to the outside world.
If you want to play with I/O pins: get a bare micro-controller (PIC, Cortex M0, AVR), or a development board (Arduino is a popular one), or a Raspberry Pi.