element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Design For A Cause 2021
  • Challenges & Projects
  • Design Challenges
  • Design For A Cause 2021
  • More
  • Cancel
Design For A Cause 2021
Blog MicroGrid Connection Unit #7: OLED Display & automatic calibration
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: makervanlabs
  • Date Created: 26 May 2021 11:37 PM Date Created
  • Views 806 views
  • Likes 3 likes
  • Comments 0 comments
  • oled
  • arduino nano
  • microgrid
  • ssd1306
  • arduino
Related
Recommended

MicroGrid Connection Unit #7: OLED Display & automatic calibration

makervanlabs
makervanlabs
26 May 2021

Having broken my Nano33, I decided to switch back to the regular Arduino Nano. But I decided to stay with the adaptations to 3.3V, and use the 3.3V output of the Arduino Nano as the analog reference. That would allow me to keep the code and schematic changes in place.

 

Originally, I had the idea to use a generic BLE smartphone app to output and visualize data. The regular Nano does not have any BLE connectivity, so I needed to find an alternative way to present the information. I decided to go with an OLED display. I've been using the serial monitor so far, but I don't intend to always have a laptop connected to the circuit.

The SSD1306 OLED screen I had in my parts drawer connects easily via I2C (pins A4 & A5) to the Arduino. I've used the Adafruit SSD1306 library before, so this wasn't too hard to integrate with the code. After breaking the Nano33, I needed something fun to lift my spirits so I tried to get a nice logo on screen. The Adafruit Library recommends a Java based tool to convert a bitmap to the respective C code, but I couldn't get that tool to work. Luckily, I found Image2CPP, which allows to do the same thing online, and which worked wonderful. Here's the result:

image

While that logo is being displayed, the Arduino does a little bit of calibration, so no time is wasted here. It then switches to its normal interface, where it shows the current status of the connector. As it turns out, this is not easy to photograph due to the display's refresh rate, but here's a picture without the grid or a local system connected, and the setup instead being powered via USB. The Local part is connected to Vin of the Arduino, which is why we can see ~4V at Vlocal. This is below the minimum voltage for the connection unit to provide power to the grid, so the dutycycle is set to 0. The last line describes this state, as "VMin".

 

image

The current reading is not really accurate, it varies between 0.10 and -0.10A with no current flowing. This might have multiple reasons, like the dedicated power supply for the ACS712 sensor, the sensor not being sensitive enough, as it's the 20A version, not the 5A one. Also a bit of smoothing both electronically as well as in software might be a good idea here.

 

Unfortunately, other pictures of the test turned out to be hardly readable. But transferring energy between the local system and the grid seems to work, and the safety features like overcurrent protection also do their job. Some next steps will be to add a configuration interface via the display and 2-3 buttons, work out a better current sensor setup, and then create a custom PCB. But for now, this is at least in a working state image

 

The Arduino code is on Github, as well as a fritzing sketch of the schematic. I'll add an updated version in KiCad in the next few days as well.

  • Sign in to reply
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