DIY VOLTAGE DIVIDER

#56 DIY VOLTAGE DIVIDER

In order to measure the voltage of a DC battery we will need a voltage divider sensor. I built an easy DIY voltage divider which works quite well. All we need are two resistors to measure the voltage in a certain way so our Arduino doesn’t fry.

After working out my requirements for a 12v 7Ah battery I came to the conclusion that I needed a 30k and a 7.5k resistor. This will allow me to measure DC voltage from 0.025v to 25v.

I built 2 sensors
Top of the board

I only had to break the connection on the trace where the screw terminal was soldered to.

After creating a simple Arduino sketch I was able to output the data to the serial monitor. I had to add the correction factor of -0.150 to get an accurate reading after checking with two multimeters.

voltage read sketch
Serial monitor display

I used the Arduino pro mini as the MCU of this project.

TUYA SMART API

#55 TUYA API EXAMPLE USE

Tuya Smart is a China-based IoT provider. Tuya Smart provides all kinds of smart home gadgets and gizmos. A cloud support plat form exists as well as an app for Android and an app for IOS.

Here I have an example of the cloud API which can be queried from any device that has internet. The variables are passed as headers in each request.

PHP EXAMPLE:

cURL PHP query example

JavaScript jQuery EXAMPLE:

jQuery example query using headers.

C# WINDOWS FORMS EMAIL

#54 C# WINDOWS FORMS EMAIL TEST

Form C# Email Example

A simple C# WinForms desktop application to send a text email/send an attachment email.

This application uses no special class. The default mail classes are used namely:

using System.Net.Mail;

using System.Net.Mime;

The email text is sent in HTML format:

var mailMessage = new MailMessage{                     From = new MailAddress(Vars._mailFrom),//email            Subject = "C# WinForms Test Mail",                     Body = "<h1>Hello</h1>" + "<h2>C# WinForms Test Mail</h2>",                     IsBodyHtml = true,};

EZVIZ RTSP STREAM

#53 EZVIZ LAN RTSP STREAM

EZVIZ offers a Real Time Streaming Protocol ( RTSP ) option as well as their desktop and mobile applications. Video can be streamed using any software that allows RTSP streaming ( for example VLC Player ).

The network URL looks like this:

rtsp://admin:verification code@camera LAN IP:554/H.264

Example: rtsp://admin:123456@10.0.0.15:554/H.264

In VLC Player choose Media > Stream
Next choose Network and fill in the URL then click on Play.
Example screens. Note that there is no sound.

ESKOM’s LOAD SHEDDING API

#52 LOADSHEDDING API

Eskom has a load shedding (Rolling blackouts) API we can utilize. I still need to test the accuracy of the results as well as the functionality of the API.

The good news is that unlike Eskom’s electricity supply this API is always on and actually works (with HTTPS as well)

It looks like Eskom’s software team can do a half decent job. I realize that it’s a bit unfair to give them so much grief. The real issue here is corrupt officials in high places stealing from the people as much as they can before their clocks expire.

There is no excuse… the reality is that we are stuck between a rock and a hard place. I can only hope that the future generations are able to see it for what it is and focus on building South Africa instead of destroying and stealing what others are so desperately trying to improve…

One thing is for sure.. at this rate we are truly moving in the direction of retardation (backwards motion) there’s no middle ground or some type of constant speed things are literally degrading. It’s honestly terrifying to witness this as a youngster.

At least we are not a war torn country like many in the middle east so perhaps I can give credence to the South African police and intelligence agency’s no matter how corrupt they have become they have not stooped to the level of warmongers just yet… (I suppose elite gangsters and mobsters would be a better suited description at this time)

Below is an example of the API I have rewritten in markdown format. A simple four step process to get some usable data.

  1. Get Status
  2. Get Municipalities
  3. Get Surburb Data
  4. Get ScheduleM

    Checkout my practical example application on GitHub
    You can also find more info on my GitHub documentation and my tutorial article of the practical example.