element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Smart Control of Power Flow
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 18 replies
  • Answers 8 answers
  • Subscribers 392 subscribers
  • Views 2115 views
  • Users 0 members are here
  • arduino-ide
  • arduino
Related

Smart Control of Power Flow

sayed94
sayed94 over 5 years ago

Hello guys, currently I am doing a project based on Power Sharing between Solar Home Systems by Smart Control of Power Flow. Any access energy will be share a common DC grid line (neighbouring PV system interconnected each other) based on a certain logic. I need to use a microcontroller which helps to control the power flow by certain simple logic below :

 

For a PV system, Initially, a microcontroller is checked the panel voltage, If panel voltage is available, then the solar panel will supply the load power. Also, the battery condition is checked simultaneously. If the state of charge of the battery is less than 90%, then the battery is also charged from panel voltage, otherwise, the excess panel voltage goes to the grid for sharing. In the meantime, If there is no panel voltage like abnormal weather and night times, the battery condition is checked and if there is significant charge in the battery, then battery supplies load with necessary voltage, else the microcontroller looks for available power from the grid to borrow where other SHS also interconnected. So voltage and the current sensor also included measuring the power how much send to the grid and how much (KWH or unit) take from the grid.

 

So now I need help, hopefully, someone will help me how can I start to code it in Arduino ....... or how can I model it MATLAB Simulink. I am looking forward to hearing someone

best regards
Thank You
Md Abu Sayed



  • Sign in to reply
  • Cancel

Top Replies

  • jw0752
    jw0752 over 5 years ago +3 suggested
    Hi MD, I do not know the answer to your question but when I have been faced with similar problems in the past I have always started with a Logic Flow Chart. The next issue will be how you intend to sense…
  • shabaz
    shabaz over 5 years ago +3 suggested
    Hi MD, That's the approach I would use too, i.e. draw a flow chart or any description that completely defines the procedure (i.e. it becomes an algorithm of some sort), in your case maybe with inputs and…
  • fmilburn
    fmilburn over 5 years ago in reply to sayed94 +3 verified
    OK, that is helpful. I am glad to see from a safety viewpoint the voltage we are talking about is ~12V. This is not to dissuade you, but understand that what you are undertaking may be challenging. For…
