Popular Post Crossy Posted April 29, 2020 Popular Post Share Posted April 29, 2020 A number of members have asked me about the gubbins that sends data for this site https://thingspeak.com/channels/991448 So here we are ???? Spare time boredom and disillusionment with the monitoring software provided with my solar inverters led to this project. Features:- Reads RS-485 (modbus) enabled energy meters. Internet of Things connection. Real Time Clock with NTP sync. = always correct. Local data storage on SD card (as .CSV file, analyse later with Excel or similar). Hardware watchdog - resets the processor if there's a lockup. It displays:- Date and time (doesn't everything). Grid Voltage and Power Factor. Grid and Solar supply current. Grid power consumption. Solar Power Generation. Grid and Solar energy for the day. Grid and Solar energy for the month. Grid and Solar energy totals. It looks like this:- And with the lid off like this:- More detail shortly. 4 5 Link to comment Share on other sites More sharing options...
NCC1701A Posted April 29, 2020 Share Posted April 29, 2020 (edited) 13 minutes ago, Crossy said: More detail shortly. i love that. where do you order your parts from? Edited April 29, 2020 by NCC1701A Link to comment Share on other sites More sharing options...
Crossy Posted April 29, 2020 Author Share Posted April 29, 2020 14 minutes ago, NCC1701A said: i love that. where do you order your parts from? All will be revealed in due course, but the bits all came from AliExpress ???? Links to the actual parts used will be provided as we progress. Link to comment Share on other sites More sharing options...
Popular Post Crossy Posted April 29, 2020 Author Popular Post Share Posted April 29, 2020 For those who just want to get on with it. Single line diagram:- Arduino sketch Solar_Log__V4.0a.ino You can view the sketch using any Unix-aware text editor, I use Notepad++ or you can, of course, use the Arduino IDE. EDIT Windows Notepad also seems happy to view the .ino files without screwing up the formatting. 3 Link to comment Share on other sites More sharing options...
Popular Post Crossy Posted April 29, 2020 Author Popular Post Share Posted April 29, 2020 The main display:- Solar and grid daily and monthly display:- And the cumulative display:- 3 Link to comment Share on other sites More sharing options...
tao40 Posted April 30, 2020 Share Posted April 30, 2020 My, but aren't we the evil genius, LOL! But seriously, great work!! ???? 1 Link to comment Share on other sites More sharing options...
Popular Post Crossy Posted April 30, 2020 Author Popular Post Share Posted April 30, 2020 21 minutes ago, tao40 said: My, but aren't we the evil genius, LOL! But seriously, great work!! ???? The devil makes work ... I have to keep my engineering brain active, I do way too much paper pushing these days. I'm lucky that I do still get to get out on site to wave blueprints around "What you've built doesn't look anything like the drawing!" the usual fix being to "adjust" the drawings. Anyone reading my code will rapidly realise I'm not a software engineer, I'm a hardware man from the days when electronics had lots of glass things with heaters and connections that bit if you touched them. All good fun of course. 3 Link to comment Share on other sites More sharing options...
Crossy Posted April 30, 2020 Author Share Posted April 30, 2020 OK Time for a spot of shopping. You will need:- Arduino MEGA2560 https://www.aliexpress.com/item/33061242752.html It may be possible to fit the software into an Uno but you'll need to use SoftwareSerial to provide serial ports and the RAM is very limited (fun things happen when the RAM becomes full). TTL to RS485 converter https://www.aliexpress.com/item/32977187783.html get the one with automatic flow-control, easier software. ESP8266 WiFi serial transceiver https://www.aliexpress.com/item/33000086175.html an amazing bit of kit for $3, handles all the hard work of connecting to Wifi and the internet. The cheap units all have only 8Mb of flash so you're limited to the older firmware versions (which you will have to install yourself, it's easy once you know how). I have working firmware and the flashing software (use your Arduino as a USB-TTL converter) if anybody wants them PM me. I got the external antenna too, didn't really need it. 20 character x 4 line LCD display with an I2C interface board https://www.aliexpress.com/item/777032831.html Data Logger Shield with Real Time Clock and SD card interface https://www.aliexpress.com/item/1467034213.html the one I had in stock is really intended for the Uno so needs a couple of wiring adjustments. If you can get the later version with the additional 6-pin connector it should just plug and play. 100A RS-484 enabled energy meter (you need two) https://www.aliexpress.com/item/32919001382.html I actually got 1 x 100A and 1 x 65A (for the solar input) as it was slightly cheaper. You will need to change the RS485 addresses by talking to the units over the RS485/MODBUS useful information here https://gist.github.com/alphp/95e1efe916c0dd6df7156f43dd521d53 7.5V to 5V 2A switching regulator https://www.aliexpress.com/item/4000084041472.html The Arduino on-board regulator can't handle all the additional 5V load. Hardware Watchdog board I built my own (described later) but you could use the one from RobotShop https://www.robotshop.com/jp/en/watchdog-timer-module.html 7.5V 2A mains adaptor I got one from NPE in Zeer. A box to put it in mine came from MegaHome. 1 1 Link to comment Share on other sites More sharing options...
Muhendis Posted April 30, 2020 Share Posted April 30, 2020 Looks like fun. Only wish I had the time............ Link to comment Share on other sites More sharing options...
bluejets Posted April 30, 2020 Share Posted April 30, 2020 (edited) 1 hour ago, Crossy said: Anyone reading my code will rapidly realise I'm not a software engineer, I'm a hardware man from the days when electronics had lots of glass things with heaters and connections that bit if you touched them. All good fun of course. Good job Crossy. Similar approach as to my attempts. If anything good comes from this virus thing, it's the ability to get some stalled projects out of the way. This is just one that might be of interest to you. Cheers Jorgo http://mode-zero.uk/viewtopic.php?f=81&t=970 Will be interested to see your code, always open for new ideas. Edited April 30, 2020 by bluejets 2 Link to comment Share on other sites More sharing options...
AgMech Cowboy Posted April 30, 2020 Share Posted April 30, 2020 2 hours ago, Crossy said: that bit if you touched them. I remember those days and I'm not even a 'sparky'. I just tied to fix things on my own... ???? But this type project is way above my pay grade. Link to comment Share on other sites More sharing options...
Crossy Posted April 30, 2020 Author Share Posted April 30, 2020 The two meters are installed in a cheap DIN rail consumer unit. The 2-pole breaker is the feed from the solar. The single pole breaker is currently unused, intention is to do away with the wired RS485/MODBUS connection so any electronics will need a power supply. Meanwhile, this chap (follow the blue arrow) is an ant who managed to get between the LCD backlight and the active element before dying. Interesting parallax effect which you don't normally see. 1 Link to comment Share on other sites More sharing options...
Metropolitian Posted April 30, 2020 Share Posted April 30, 2020 Great thread and will hop on there with my projects, or a separate parallel thread from Metro Labs ???? very soon. No time at the moment, FIL has passed away yesterday and I'm as the 'son' with him full time those days with the funeral which will be four days long. Keep it going Crossy, it is truly food for my eyes to see/read ! My era is when both glass and silicon was used 50/50 and things got a bit safer to tough Link to comment Share on other sites More sharing options...
Crossy Posted April 30, 2020 Author Share Posted April 30, 2020 8 hours ago, Metropolitian said: My era is when both glass and silicon was used 50/50 and things got a bit safer to tough Ah, the "hybrid". Often much explosive fun to be had. A certain, all bottles, RN sonar had a sensitivity modification consisting of a 741 with the associated salad-dressing running off a split +-15V rail. What wasn't immediately obvious was that the supply was actually +220V, +235V (marked on the board as 0V) and +250V. Woe betide any innocent tech who placed a grounded scope probe on "0V". The resulting conversion of a 741 into 8 legs sticking out of the board and a slightly blackened area was, shall we say, "sphincter loosening". Ask me how I know Metro Labs projects welcome, probably best on their own thread. If there's sufficient interest maybe a sub forum "Micro Controllers" or something like, but then I'd have to moderate it. Sorry about your FIL ???? Link to comment Share on other sites More sharing options...
Crossy Posted April 30, 2020 Author Share Posted April 30, 2020 I'm not going to do a blow-by-blow "stick a wire in this hole" account, I'm far too lazy. I'll just detail the pitfalls I found so hopefully others won't fall in. For example:- As noted above the Arduino on-board regulator won't actually power much in the way of add-ons. Another project with just an Uno, 20x4 LCD and esp8266 is about the limit. On a 7.5V supply the Arduino regulator is just touchable. The TTL-RS485 board I used has on-board surge protection on the RS485 terminals. But in order for it to work adequately the RS485 ground terminal must actually be grounded. I place a wire on the back of the board to the supply 0V. It's also worth noting that the 8-pin device is a MAX485 https://www.aliexpress.com/item/33023152548.html 2 bucks for 20 inc shipping. Easy enough to swap out with a small iron and a steady hand, or get your local phone or computer repair chap to do it. The other device is a 74HC14 https://www.aliexpress.com/item/32557582115.html again 2 bucks for 20 and doesn't blow up with a surge on the 485 lines. I have 20 if anyone needs a couple ???? Link to comment Share on other sites More sharing options...
Crossy Posted May 1, 2020 Author Share Posted May 1, 2020 Now, about that watchdog. I noted that occasionally coms with ThingSpeak would fail and stay failed until I hit reset. It's not clear exactly why but I needed a quick fix. Enter the watchdog. The Arduino does have a built-in watchdog which I've used on the Uno with good results, but Google told me that the MEGA can sometimes brick when using the watchdog. So I didn't. There are all sorts of watchdog timers on the net, invariably based on the 555 timer, but all that I looked at have flaws. So I took the best of all of them and came up with this:- All the bits were hanging around, built on a scrap bit of stripboard (do we still call it "Veroboard"?). If the keepalive pulses stop it takes about 10 minutes to generate a reset pulse. How it Works. The 555 is configured as an astable multivibrator which, if left to it's own devices, produces a 700ms negative pulse on pin 3 every 190 seconds or so. When working as a watchdog positive pulses of 1ms or so are fed from a digital output of the Arduino. These will briefly turn on the NPN and keep the timing capacitor from charging. So not output pulse and no reset. If the pulses stop the capacitor can then charge and when it reaches 2/3 of the supply voltage an output pulse occurs and resents the Arduino. This takes about 400 seconds. Handy calculator here https://circuitdigest.com/calculators/555-timer-astable-circuit-calculator On guard and ready to attack! 1 Link to comment Share on other sites More sharing options...
Metropolitian Posted May 14, 2020 Share Posted May 14, 2020 Some fundamental setups here is getting up nice. Before hooking up sensors I decide to have the Mothership prepared first, all the data need to go back to the womb. Also I am aiming onto " An Intranet Internet Enabled Solar Power Monitoring System" ???? The cloud is something nice, but oh when the power cuts I suddenly couldn't access the (cloud-based)meters and sensors. The womb is currently in HASS (Home Assistant) which looks nice, but not all meters are supported so was mine (Cloud storage at Hekr). A few http sniffing involved I got the right data for the 'offline' access and found some modules in github for hass. Now, beside the data going to the cloud services I have Mother probing the data each 15 seconds and it looks surprising good. Running 12K Aircon, TV, Fans and lights. For monitoring the solar, I am thinking to remove the wifi module and use the modbus data (wifi module is plugged in that). With the same module as in post #15 that should do the trick. Have to test it on another source first so not disturbing the inverter. Until, as I like the cloud service, I am able to integrate it. Need to find a way to use the intercepted data from the inverter to the cloud (Senergy) , no resources on the web right now and I am not a coder.. 1 1 Link to comment Share on other sites More sharing options...
Metropolitian Posted May 14, 2020 Share Posted May 14, 2020 On 4/30/2020 at 9:32 AM, bluejets said: Crossy. This is just one that might be of interest to you. Well.. It interested me ???? I am missing the gear position indicator on my bike. Sometimes I try to get it in the next gear but there isn't a sixth as it was in the fifth and not fourth. The same the other way around, from the third to the second approaching speed bumps.. but it was in the fourth and after the bump I stood still.. 555 Only have a green light for neutral. Your project looks great for aiding in this when I can get a sensor at the gear clutch working and put the numbering inside the oled screen. Have you done that already? 1 Link to comment Share on other sites More sharing options...
tjo o tjim Posted May 15, 2020 Share Posted May 15, 2020 @Crossy could you have done everything on an ESP32 rather than the Uno and ESP8266? Neat little boards, planning on doing a BLE logger for presence detection one of these days... Link to comment Share on other sites More sharing options...
Crossy Posted December 6, 2020 Author Share Posted December 6, 2020 On 5/15/2020 at 12:46 PM, tjo o tjim said: @Crossy could you have done everything on an ESP32 rather than the Uno and ESP8266? Neat little boards, planning on doing a BLE logger for presence detection one of these days... For some reason I missed this post only noticed when I came looking for the thread ???? Yes, hindsight being 20-20 even the ESP8266 could do the job on it's own. This was my first foray into IoT stuff and I would do a lot of things differently if I were to do it all again. Link to comment Share on other sites More sharing options...
Golden Triangle Posted December 7, 2020 Share Posted December 7, 2020 On 4/30/2020 at 7:19 AM, tao40 said: My, but aren't we the evil genius, LOL! But seriously, great work!! ???? It's a freakin laser ???????????????????? Link to comment Share on other sites More sharing options...
Crossy Posted December 7, 2020 Author Share Posted December 7, 2020 50 minutes ago, Golden Triangle said: It's a freakin laser ???????????????????? 1 Link to comment Share on other sites More sharing options...
Daffy D Posted December 7, 2020 Share Posted December 7, 2020 (edited) Another interesting project but as someone already mentioned way above my paygrade. A tip that may be useful to some, for the low voltage wiring I use old single core phone wire. With everyone going Fiber there is lots of it about. Edited December 7, 2020 by Daffy D Link to comment Share on other sites More sharing options...
mwbrown Posted December 7, 2020 Share Posted December 7, 2020 (edited) Very cool way to measure your solar and grid via the 485 meters with the hardware display! I went another way on mine, a Sonoff / Tasmota Wifi-enabled meter on both modules with Enphase microinverters, data uploads to my server in Singapore over MQTT + NodeRed. My web page pulls the data from the server and formats nice gauges and charts. I recently found a limitation in the Google chart I use, it silently non-displays columns after it reaches an arbitrary undocumented limit. :^( Thanks as usual Google! You can see everything here: http://mike-land.com/Solar_Hua_Hin/solar_hua_hin.html Edited December 7, 2020 by mwbrown More detail 2 Link to comment Share on other sites More sharing options...
CanadaSam Posted December 7, 2020 Share Posted December 7, 2020 (edited) This is brilliant! Crossy, perhaps you could take the time to teach some of us the basic of electronics, because we have too much time during covid, and I for one, would be very interested to learn! Edited December 7, 2020 by CanadaSam Grammer. 1 Link to comment Share on other sites More sharing options...
Crossy Posted December 7, 2020 Author Share Posted December 7, 2020 5 hours ago, mwbrown said: Very cool way to measure your solar and grid via the 485 meters with the hardware display! I went another way on mine, a Sonoff / Tasmota Wifi-enabled meter on both modules with Enphase microinverters, data uploads to my server in Singapore over MQTT + NodeRed. My web page pulls the data from the server and formats nice gauges and charts. I recently found a limitation in the Google chart I use, it silently non-displays columns after it reaches an arbitrary undocumented limit. :^( Thanks as usual Google! You can see everything here: http://mike-land.com/Solar_Hua_Hin/solar_hua_hin.html It's funny how these things develop, it was never really intended to be internet connected, more as a development of my previous power monitor logging to the SD card. That unit worked well enough (and is still working) but the maths does some interesting things when exporting which in all honesty I couldn't be bothered trying to fix when cheap all singing, all dancing meters are available. The Uno also ran out of computing power and RAM when trying to measure more than one channel. The WiFi and IoT angle came about when I was trying to implement an automatic dummy load to dump excess power and avoid exporting. The dummy load now sits folornly in the corner of my workshop waiting to be converted into a battery management system having been ousted by the arrival of an inverter with a "do not export" function (see the Solar Car Port thread). Evolution in action and much more interesting (at least to me) than watching fruit flies (the usual model used for studying evolution). 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now