I am a CNC machinist, and I own a machine shop with my wife. We don't have employees, so we are looking to automate some tasks as well as access information remotely. Nothing too complex, but I do understand that it always seems simple from the newbie's perspective. To that end, this post is to see if Arduino is a good fit for what I aim to do, and request for advice on where to start and with what hardware.
I do have experience programming in Python, mostly csv reading scripts with some math and sorting functions that integrated with autoCAD. I also dabbed in C and JAVA and C#.net, but never seriously. And 30+ years ago I farted around with BASIC haha.
To be extra clear, I am not looking for solutions right now. I am looking to see if these projects can be done with arduino, or if I am being too ambitious. Is there advice on how to approach these incrementally? Do I spring for the board that can do it all, or do I get one that is easier to learn on and eventually upgrade to accomplish the tougher stuff?
One project would be to close an air valve remotely, preferably with a wifi connection accessed from a web browser. I think this from mcmaster-carr would work as a selenoid: https://www.mcmaster.com/4711k312/ . It has a 24V DIN connection, and is normally open. Connecting that selanoid to which arduino board, connecting the board to my wifi, and than accessing it via web browser are all complete unknowns to me.
Another project would be remotely monitoring some machine status lights via wifi and web browser. There are five lights, and they indicate various states the machine may be in. sometimes they flash, sometimes they combine. There are 3 tower lights at 110V AC, and two button lights that are 24V DC. These voltages are not 100% confirmed, just a brief looking over of the wire diagrams. Ideally I would get a text message or email for certain conditions, like red light on or both green lights flashing.
Project 3 would be checking to see if I left the coffee pot on again. Being able to cut the power remotely would be better. I know they make smart switches, but I figure it might be a good spring board into the more complicated projects.
Of course, I appreciate any feedback.
Thanks
have a look at the ESP32 which has onboard WiFi, Bluetooth Classic and BLE and the ESP8266 which has onboard WiFi
tell use more about how you would use the target devices
is the area where the target devices are situated covered by WiFi?
if not how far away from the controller/webclient are they?
should the target devices be connected all the time or at intervals using laptop or smartphone
all three projects seem to be doable with "Arduino". If you need something with Wifi - consider to use an ESP32 or ESP8266 - both can be programmed with the Arduino IDE.
Nevertheless I suggest do your start/learning with an Arduino UNO or Arduino Nano (classic), read buttons, switch LEDs, let them blink. These are basics you will need in your projects anyway.
After you got your first LEDs blinking, I have something which might be a start for Project 2:
https://werner.rothschopf.net/202010_arduino_switch_by_time_en.htm
To avoid issues with isolation and changing voltage levels, could you use photoresistors to detect when a light is on?
If so this sounds like a project you could use as a basis for experimenattion, just with an arduino on a breadboard, and some "local " LEDs to indicate the condition.
You could then evolve that using eg an ESP8266 or ESP32 - which both have wifi natively - to allow remote monitoring.
Project 3 sounds similar to this
Hi daffyff,
Everything you suggest is totally feasible. You've got some good advice already. Particularly that ESP32s are probaby your best bet. They come in various flavours, and (when not working in my preferrred 8-bit world) I generally use this one
available at various locations (n.b., this isn't an 'arduino' proper, but it can be programmed just like an arduino in the ArduinoIDE).
For IoT platforms I'm sorry to say I've had terrible luck with reliability of the Arduino IoT system, but I have had really good luck with
(they are compatible with arduino with lots of documentation to get you started). Their free account should cover all of your projects. They have recently reduced the scope of their free account, but it will still accommodate all three of your projects.
For the coffee pot, you could turn it on and off with a combination of an IoT platform like above, Arduino/ESP32, and a smart plug. I've been able to control this smart plug
using this library:
to control my christmas tree lights this year for basically exactly the same reason as you want to control your coffee pot (project for this weekend is to adapt it to the grow lighting for my tomato seedlings). It is a nice alternative to playing with mains power and relays, if a bit more complex.
Michael
Thank you all so for your input, it is very valued.
I do have good wifi coverage in my space. It's not the best where the coffee maker is though, but I can improve it rather easily.
It's a good question, and one I should get used to asking myself. My instinct is to opt for intervals in an effort to simplify the project, at least to start. Just a way to ensure it is off from the comfort of my home.
Absolutely and I love this avoidance of issues. But out of curiosity, what if I did need to deal with isolation and changing voltage levels? How would one go about overcoming them?
Is there an advantage to this approach over johnerrington's suggestion?
again thanks to everyone that contributed.
Yes you can do all this ,for now, look for ESP32 dev. board for your hardware, and for the UI you could use Arduino IOT Cloud platform, nice widgets, android app and you could get help here..
Is the electrics (48 V) in the machine galvanically separated from mains?
If you cannot answer this question with yes, I suggest to keep it closed and not mess with it. And follow @johnerrington 's advice.
Messing in the machine moves liabilities from the manufacturer to you...
Photodiodes or photoresistors would be inherently safe. And probably easier than messing in the machine as well.
Dealing with voltage levels and isolation should be done with a relay or opto coupler.
RP2040 Connect is a really nice board. Easy to program. Has two cores, WiFi, Bluetooth... Really nice:
There are the Pro boards as well. I just started working with the Portenta H7. It has WiFi and Bluetooth. For a little more $, there's even a nice harsh-environment version:
To turn stuff on and off, just connect some digital pins to a rail of relays. I use a bunch like this on my robot (robot has a 24v, 12, 9v, and 5v subsystem):
Power your relay board and Arduino with a separate power supply. I step down my 12 volt system to 5 volts using this:
Hi,
I think it is complimentary. Johnerrington suggested a way to monitor status lights (power led on your coffee machine, or the leds on the other machine you want to monitor) without hacking into the machine. I was more thinking about what you would do once you had left the shop and your system told you, by whatever means, that you had left the coffee pot on. If you had your ESP32 (or whatever you pick) talking to a smart plug like that, you'd be one step closer to beign able to shut off the coffee pot at the wall (again without physically opening anything that your warranties, or worse, insurance adjustor, might object to), from your phone, after hours.
Michael
The boards I mentioned above come with examples. You don't need to buy them to see. Download the Arduino IDE and go to the board manager. Install the board in the manager. Go to the libraries manager and install any libraries related to the board. Also install the library, WiFiNINA:
WiFiNINA
This will also setup all of the examples for the board. If you then go to open a new project and you have your board selected, you can then chose one of the example WiFi projects. You can compile and mess with it even without the board.
Out of curiosity, I just:
- Plugged in my "NANO RP2040 Connect" with the USB cable
- Copied and pasted the sketch code from: https://docs.arduino.cc/library-examples/wifi-library/SimpleWebServerWiFi
- Set my network name and PW in the Arduino sketch, and compiled the sketch to the RP2040
- Set my router to allow port forwarding of port 80 (general web server port) to my connected RP2040
... and now I can load my home IP address in a browser anywhere in the world to control the RP2040! My home WiFi address will get anyone on the outside to my home modem/router. The "port forwarding" I setup in the modem/router points anyone coming in on port 80 to my internal Arduino RP2040 address on port 80. Sketch allows you to turn an LED on and OFF remotely. It can easily be modified. This is the first time I've had an Arduino online that I can control anywhere VIA a browser. Nice ![]()
As for seeing if LEDs are on or off, you can probably attach some of these near the LEDs/Lights. I mean, right next to them partially covering them... or something like that, just to make sure the lights in the room don't give false signals:
Optical Sensitive Resistance Sensor Module
... and attach them to some digital input pins to check for HIGH or LOW.
You dont need modules, just an LDR or photodiode - or even an LED.