Categoriearchief: Electronics

ABB B23 Modbus RTU


Connecting to ABB B23 Modbus energymeter.

I have the USB-RS485 plugged into a Debian Linux pc system (x86_64). I used the ModPoll tool from for basic connection testing.

#./modpoll /dev/ttyUSB0 -b 9600 -p none -m rtu -a 1 -r 23296 -t 4:int -c 6
  • Offset addres 23296 (or hex 0x5B00) should have L1-N voltage.
  • Read 6 next values also (-c 6)
  • Gave me L-to-N and L-to-L voltages.

Wrote a small C application to poll every second and write to MariaDB/MySQL database table. Should be possible to recompile for Raspberry-PI (ARM) to.

Uses libmodbus(-dev) and libmariadbclient(-dev).

See attachments.



LM2576T-5 step down switching regulator

First switching power supply working.

I have an ARM board to be powered, which draws between 0.5 and 1.5 ampere’s on 5 volt. Tried using an standard 7805 (2 ampere spec), but the system would not boot. VOut dropped to 4.5 volts and 7805 was getting to hot with +/- 24 volt VIn.

So i made an circuit based on the LM2576T-5.


Part Price
IC1: LM2576T-5 € 1,60
L1: Inductor 100uH € 1,45
D1: SR504 Recoverd from PC PSU 5.0 Amps Schottky Barrier Rectifier
C1: 470uF 35v Reused from other project
C2: 3300uF 10v Also recovered from PC PSU
F1: Fuse holder and 400mA Stock, price n/a

lm2576t-5-schemaInput voltage is an battery+solar power supply that varies between 23-24 to 29 volts.

Working power supply (left) with active load.

Bad output: (spikes)
What happens if an normal (or to slow) diode is used:
Yellow is regulator V-OUT.
Blue line represents voltage output for load (feedback signal).


Good output:
No load:


100mA load



Borrowed lm2576 library for Eagle PCB Design from | LM2576 circuit

1-Wire DS18B20 Thermometer

Measuring room or object temperatures with the DS18B20. It is a digital component wich does all the work for you. You only need to COMMAND it do the measurement. A short moment later you can request 2 bytes containing the temperature.

Of course there is a protocal wich says how to communicate. See 1-Wire and the DS18B20 datasheet.

How 1-Wire works (by Maxim):

Maxim 1-Wire

Maxim 1-Wire, how to communicate

Used parts:

  • PIC16F689
    1. FLASH: 4096 Words
    2. RAM: 256 Bytes
    3. IO Pins: 18
    4. Clock internal: 8MHz internal, 4MHz default config
    5. Clock external:up to 20MHz external
  • LCD 2×16, HD44780 Compatible
  • DS18B20

Lees verder

PIC16 C Sample: 1-Wire

Environment: MPLAB X IDE + HI TECH Compiler for PIC16

#define OW_TRIS TRISA0      //Port mode register, 1=input,0=output
#define OW_PORT RA0         //Pin connected to 1-wire bus

int owReset(void)
    char state = 0;
    OW_TRIS = 0;        //Set as output
    OW_PORT = 0;        //Drive Low
    OW_TRIS = 1;        //Release, Set back as input
    state = !OW_PORT;   //If devices are present, it will keep the pin low
                        //! will invert 1=0, 0=1
    return state;       //Returns 1 if devices are present

Lees verder