I'm completely new to arduino, don't own any yet. I work as data engineer, python/flask/sql/api_integration is what I do for living.
Got several raspberry pi devices:
one was running under raspbian and used as custom dns server, vpn router, home nas (too slow tbh), card died several months ago and didn't have time/wish to repair yet; it was the very first rpi model and its sd card is real hero, it worked at least 6 years;
other two are media centers in kids' room and living room; running kodi/osmc, so far so good
another one is not used yet, but plan to use it as media center in our country house/trailer (didn't buy a trailer yet).
My current level of electronics handling is above zero a bit; that's why I'm here, I would like to start and learn.
Usually I need some real stuff to implement in order to start, because just "hello world" (or "lamp blinking" in case of arduino) is not something I would like to do as start project.
My real need is to create power management system.
All power sources are 12 volts. Power source usage rule:
if power source "1" is active (active means that it is turned on and produces 12 volts +/- 0.5 volt or so) then we always use it
if power source "1" is not active, we use the next "2"
and so on: if "1" and "2" are not active, we use the next "3" or "4"
anytime "1" is active again, we switch to it.
We have two equal devices consuming 12 volts power. We need to turn them on one by one every two hours for 5 minutes and then turn off.
So, let's say it's
1:00 pm -- turn on device #1;
1:05 pm -- turn off device #1;
2:00 pm -- turn on device #2;
2:05 pm -- turn off device #2.
Turning on happens only between 9am and 5pm.
Need to alert about invalid data source (it's time to use it but it's not active) and invalid devices (we try to turn it on but it doesn't consume energy) by triggering external API. Also in case power sources do produce some volts above 0 but not enough or more than allowed range (12 volt +/- 0.5 volt) then we alert about it as well. Wi-Fi is available, but if not then we just store log internally (hope using some local storage is possible).
My question is, is it correct way to implement this, can arduino cover above task? If yes, what type of arduino and its additional parts I would need? As mentioned above, I can program it Python, is it possible to implement above algorithm on Python with arduino?
Yes I believe an Arduino with Python could do it. To research this and develop a parts list and a prototype schematic will take a lot of time which I am not willing to spend. You would be the best one to do the research.
gilshultz:
Yes I believe an Arduino with Python could do it. To research this and develop a parts list and a prototype schematic will take a lot of time which I am not willing to spend. You would be the best one to do the research.
Hi, I do agree. But how do I start? I'm completely new to this world and even googling right things requires some basic background. I'm not asking you to spend time to "research this and develop a parts list and a prototype schematic", just to give few more hints if possible.
You can just use diodes to decouple the various power sources and loads ... or you can use logic-level power P-channel mosfets if you need to drive them (turn them on and off at will)
Note that i mentioned "power" mosfets, not for the need of high currents, just cause more the RdsON of the mosfet is low (resistance of the mosfet when is in ON state), less is the voltage dropout on the mosfet itself, and less the power dissipated as heat from it ... and usually, more the current limit rate of a mosfet is high, lower is its RdsON ... and also, actually power mosfets prices are lowered a lot ... example, TJ90S04M3L , 6 milliohms max at 4.5V of VGS and 45A of current ... or similars ...
Reading Etemenanki's post I can see that I would need some basic onboarding first. What would you suggest me to read so that I can slowly start to understand electronics basics? Please advise.
gilshultz:
Yes I believe an Arduino with Python could do it. To research this and develop a parts list and a prototype schematic will take a lot of time which I am not willing to spend. You would be the best one to do the research.
Why Python? Most of us here use C++ and the Arduino IDE.
I don't know of any Arduino that can be programmed in python. Adafruit has a range of micro controllers that use circuit python and could be used for your project.
Arduino uses its own programming language, which is similar to C++. However, it’s possible to use Arduino with Python or another high-level programming language. In fact, platforms like Arduino work well with Python, especially for applications that require integration with sensors and other physical devices.
Maybe you mean that performance is better when we use C++ (which is obvious), but this is different story.
Sorry, don't know similar books in English (i'm Italian) ... here there was a book made from an editor of an electronic journal, Nuova Elettronica, that was a good starting point, but don't know if there is any English version of it ...
@marchelloua: I think you were a bit confused by the website you linked, which is poorly written and inaccurate. Arduino is programmed in C/C++ and cannot at present run Python code. The website authors make the point below that a C/C++ program running on Arduino can communicate with a Python program running on another computer.
Python
While your Arduino can't run code written in Python out of the box, it is possible to use Python to communicate with the device via serial input. This is very simple on a Unix-like system, but if you're using a PC or a Mac then pySerial can bridge the gap. You can download pySerial from its developers website, which also features a host of information about running the software on various different operating systems — make sure that you have a copy of Python on your system, too.
Related to your original question on selecting power sources: You can simply use diodes to choose between sources. The source with the highest voltage prevails.