Circuits for noobs (like me)

This is probably a part in a series where I figure out some basics of electronic circuits. I take absolutely no responsibility and I might as well be totally wrong. I try to figure stuff out and see if it makes sense to me. The I’ll hook it up to my controller and if there’s no magic smoke I might have done something right 🙂
I’m a programmer, I can write code for microcontrollers an hook some sensors up and I know that plus is minus and red is black 🙂
But when it comes down to calculating specific dimensions of components or knowing what basic component I need in a circuit to adapt to specific conditions I’m totally lost and start all over like I’m back in 7th grade.

Part 1 – Voltage dividers

Simple Problem: Voltage coming from a 6V Solar Panel needs to be measured with an ADC which has a maximum input voltage of 2.048V (to be more specific: I use an ADS1015 with GAIN_TWO – more on that later)
Continue reading

Patch for mod_apcupsd.pl

I’ve got 2 APC UPS connected to a Raspi3 and use apcupsd for getting the status data. The Raspi provides the status data via SNMP to my Zabbix installation.

For this to work I got this snmpd mod. Unfortunately this only queries the default APC via apcaccess.

I hacked together (I dunno nothing about perl) a patch to support multiple UPS.
You can find this after the break. Continue reading

Remote capturing with wireshark

I always forget these parameters so better keep ’em here.

Full Console output:

tcpdump -nnXSs 0 -i eth0 port 389

Remote cap:

ssh root@HOST tcpdump -U -s0 -i eth0 -w - 'not port 22' and port 389 | wireshark -k -i -

New kid on the block

Happy Happy Joy Joy!

The mailman brought a new display. Cheapskate I am I took the display with the most bang for the buck – at least I thought. The display here is a 0.96inch 128×64 OLED blue/yellow with 3(!) interface options: 3wire SPI, 4wire SPI and 2 I2C. And then the problems began…

I wanted I2C mode because I’m a little limited on i/o’s on the FeatherFona. The boards factory setting is 4wire SPI and for the other modes you’ll need to resolder a tiny 0 Ohm SMD resistor on the back (or just bridge the two pins). Did that and connected VCC, GND, SDA/DIN, SCL/CLK and fired up the Fona. Nothing.

Also waveshare has actually a wiki with a spec-sheet of the SSD1306, a schematic and a user manual for the module it’s of no use for people like me. They only mention 4wire mode and with not a single word that you actually have to connect 7 wires for a 2 wire I2C.
And I usually don’t have the time to go through all the specs nor the deep electrical knowledge.
So a bit of research, a bit of fiddling and long story short – the pinout:

GND - GND (obviously)
VCC - 3.3V (spec says somewhere 5V via dc/dc regulator but I'm not sure if there is one and I don't have 5V anyway)
DIN - SDA
CLK - SCL
CS  - GND
D/C - GND
RST - 5V or #4 (actually the SSD1306 spec says: keep HIGH during normal op, pull LOW for reset)

For the reset pin I’ll see what happens if I just wire this to VCC and never pull LOW. I mean: I never want to reset the display controller. I reset/power down the whole FONA which should also reinit the display controller, amirite?
So module is working and now I finally know what a blue/yellow display is. b/y doesn’t mean you can freely choose color. b/y means theres a row of yellow pixels at the top and the most part of the screen is blue. This is a kind of odd design but one could argue that you’ll often have some menu title in the top anyway.

So that’s for the display. I now have 2 options to choose from which was important for me to be more flexible with the actual design of the phone. Speaking of design I now have a fairly good idea which direction I’m going. Time for some electro etching 🙂

Besides all this I’ve got a job opportunity so I think I’ll need to get my hands dirty with some java frameworks in the next few days.