Hi! I am interested in controlling power supply with an arduino chip. I am going to buy a compressor and want to be able to program when it shuts off or goes on. This is for an art installation. I want to be able to program how many minutes the compressor should run and not have to stand there and push the button.
I think I have done this once with 12V but it's a long time ago and I don't remember how. Is it an okay thing to do with 240V or should I stick to 12V and buy a 12V compressor? Either way, what kind of hardware do I need? I have done a bit of Arduino programming but I am still a novice.
I only want to use the arduino as a programmable on/off switch. If there are other better ways to do this I am interested in that too.
I don't know a whole lot about timers, maybe I could find one that works, but I want to be able to set it to be on for (for example) three minutes, then wait for two, then continually go on every two minutes for 30 seconds. I feel like that would be easier with an arduino. And maybe also make the time it goes on vary a bit.
Yes. Typically you use the output from
an Arduino pin to switch a low voltage DC relay on or off, via a transistor. And wire the mains voltage through its contacts.
But if you have no experience of working with mains voltage then, as @UKHeliBob suggests, you would be safer with a 12V compressor. More expense and an unused device on the other side of the choice.
1-2 My idea is to do some trial and error on my computer and then let it run by itself. It will only be on when I am close by and watching - it's an art project.
Even the 12V compressors I have found need 10-14 A and that is too much for a wall wart. I would rather power it with wall power so I was thinking of trying a net adapter for 240V-12V 12.5 A that I found in a local store. If that doesn't work I guess I will have to buy a car battery.
Not any, really. But I can make an arduino cycle power on/off. I have done a couple of projects with motors and LEDs before.
I have no idea what a 'net adapter' is.
Are we talking about powering the arduinbo? Or the compressor? If it's the Arduino, a 5V 500mA or 1A wall wart is all that is needed. Your 240VAC compressor just plugs into the wall via a smart plug. Pick a smart plug that the arduino can communicate with. Do you already have any smart devices (Alexa, Google, Apple, Zigbee, Tasmota, ESP-Home, etc)
Under NO condition use a car battery. They are many thin plates meant for occasional use of a short pulse of 100's of amps. If you need battery power, a deep cycle (fewer thicker plates) is better. Now you need a charger also. If you can plug in the charger, you can plug in the compressor so why the battery?
If it were me, an Alexa compatible plug and the free Alexa phone app will allow you to set up Alexa routines that will start and stop the compressor at whatever times and for whatever duration. If you live in a country that sells Alexa smart plugs and you have a phone that would be the easiest. You may need only a router, or worst case an Echo Dot that costs under $50.
Sorry, I don't know what this kind of adapter is called in English. Net adapter was the only translation I got. It's a "single output switching power supply" according to the instruction manual.
I am talking now about using a compressor meant for plugging into a car cigarette lighter jack, 12V. The arduino's power is sorted. Problem is the best wall socket to cigarette lighter adapter I can find is only 6A and I need 14A.
I don't have any "smart" devices. Could probably get one but I don't really like that solution.
Ok, so this is a small car compressor. 14A from a 12V aux (we don't call them cigarette anymore) seems dangerous. Can you post link to the 12V compressor?
If you go the 12V route, the entire hookup would be.
wall outlet to 12VDC aux female to 12VDC male to compressor. I can do what you want with that by simply replacing the wall outlet with a smart wall outlet. If you do not go that route you need to learn to program a UI of some sort to set the start, run cycles, learn how to use the LCD library, some sort of keyboard or set of buttons library for the settings.
The ironic part is to turn on the compressor is just digitalWrite(pinCompressor, HIGH) but pages of code to manage the ui.
I just checked and nothing else is needed other than an Alexa smart plug and the free Alexa app. I could give you a link for the smart plug, but you are in a different country so it is best if you do a amazon search on Alexa smart plug.
Sorry, it's in Swedish. Yeah, that's why I didn't want to use that kind of adapter. This is what I have:
I don't think I need a UI though. I was just going to set the arduino to run and shut off directly in the code. I might have to do some trial and error but that's ok with me.
Edit: but maybe I should just buy a 240V one then. I kinda wanted to use a 12V one because it's small and cheap and I won't care too much if I break it.
Sound level might be a consideration. The 12V compressors I'm familiar with are kind of noisy. I recycled an AC refrigerator compressor to compress air and it was pretty quiet. I think those are some sort of rotary technology.
Sounds great if I could get ahold of one
I'm ok with it being noisy. It's a cheap compressor after all. I don't have the budget for a good one for this project.