Parents
  • shabaz
    0 shabaz over 5 years ago

    Hi MD,

     

    That's the approach I would use too, i.e. draw a flow chart or any description that completely defines the procedure (i.e. it becomes an algorithm of some sort), in your case maybe with inputs and outputs that you wish your Arduino to sense and control. Then translate from your flow chart into pseudo-code. And then write the code from that.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • sayed94
    0 sayed94 over 5 years ago in reply to shabaz

    I appreciate ur help
    by the way i did my algorithm but stack in converting algorithm into coding in arduino

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • fmilburn
    0 fmilburn over 5 years ago in reply to sayed94

    OK, that is helpful.  I am glad to see from a safety viewpoint the voltage we are talking about is ~12V.  This is not to dissuade you, but understand that what you are undertaking may be challenging.  For example, if much current is involved and the distance is very far, the cable may need to be quite large.  And there could be many other hurdles along the way.

     

    The more definition you have before starting the more likely you are to succeed.  For example:

    • What battery technology to use - e.g. Lead acid, etc.  Realize that a lead acid car battery may have up to 14.5 V or so when charged.
    • How to tell the charge level of the battery.  See for example this link:  https://www.energymatters.com.au/components/battery-voltage-discharge/
    • Decide what Arduino to use - e.g. is it 5V tolerant or 3.3V maximum.  How many pins and what type will be needed.
    • Etc.

     

    Now break the problem into pieces and develop blocks of code for that piece.  Start with the block "Check panel voltage".  Set up a prototype on your bench using smaller batteries.  The Arduino can make analog voltage readings, but you will need to set up a voltage divider or something to get the voltage down to what the Arduino can handle.  Then in the loop the Arduino function analogRead() can be used to determine the voltage.  Get that working first and display the output to the serial port.

     

    Keep breaking it into pieces.  Let's say that next you code a if statement and determine the panel voltage and it is >= 12 V.  Then a method is needed to determine battery charge.  That is why the second bullet point above needs to be answered.

     

    And so on... What mechanism is going to be used to charge the battery?  Will the Arduino be controlling a relay or a separate board or what?  What will be the user interface and how will information be displayed?  All these questions need to be answered before coding can start.

     

    My advice is to get the best problem definition you can before going much further.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • fmilburn
    0 fmilburn over 5 years ago in reply to fmilburn

    Also, is this a project you intend to build or a school assignment?  I don't know how much programming and electronics background you have but this guy goes into excruciating detail :-) on how to set up a voltage divider and read an analog pin...  https://www.youtube.com/watch?v=5TitZmA66bI

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • sayed94
    0 sayed94 over 5 years ago in reply to fmilburn

    I really appreciate you Sir @fmilburn for your informative details, I hope you will continue to give suggetion

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • sayed94
    0 sayed94 over 5 years ago in reply to fmilburn

    This is my degree final year project .....my background from Electrical
    My knowledge in programming and electronics in on fundamentals only but I truly looking forward to learning............!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • sayed94
    0 sayed94 over 5 years ago in reply to fmilburn

    In addition, I am attempting to model this algorithm in MATLAB regarding to analyze my project. May I have any suggestion from you

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 5 years ago in reply to sayed94

    Hi MD,

     

    I've not used Simulink so I cannot help there, but if you were to write it in normal Matlab code then it's not much different to writing it in any programming language. You could write it as a function or set of functions, and pass in the desired inputs and print the outputs. Your logic flow doesn't appear to use any previous historical data (i.e. you're not doing things like filtering or storing previous inputs or outputs) so a set of functions, and for your simulation test inputs (they could be in an array to run a load of tests sequentially) would be sufficient, I don't think it needs to be more complicated, based on your flow chart. In other words, the simulation becomes a set of test inputs that you design, and you record the outputs and check they meet the expectation.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • fmilburn
    0 fmilburn over 5 years ago in reply to sayed94

    I am glad I was helpful...

     

    I haven’t used MATLAB in quite sometime and don’t have a license for it.  But I would approach a solution the same way.  Start by thinking about what the physical system might look like instead of algorithms or MATLAB models.  Make a drawing which shows the battery and what you know about it.  Add the solar panels, charging, and instrumentation (and all pertaining information).  Draw the things that will be connected to it - eg lighting, water pump, etc. Estimate the power requirements so you know how large the batteries and solar cells need to be.  Show the connection to the network.  Add the control system with the Arduino to the drawing after you know what it will be controlling. Then start prototyping it piece by piece as described above. The same with MATLAB- once there is a good drawing you can start to model the pieces making sure each works as it is added.

     

    The most important skill for getting help on something like this is the ability to communicate technical issues.  This almost always means a drawing or sketch. Or in the case of programming a flow diagram, pseudo-code, or code snippets. If you do this others are much more likely to help.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • sayed94
    0 sayed94 over 5 years ago in reply to fmilburn

    I agree on you Sir @ fmilburn

    first of all, this is clear enough what you explained and how to brings the project one step ahead!!!  and this is truly important to have the ability to communicate technical issues on a particular project to taking help!!! for now, I go through what U advised and study more and I come back to you

    Hopefully you with me for further help
    Thank you very much @Sir
    best regards
    Md Abu Sayed




    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • sayed94
    0 sayed94 over 5 years ago in reply to shabaz

    Indeed I will try to code ......... my concern is how I analyze the output in my research paper!!  hopefully, you add some sentences about this
    Thank U Sir @shabaz for your kind explanation

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 5 years ago in reply to sayed94

    Hi MD,

     

    This is the area to research for your project:

    Test harnesses, and test suites. These are the terms that will provide you with the information on this. In brief, you'll have to design some tests, write your expected results, then run your code and view the results (for example printed to screen or file if you're simulating with Matlab or some other software) and compare with your expected results.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • shabaz
    0 shabaz over 5 years ago in reply to sayed94

    Hi MD,

     

    This is the area to research for your project:

    Test harnesses, and test suites. These are the terms that will provide you with the information on this. In brief, you'll have to design some tests, write your expected results, then run your code and view the results (for example printed to screen or file if you're simulating with Matlab or some other software) and compare with your expected results.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube