1 of 13

Raspberry Pi Application

By Chris Clement - KA4UPC

2 of 13

Web-enabling a useful legacy computer application

➲ Original package pic2.jpg

➲ In the 90s I developed 16-circuit energy monitor "microMeter" (mM) with CT's, PT's and a serial data stream.

➲ Like many industrial applications, a small amount of data must be collected reliably.

➲ It is a timeless need and works well today. Simple and loosely coupled.

3 of 13

Long-term goal

➲ Keep s/w current and simple.

➲ Move past desktop “fat client” s/w.

➲ capture serial data from DOS to Windows 10, Linux, Mac - read 17 bursts and toss 1st, index the rest by channel#

➲ add timestamp and append counter values to flat file or table rows

➲ subtract any two rows and calc demand, usage, cost, %, power factor, etc.

4 of 13

The Present Situation

➲ Home report 2-combo

➲ Store report 3-phase

➲ Web-enabling attempts: (Continuously stream the data into a cloud file)

➲ Dallas Semiconductor TINI – quirky, multithreaded early Java

➲ Rabbit 3720 - very reliable but expensive

➲ Raspberry Pi - somewhat reliable and cheap

5 of 13

Development up to present

➲ Pull model vs push model.

➲ Main concern was maintaining modern, supported serial data pathways as desktop interfaces changed or disappeared.

➲ Raspberry Pi is a good building block but even it has been changed disruptively to serial communications.

➲ Support X-10 and similar controls.

6 of 13

Potential Alternatives

➲ Serial to Ethernet adapter

➲ Raspberry Pi 3 - need to get serial ports working reliably.

➲ Arduino – small memory constraints.

➲ Another hobby microP with the same c socket code.

➲ Beaglebone Black! 5/26/2023

7 of 13

Recommendation

● "web-service" php to stuff the data argument into a table

●connect(mysocket, (struct sockaddr *)&dest, sizeof(struct sockaddr));

reports Selection panel

my Air BNB older Type 1. No pf but still supported.

my house in Ozona newer Type 2.

8 of 13

My RP Serial Level Hack

➲ Data from mM is traditional RS232 +/- 12v.

➲ mM txd goes to LED anode.

➲ LED cathode goes to NPN base (2N2222).

➲ NPN emitter goes to common ground.

➲ NPN collector goes to RP rxd.

➲ Optocoupler 4N37 can be used instead of NPN for ESD ground isolation.

9 of 13

My RP3 Video Hack

➲ The RCA composite video jack was dropped and was only available in the 3mm jack with a weird flip of ring and sleeve.

➲ I use the RCA male barely pushed in with a jumper from coax shield to ground.

➲ No need for expensive adapter cable.

10 of 13

Pic

11 of 13

PF fixed for pool 05/22/2023

12 of 13

Even better optical coupling

White LED facing jameco 1108144 photo trans tept5600

13 of 13

micrometer2001.com