When getting into the new ATtiny series (tinyAVR-0 tinyAVR-1 tinyAVR-2 IC’s) of microcontrollers a few years ago I noticed how easy it had become to program them with only a few extra components.
I started out with just a 4.7k resistor and a cheap CH340 programmer. Then 3 wire hook-ups later I could easily program my IC’s. The only downside was that I had to sacrifice the UPDI pin to the dedicated Pin gods.. so I couldn’t use that pin unless I wanted to make my life more difficult.
Well this was okey for me and ever since I always have the UPDI pin open only for programming. So all my designs incorporate this principal. If I really need more pins I would use an affordable IO expander IC.
Now with that being said it’s all good and well programming with a mini rats nest… but I wanted to create a simple plug and play DIY programmer with commonly available parts and plug and play compatibility.
So I came up with a small circuit that’s easy to build on stripboard. I created a few versions over the years. Since I was the only one using this contraption I didn’t think of creating a professionally made PCB but that will come in future..
Front of the stripboard
Back of the stripboard
How do I use this?
Basically I solder the SMD package ATtiny to a suitable breakout PCB then I plug the ATtiny breakout PCB into my programmers female headers making sure the orientation is correct and presto all I need to do is upload my firmware. Then I can just remove the PCB and Plug it into my project
Simple and to the point… plus it’s been working for years.
When taking a closer look at the DIY aspect of lora I wanted to test LoRa peer to peer.. E.G multiple peers to one peer (NOT LoRa WAN) I noticed that the actual radio PCB is difficult to use when going the traditional through hole way… adapter boards do exist but are few and far between at least in SA. you can make your own for manufacture but then rather create your entire product PCB for manufacture.
Even with this drawback I was able to source old adapters for one of the very firs modules the: RFM95W. In South Africa we are mostly using 868Mhz although 433Mhz modules are around I don’t see them being super common in terms of LoRa modules.
The modules I used have a footprint for adding a female SMA connecter for easy antenna connecting.
Parts used:
2x RFM95W 868Mhz LoRa module transceiver
2x 3.3v active buzzer
2x 1 pole dip switch
2x TP4056 module with protection ICs
2x ATtiny404 MCU
2x NCV8163 3.3V LDO
2x SSD1306 128×32 OLED
2x 2pin 2.5mm JST battery connector
2x Headers and jumpers
2x 13400 3.7V 550mAh
2x 10k resistors
2x 220R resistors
2x SOIC to DIP adapter PCB
2x BC547 transistors
Some 0.9mm tin plated copper wire
Some 0.255mm PVC insulated wire
Soldering made slightly easier…
After checking the PCB I commenced with testing the devices. Unfortunately the test area has largely mountains terrain the signal works really well and penetrates better through foliage on the mountains terrain but once there is a full on mountain in the way the signal stops. so in this retrospect the devices are better then a radio which was quite interesting but makes sense because data is being sent and uses less bandwidth then interpreting voice audio. Also the error checking for LoRa helps a lot.
Some more pros for the LoRa is that its a transceiver out of the box with RSSI functions included. Also for increased range and/or quality the spreading factor and signal bandwidth can be adjusted.
Although there’s many pros regarding LoRa I still tend to use simple 433.92 RF modules without issue at least in my situation with rural areas under about 3KM at and given point.
So it really becomes more of a cost factor than anything else. Although I’m happy selling a custom LoRa product for compatibility with LoRa WAN or some other requirement with a similar principal. Plain old generic RF is still cool in my book.
Inside the module I noticed the relay has no cover on it and a resistor and MOV were kind of in the way of the relay terminals…
Recently I had a Waco day night switch start to show faulty signs. Namely once dusk came the relay in the device would oscillate very fast for a few seconds effectively switching the light on/off very fast making a racket while stressing the LEDs out.
The relay would finally settle… mostly on the ON setting but sometimes it would settle on the OFF position. Then if you slightly bang the relay it would oscillate and settle on the ON position.
So I removed the switch and notices there was a lot of spider webs and critters close to the external AC connections. I cleaned the outer case and also notices a brown burn mark where the relay was located. This was due to sparks from the constant ON/OFF switching since the relay in this module had no cover.
The PCB was covered in a white powdery substance.
Now technically I did not have to open the module but I wanted to see if anything else was damaged. I opened the module and everything looked good except for the relay contacts which looked a bit beat up but were working ok..
I noticed that a resistor and a varistor were very close to the relay and could technically jam it’s opening/closing capability so I moved then away from the contacts and put everything back together again.
I now tested the module again and voila there is no more oscillations. So the grimy critters on top of the AC leads and the resister MOV combo close to the relay contacts were the likely culprits however my money is on the latter. So on re-installing I added extra tape and some silicon to seal the AC terminal blocks completely. A thin layer of silicone can still easily be removed for further maintenance and/or repair.
Testing the module to make sure the relay is getting the correct voltage etc.
The old meter has been through various toolbox banging battles..
Guts of the old multimeter. Very crusty with lots of through hole components and electrolytic capacitors. I replaced a damaged button as well as adjusting the voltage.
I have had the Major Tech MTD84 multimeter for 11 years now. Before I went off to another city far away for my first job my father purchased it for me as a parting gift. It was a low to mid range meter at that time and seems to be currently discontinued.
Now my meter is beat up but it reads just fine for the may DC projects I make however the voltage started to drift and has slowly become less accurate.
Luckily there is a few variable potentiometers on the PCB which can be adjusted to bring the accuracy back up to spec again. They allow for the DC, AC and Temp values to be adjusted no current option from what I could see. Even though I have a few multimeters I still can’t seem to throw this old one away…
Adjustable pots found on the back for easy access. Though they are very crusty…
So in order to set the correct voltage I had to connect a known working accurate multimeter to a battery along with the faulty one. For this I used the aneng8009 which has very good current and voltage accuracy for a cheapie.. Know I slowly adjusted the voltage variable potentiometer until the volts were mostly the same on each meter. (even though the MTD84 only has 2 decimal places it’s still close enough)
Very cool now the old multimeter is not so bad anymore with all it’s through hole resistors and electrolytic capacitors… perhaps next time I’ll have to replace a dry capacitor.
Since I have been using the ATtiny series of IC from microchip using the AVR instruction set I kept an eye out for similar chips.
After a few google searches I found 2 potential competitors:
Puya with their PY32F003F14P6T 32 Bit MCU 32bit ARM ® Cortex ® -M0+ Microcontroller Integrated Circuit
and
WCH (WinChipHead) with their CH32V003F4P6 series based on the 32-bit QingKe RISC-V2A core.
After some research I decided to purchase some of the WCH IC’s for testing. I setup a platform IO development environment and starter using the ch32v003fun open source software development stack for the CH32V003.
CH32V003J4M6
CH32V003A4M6
There is an Arduino core from the official WCH guys but it is still limited and slow for power users.
Once I finished setting up I found it very easy and intuitive to use the ch32v003fun development stack. There is a learning curve but I was able to test all my WCH chips within minutes. I purchased the CH32V003J4M64-pin, CH32V003A4M616-pin, CH32V003F4P620-pin, CH32V203C8T648-pin and the QFN20 CH32V003F4U620-pin.
Measuring micro amps (I am not affiliated with Jacobs coffee)
While I was looking for a great value for money multimeter I came across the ZOYI ZT109 (Aneng 8009 clone??)
This multimeter is identical to the Aneng 8009 and is in many ways far superior than the older Aneng 8002 and 8008 models. I highly recommend it.
The biggest downside is the miniscule fuses but I was able to solder a standards 50x20mm fuse in a somewhat hacky way…
Also the CAT ratings are super dodgy but good enough for low voltage electronics.
My requirements were:
measure µA
auto volt measure
small no of turns
palm sized
large display + light
decent price
easy battery replacement
accurate
I can say that this multimeter checked all the boxes but there are some issues… firstly the tiny fuses are painful… I could find some replacements at DIY electronics. However once stock is finished the 3mmx5mm fuse market looks drier then a dead dingo’s donger what an epic fail.
10A fuse soldered diagonally.
Now I know soldering and hacking a different fuse is possible see my image… still it’s a royal pain in the place that’s darker then a coal miners rectum. There’s so much space for a 5mmx20mm fuse. Just why whoever added this tiny fuse must have been a real poepoltjie eh..
Another issue is true RMS but meh I don’t need it that much.
So in conclusion this multimeter is a great compact companion for any low DC voltage electronics hobbyist. I have had mine for a little over 2 years and love it.
FS1000A module at 5v no attenuator just using antenna.
Recently I have been using wireless technologies for a few projects.
While looking for a balance between price, functionality and disposability I decided to focus on the 433Mhz RF modules.
These use a free spectrum and have been around for a long time. There’s is a few different types and kinds, with LORA being kind of new and better in almost every way but this comes at a high price compared with the standard 433 RF modules.
So I purchased a few receivers and transmitters from electronics suppliers located in South Africa.
All my tests consisted of running the 4 receivers at 5v and a single 17.3cm straight LAN cable strand as an antenna. The signal sent was a 23bit ASK signal with a pulse length of 1200ms.
All 3 transmitters were tested at 3.3v with a single 17.3cm straight LAN cable strand as an antenna.
The transmitters testes were the FS1000A, CYT1 and the WL102-341.
The crude module actually has more power and range at 5V but I am using them at 3.3v for super low power applications so In this case the module loses.
The Tests were done on farm land.
All transmitters could trigger the receivers at 400m line of sight but only a few could penetrate foliage and a galvanised steel shed.
I only needed MAX 400m which is why I stopped there but some sources claim up to 600m – 800m + for these superheterodyne modules. Not as good as LoRa but for the price what reason do I need not to use them?
*Sidenote Using RF or LoRa in conjunction with a 2.4G Wifi module like the ESP32 or even 3G/4G modules can create multi dimensional divers systems. where we are leveraging the long range and penetration + power output of 433Mhz and 868Mhz but also allowing packets of data to connect over the internet to be stored on a server for data analysis and the creation of graphs to make the data more visually appealing.
Currently I do have some pilot devices and hope to one day make some good quality sensors in 3 different tiers:
Cheap and disposable sensors
Affordable long term sensors
High end sensors
These will be focused on use within rural outdoor areas and I will have a version with Gerber files and schematics etc. available for anyone to download and make for themselves. However the more refined version with a nice enclosure and style will be sold commercially since I do want to be paid for my work.
Back to the modules..
The transmitters that support 5v could penetrate a little better sometimes.
The position of the transmitter/receiver could also greatly affect the received signal especially at range.
Also during summer and during rain the signal was worse with the foliage and water most likely absorbing and/or reflecting the signal
All receivers were superheterodyne with a crystal and I did not use any counterpoise though it would help in some circumstances it makes the receiver unpractical and large.
From worst to best
Some people may wonder why I am using these modules instead of the fashionable LoRa modules. This is simply due to cost and availability.
Designing a good circuit cost time and money. Inserting said circuit into an extremely hostile environment like for example.. rural South Africa is an even more costly exercise…
I have had devices damaged by the sun, damaged by water, damaged by ants, damaged by cows, damaged by some kind of rabid animal (assuming jackal) The list goes on.
AND I have not even mentioned the human element… devices damaged by criminals some even STOLEN… for what? You telling me that criminal is sitting in the bush conspiring to reverse engineer my simple circuit and RF protocol and some how will be able to defeat Microchips code protection? I highly doubt it but it is possible…
So now I hope you can understand why these cheap modules do work and are very useful + inexpensive for my purposes.
I also have LoRa versions but for now I only use those when distance and extreme sensitivity is needed.
Delay_IP5306_Heartbeat_Led=Delay_IP5306_Heartbeat=millis();//set to current millis at start
PORTA.OUTCLR=IP5306_HEARTBEAT_PIN;//write low, do this after setting output and pullup
}
voidIP5306_Heartbeat()
{
/*
# If button is pushed longer than 30ms but shorter than 2s, IP5306 will identify the action as short push. Short push will open SOC indicator LEDs and step-up converter
# If button is pushed longer than 2s, IP5306 will identify the action as long push. Long push will close step-up convertor, SOC indicator LED and flashlight LED.
# If button is pushed shorter than 30ms, IP5306 will ignore the action.
# If two short push is detected within 1s, IP5306 will open or close flashlight LED
Over the past 4 years I have been purchasing an all in one LiPo charge, protect and step up module for my LiPo battery projects.
This module has worked quite well but I have noticed some fake modules starting to creep in the market again…
Now I can live with fake chips that work close to spec.. but in this case the IC would power on once.. and then die completely.
The Module uses the IP5306 all in one power bank IC. There is a version which uses the MH-CD42 IC but I have always received a module containing the IP5306.
Therefore I will focus on this IC.
The module charges via 5v and steps up a non protected 3.7V battery to 5v, it also offers protection to the battery.
Over current protection (OCP), over-voltage protection (OVP) short circuit protection (SCP) and over temperature protection (OTP)
2.1A of current can be supplied which is a great reservoir for DIY projects and sometimes even an overkill.
After stating the most attractive traits above you can see why this module is much loved.
Fake on the left with a few distinctions on the IC.
Unfortunately once a module becomes extremely successful fakes start appearing out of the wood work trying to steal some glory.
And as usual the consumer suffers the brunt of the con job..
Thankfully in my case I only came across 2 modules that were fake and I was able to alert my local supplier.
Hopefully they will do something about it… and in case anyone has a similar issue I will do a small breakdown of the tattle tail signs these con boards display.
So you too will be able to identify and maybe save yourself some annoyance and time but most importantly save yourself some money.
Now I was able to compare 2 modules.
The fake has external circuitry which works and is laid out the same way as the original.
The fake IP5306 IC is the culprit here.
Soldering an original to the fake module actually can bring the module back to life again!
So if you are able to get a few working IP5306 chips you may be able to get your modules working again.
The tattle tail singes are:
Fake: text on PCB is faded
Fake: text on inductor is faded
Fake: text on IC looks elongated
Fake: text on IC is also slightly faded
Fake: The pin one identification is a small circular flat indent (original has a smaller concave ident like a ball)
Fake: the Infineon logo is close to the centre left of the IC and the thickness of the logo is very thin (original has a thick logo and is located upper left on the IC)
Fake: the inductor is completely flat (original has an ident all around the edge of the inductor)
The face capacitors, resistors, LED’s, button and inductor seem to be the correct values but I cannot speak to the quality of them
My theory is that the chip has a dye which is far inferior to that of the original and thus it failed.
#106 AJ-SR04M ultrasonic distance sensor for water
looks like a STM8S003F3 MCU, unmarked crystal and unmarked TTL IC
Underside has a 2 pin socket and is quite dirty…
Recently I have had an old mildly annoying problem snowball into a new serious problem…
Every few months the clean water supply from uThukela Water (Pty) Ltd has been switched off for multiple reasons… striking, damaged electric motors due to Eskom, sabotage and other issues to name a few very serious reasons.
So two large 2500L water tanks were installed in series as a backup which worked well for small water issues that would last maybe a week or two.
However recently There has been no water from uThukela for over a month, and this is very serious.
This event triggered me to investigate water related problems and solutions specifically for my use case.
Order of importance:
I need readily available clean drinking water
Store this water for longer (get extra tanks)
Keep water safely in the tank (no contaminates)
Add sensors to monitor (water level sensor in this case)
For this article will be focusing on the 4th order of importance since this is a tutorial website mainly about electronics.
Therefore I will start by saying I searched for a suitable water level sensor and came across the JSN-SR04T and clones.
This sensor looks very promising and easy to use with 6 available sensor modes (adding increased diversity).
N.B the copy does not have 6 extra modes which was disappointing considering their price point…
2.2m wire with the sensor at the end.
The copy has 3 modes and is similar to the JSN-SR04T-2.0
Now my goal is to use the JSN-SR04T with an ESP8266 connected via WiFi to send readings to my server every 30s, this unit will be completely powered by solar.
The ESP8266 will also have a LAN dashboard to view the readings in real time connected to WiFi but with a connection to the internet not needed, just in case the internet goes down I can still read the water level values.
unfortunately finding a commonly available original JSN-SR04T Ultrasonic Distance Sensor has been quite difficult in South Africa.
I have only been able to find the AJ-SR04M (functions like the JSN-SR04T-2.0) which is a clone but works just like the original, however I see the price is equivalent and sometimes even more than the original which is quite strange. An of course the extra modes are missing…
The waterproof sensor
The sensor is epoxied and completely sealed looks easy enough to install
Mode 1: R27 = is open.
The sensor returns an analogue signal. The formula to calculate the distance from the data is:
Test distance = (high time * speed of sound (340M / s)) / 2;
Mode 2: R27 = A 47K resistor is soldered.
Every 100ms serial data will be sent in mm.
Serial baud rate: 9600, n, 8,1.
The frame format is: 0XFF + H_DATA + L_DATA + SUM 1.0XFF: for a frame to start the data, used to judge; 2.H_DATA: the upper 8 bits of the distance data; 3.L_DATA: the lower 8 bits of the distance data; 4.SUM: data and, for the effect of its 0XFF + H_DATA + L_DATA = SUM (only low 8)
Mode 3: R27 = A 120K resistor is soldered.
Good for low power applications.
After the module is powered on, the module enters standby mode.
If the module receives 0X55 it will send data over serial.