Sunday, July 28, 2019

PADLOCK SHIMS THE EASY WAY


PADLOCK SHIMS THE EASY WAY







In my video above I use a lock pick tool called a "padlock shim" or padlock shim pick.

These are available on Amazon and eBay for around $3 per set of three different sizes, a pair each size.


Some things to remember about padlock shim picks:


  1. Don't stick them straight down on the latch mechanism. This will ruin the tip and get you nowhere fast.
  2. You put the shim on the opposite side of the latch and then slide it around side-ways to pick the latch.
  3. Some padlocks (like the one in my video) have two latches. One on each side of the u-latch. So you will have to use two shims.
  4. Usually one side will be easy: just slide the shim down into the body of the padlock and then slide it around the u-latch sideways until it goes under the latch.
  5. The other side might be harder: slide the shim down, but not all the way down. Then jiggle the u-latch while sliding the shim sideways but also a little up and down to sneak it under the other latch.
These shims are cheap online! Buy a set to practice with. If you use them correctly you should have no wear on the pointed tips of the shims, but you will eventually get wear on the sides of the shims. These are a "consumable" item: they get worn out. Buy a set cheap online, practice, then you can try cutting your own from soda cans or roof flashing from the hardware store. The shims I have are a little stiffer than soda cans. They're closer to the thickness and stiffness of roof flashing, which you can buy at places like Home Depot. The only problem is that it comes in like 40' rolls.

The $50 shims from companies like "HFC" come with instructions warning that they too will wear out quickly. The shims have to be soft enough to work. So, buy the cheapest shims you can find that won't take forever to arrive. In the end they'll all wear out quickly--the super cheap ones usually come with nice rubber grip thingies, but they're not really necessary if you eventually learn to cut your own shims cleanly without jagged edges.

Spring loaded shackles can easily be opened with these shims, but they're not good for Stationary Ball Bearing (BB) type padlocks. Most padlocks that have bodies made from laminated layers of thin rectangles of steel are usually the easy to open shackle type.

For attempting, try and see if the lock is actually operational. If it's all rusty and the u-latch doesn't jiggle it might be rusted shut: time for some Liquid Wrench spray.



I write in a conversational style and use the pronoun "you" in place of "I" just as a personal authorial idiosyncrasy, this is NOT a how-to manual for high voltage electronics, lock picking, radiation handling, etc. 

Did you know (and I'm not a lawyer) that just possession of locksmith equipment in certain places by an unlicensed person is a crime? That, like pocket-knife laws these laws can vary not only by state, but by each city you travel through? Research your laws (all the cities you go in and your state and county laws) if you want to become a sport-picker (or actual locksmith).


There must be a whole wing in every prison filled with dudes who are all like "but some guy on the internet said it was okay!" 




I wonder, is it a cat-burglar alarm or a cat burglar-alarm? Is it a cat that meows when a burglar is around or an alarm that lets you know a cat-burglar is close by? Do they steal cats? Meow!





Sunday, May 26, 2019

Crystal Testing Circuit



Crystal Testing Circuit 


Quick oscillator circuit, powering a 16MHz crystal. 





Powered by 2.4vDC:




Hex inverter pinout:




Breadboard circuit:



16MHz on the frequency meter:

It worked dead on with a 16MHz crystal, ok with slightly higher frequency crystals but was unstable at lower frequencies. Just need to adjust capacitors and resistors.

This uses a 74hc04 hex inverter IC chip.


Monday, May 20, 2019

RTL-SDR Dongle Easy Setup







RTL-SDR Dongle Easy Setup



OK, I'm totally new to all of this so I bought this dongle. It's for Software Defined Radio. You can listen to a zillion different types of radio communication with it. If you add a $30 Ham It Up Plus you can listen to Russian submarine base broadcasts or VLF waves and listen to solar flares and meteors hitting our atmosphere and lightening strikes hundreds of miles away!

Here is basically my Amazon review for it.




I went to the "quickstart setup guide" listed on the outside of this device. Like the 3rd step said to go to airspy website and download their SDRsharp software. The website (as of 5/20/2019) has been dead all day. Crud! I tried the manual driver downloads and the Zadig download thing which downloaded, but there's no actual software radio since you still have to get a program to run the interface.

So, I poked around other places and got some even cooler (?) software to run this thing: "SDR Console v3" from sdr-radio dot com.  Downloaded, it took a while since it was 137MB.

I plugged in this dongle. Nothing happened. Tried it over and over. Then I plugged it into a regular USB port on my computer (instead of one labeled "SS" and I heard the usual bing-bong Windows 10 has detected a new device being plugged in. Cool!

I started up the SDR Console v3 software. It asked what dongle I was using and I chose "RTL dongle" or something very similar (I did NOT select the TCP version, it's the USB version).

BAM: nice radio static. It was working!!!!!!

So then I thought: I have no antenna, just a dongle at this point. Also, I have no idea what any of this is.
So it was "RTL Dongle-R820T" in a new window > select Bandwidth = 2MHz (for no reason) > click "Start" > static!

Then I went to the middle, left side of screen and clicked on "BFM" (Broadcast FM).

In the upper left part of screen there is a "Receive" box labeled RX1. You click either above or below each frequency number to change it higher or lower. I'm in Detroit and a strong radio station is 101.1 FM WRIF radio. So I got that input into the type left.

Still static...so I bent a metal paperclip straight and held it up to the hole in the USB dongle meant for antenna: BAM I COULD HEAR THE FM RADIO STATION REALLY WELL!!!!!!! Then up on the screen popped another window that said "101.1 Van Halen" and it was giving me band name and song title information of what the station was playing!!!!!

So, that's how you get up and running in under 5 minutes.

After this you can get a "Ham it up PLUS" box to plug in to this that converts ELF and VLF signals if you want to listen to military submarine base signal (cosmic rays and solar flares interfere with these so you can detect space and atmospheric events this way).

Plan on buying various SMA adapters and antennas and adapters to plug those antennas into sma connectors.

Right now I'm happy with my scotch tape/paperclip antenna. I'm still waiting for the other stuff to arrive (Ham It up PLUS converter, antennas, wire to wind my own 2' square vlf antenna, fm filter (glad I didn't have that working while I was testing, lol!), a powered lo-noise filter. These add-ons can possibly be powered by following the RTL website's guide to turning on "Bias Tee" which I *think* puts electricity through the device to power any add-on boxes you add to this thing (not necessary, but possibly fun).

WARNING: I did get the Zadig software to work and did the "replace driver" step BEFORE I got the SDR Console software downloaded and running, I'm not sure if that helped or made no difference.

So, I took the paperclip away and just touched the outside of the dongle with thumb and index finger: it got reception on that station too! Sounded great and on the screen it said "American Bad Ass by Kid Rock", so it's getting the digital information from the station in addition to the music! With no antenna!

So, in the SDR Console software you can pick all sorts of bands: AM, FM, SAM, ECSS-L/ECSS-U, CW-U, CW-L, GBM, NFM, WFM, LSB, USB, DSB, Wide-L, Wide-U.  Each one of these will require a different antenna plugged into the dongle: some just a few inches of thin wire or paperclip...some might need 30' tall coax, lol.

If you add a Ham It up PLUS box it upconverts a lot more bands to be listenable, but I think you have to tune the software radio to 125MHz...and then you can listen down to ULF, VLF, LF, MF and HF frequencies. On Amazon I ordered one of those (the cheaper circuit board only) and a blue metal box to put it in, along with some other junk that I'm not sure if I'll need, but it'll be fun.

So, that's how I went from ZERO radio experience to listening (at least to FM) with my dongle.

Oh, the dongle gets pretty darn HOT to the touch.

I'm pretty good at updating Blogger with helpful information--give me a week or two to play with this thing and the other accessories I bought.

I attached a blurry photo showing the nice interface and me holding my paperclip antenna> You can see I set the upper left frequency box to "101.1". The middle left box has the "BLM" broadcast FM option yellow click highlighted. The bottom left box has a 250hz filter selected (for no real reason, it was just on). To the left of my hand a block box says "ON 101.1 One Metallica" showing the Metallica song "One" was playing. AWESOME!!!

Now I'll just be researching other frequencies and their antenna requirements and buying or hand-making various antennae for fun.

Once I get the upconverter (Ham It Up PLUS) I'll make a 2' square VLF antenna which is super-easy. Get a 2' picture frame and wrap a wire around it 40-50 times or 120 times depending on which website I'm to believe, either way: super simple. Oh, THIS DONGLE ONLY RECEIVES...you can't transmit with it. Although I believe if you do get a transmitter of some the Ham It Up Plus converter does support transmitting down to 300hz. Not sure if that's wise of legal or whatever, but this dongle is for listening only--which is fine.

Hope this helps total newbies!
Mike from Detroit.

Sunday, May 12, 2019

Seeing NFC with Oscilloscope





Seeing NFC with Oscilloscope


In the last post (https://michaellogusz.blogspot.com/2019/03/wireless-power-transmission-to-make.html) I showed a smart card reader.

This smart card reader sends and receives 13.56Mhz signals for Near Field Communication. To test it I put a little LED chip that lights up by harvesting 13.56Mhz energy.

I wanted to see these waves on my oscilloscope. I found one super simple way to sniff NFC signals and another that was almost as easy.






The first thing I did was plug my RFID smart card reader thing into a cell phone AC wall charger outlet. Luckily, that made the card reader constantly send out a continuous NFC signal. This way I didn't have to hook it up to a computer and keep clicking "read" to get a signal. Nice!

Next I turned my oscilloscope probe into a signal tracer antenna sniffer loop. How did I do this? I clipped the alligator ground clip to the tip of the probe. That's it! Oh, I also set the probe to 10x instead of 1x. That's not a big deal, but the readout on screen looked nicer, because I had the scope set to 10x for no particular reason I can recall.







Anyway, then on my Rigol oscilloscope I clicked "Clear" button and all of a sudden all 4 channels came on. I shut them off one-by-one except for channel 1. I must have had some weird settings leftover from last time I was playing with it, because after seeing nonsense information all of a sudden I was treated to this:



Big waves with tiny little waves jiggling around inside them. If you look at the center of the photo you'll see toward the bottom "Freq = 13.7MHz". This would constantly go from 13.56MHz to slightly above and below. There was my Near Field Communication signal from the card reader right on screen.



Then I thought, what if I used an actual antenna made for NFC--instead of my home made loop? So, I fished around in a junk drawer and phone a broken phone I found in the garbage that had an NFC antenna. This antenna is pictured below. It's actually technically not an antenna: it's an NFC and wireless charging induction coil.





As you can see by my drawings I took a multimeter and did continuity tests. It turns out the little copper connection boxes (which I arbitrarily numbered 1-7) aren't all connected.

Boxes 1, 2 and 4 connect to each other.
Boxes 3 and 7 connect to each other.


So, I hooked my oscilloscope probe tip and ground clip up: one went to 1 or 2 or 4; and the other went to 3 or 7.








When I slammed this induction sniffer onto the card reader I got a way cooler looking set of waves and the frequency readout at the bottom of the oscilloscope screen read 13.56MHz most of the time.









In this way I sort of proved that the smart card reader was putting out 13.5MHz waves, but also that the phone induction coil wasn't just self-resonating at 13.5Mhz: because my crappy sniffer loop in the first part of this experiment also gave me 13.5MHz.

If you have an oscilloscope that's 50-100Mhz you can do this too. However, older scopes that don't go up that high (I have many scopes that are under 10Mhz) won't show you 13.5MHz waves. I think you're supposed to have an oscilloscope that is rated about 5 times the signal you're trying to see. Theoretically, my oscilloscope would be just under this...but it still worked.

If you want to do this the correct way, you'd by a $9000 spectrum analyzer or one of those cool hand-held "RF Explorer" boxes that go up to 6GHz (GIG! not Meg) so like 6000MHz. RF Explorer has units that are weirdly advertised and named so you think you're getting a certain range of frequency, but it's not really that range. For this I think they have a model that's only $180 that would do the trick, for a little more you can get a 2.4GHz model to play with Wifi signals (but I don't think that model can go down to 13MHz. The RF Explorer units range from $120-$500 and up.

The best thing they have is a signal generator that can go up to 6GHz. I thought about getting one of those for doing this same stuff with WiFi signals, but my oscilloscope can't go up to the Gig range (only MHz). Then I came up with an idea: the router I used for my last post about lectennas puts out 2.4 and 5Ghz signals: just plug an ethernet cable into one port and then into another of it's output ports: create a loop back into itself: this creates a packet storm and plenty of WiFI waves flooding the room. This might also be a way to stress-test a WiFi system, lol: no anechoic chamber and spectrum generators needed.

Anyway, after clearing the settings the frequency stopped bouncing around from 60-100Hz and went to 13.5MHz, and cool waves appeared. Not sure why that didn't happen until I hit "clear" on the oscilloscope. Keep fiddling with buttons and sometimes stuff just works out!




Thursday, March 14, 2019

Rectenna Lectenna Wireless Power Transmission





Wireless Power Transmission


To make a battery-less, wirelessly powered LED rectenna (Lectenna) energy harvester you just need a few components.





First you need a 1SS106 Diode, but this diode MUST have a little “H” on it for Hitachi. I bought a bunch of these little Schottky diodes that the eBay and Amazon listers said were made by Hitachi. I bought the “boutique” $5 diode from the UK. None of them had the little white “H” on them and so, none of them worked for this project.

Finally, I got fed up and started opening customer fraud complaints and a single dude on eBay (in China) said he had some “H” marked diodes and would send them. After 2.5 months of this I finally received a bag of these “H” diodes that actually worked. If you’re going to order off eBay or Amazon use the message function and tell the seller you must have “1SS106 Hitachi Diode with the white H on them” as nothing else will work. All the other 1SS106 diodes will fail to function! There are surface mount versions of similar diodes that will work, but they are literally smaller than the exclamation point at the end of this sentence and are super hard to pick up with tweezers is nearly impossible!

The other half of the circuit you need is a low CURRENT LED bulb. Just go on Digikey and get a bunch of Avago HLMP-D150 bulbs. They work, they are very low current, they are very cheap and they are red.




Ignore the two wires going to the old wifi router antenna (that's a later experiment). Notice how the flat side of the LED is OPPOSITE the banded end of the diode.




Again, notice how the flat side of the LED is OPPOSITE the banded end of the diode. Negative to positive.



Here's a pic of the two little guys twisted together. I put some dabs of solder at each end, only because I didn't want them falling apart when I took it around other people's gear.


Now what? Bend the legs of the red LED flat. This is your dipole antenna. It’s good at picking up microwave oven leaks and 2.45GHz wifi waves.
Next, put these two diodes (1SS106 & HLMP-D150) together so that the leg of the LED that has the flat side is connected to the side of the Schottky diode that has no marking. The LED has a leg near a flattened side. The Schottky diode has a leg near a banded end. You do NOT want these two legs to touch.

On diodes, one end will have a thick black or white stripe. The other end will have nothing. The end with the stripe is the NEGATIVE cathode wire. LEDs will have a flat spot on the base of the bulb or a shorter leg wire that means it’s the NEGATIVE cathode wire. FOR THIS EXPERIMENT WE WANT TO CONNECT ANODE TO CATHODE!!!!!  So we want the flat side of the LED connected to the NON-banded side of the diode.

You twist the two legs on one side together. Then the other.


Put this near a working router with 2.45Ghz (as opposed to just 5Ghz) band running and it will light up. I used an old Net Gear router that wasn’t hooked up to the internet. I just plugged the router into the AC wall outlet, turned it on then held down the padlock WPS button for a few seconds until the router went into the WPS easy connect mode which only then made the LED flash.


Lectenna in a dental floss container.

If you touch the metal wire legs of this energy harvester, you’re actually touching the antenna. This will make the light go out. So, you can try holding it by the bulb or just find a little plastic tube or bag or better yet just tape it to a piece of paper or a wooden stick and then you can poke it all around different equipment: routers, older cellphones, leaky microwave oven doors, etc.




On my Xfinity Arris “gateway” that is a modem and wireless router combined it blinked and lit up, but not as much. You have to lay it right on top of the bridge, near the rear of the box.

The best way to light these was one of those white TPLink Wi-Fi extenders that look like a kid's nightlight.

Someone was throwing away a BUNCH of wifi routers and they gave me about a dozen of this little black detachable, 90-degree bendable wifi antennas. I’m going to attach one of those antenna’s to this device to see if I can get farther away and still have the bulb light up. Right now it has to be touching either of the routers to light up, and it has to be in the correct spot on the router too!

There are a lot of ways of making a rectifying antenna (rectenna). Most involve intricately cutting tiny, flat sheets of copper into square cutout maze-like shapes. A Hitachi Schottky diode is easier: just make sure it has the “H” on it.

There are a lot of ways of proving your rectenna is working. Most involve satellite dishes and frequency analyzers and tons of fancy equipment. This way just blinks an LED for you to see it’s working.

I bought from China eBay user Hifiic and initially got Schottky diodes without the “H” on them and they didn’t work. I left feedback (negative, my first ever negative) about counterfeit. The dude(?) sent me a bag of real ones with the “H” and those were the only ones that worked. If you order from them, in the message to seller on the order page make sure you say “HAS TO BE “H” ON THE DIODE OR ELSE IT WON”T WORK!!!!” and they’ll hook you up hopefully. The UK seller LittleDiode sent me something which also didn’t work for way, way more money. To be fair, this is an oddity in the diode market: it’s the right case and product number, but only the older “H” diodes will work.





I also bought some smaller, surface mount diodes that should theoretically work, but they are so, so, so tiny I can barely see them. I would have to solder them because they are rectangles with pads (no wire legs sticking out) so I’d need to by one of those ultra-thin soldering irons with the microscope attached to even work with these. I’ve seen people take the insulation of a thin copper wire and pull the copper strands apart and then solder that tiny single copper strand (the width of a human hair) onto a surface mount diode.

That’s how they make fingernail NFC powered LED lights: seriously, they’re even smaller and they are glued to a person’s fingernails and they are lit up by the NFC (near field communication) waves coming out of a cellphone (you know: the “tap” to pay thing). Crazy blinking lights on your fingernails!!!! I have some of those (cheap from Amazon) and I have a test/development board NFC USB reader device ($10) coming that will hopefully light them up—since my current phone doesn’t have NFC. Which is probably a good thing: I can’t imagine not passing by a vending machine if I had tap-to-pay on my phone. Plus, I’m a dude so it’d look weird if I glued this microchip lights onto my fingernails.




I'll update later, there is a vicious thunderstorm happening now.

Friday, January 18, 2019

Mandelbrot BASIC Program



Mandelbrot BASIC Program






Here's another cool bit of code to cut and paste into BASIC emulator.

Same as previous post: download and install a BASIC emulator onto your computer, and paste the code in. I used "PC-BASIC" made by Rob Hagemans because it is one of the few emulators that also emulates graphics! I got it off a site called SourceForge. A lot of BASIC/QBASIC/GW-BASIC emulators don't do graphics. PC-BASIC does. Worked for me on a modern Lenovo ThinkCentre desktop   https://sourceforge.net/projects/pcbasic/

PC BASIC also one of the few emulators that seems to allow pasting lines of code in. That sure beats retyping everything.  I typed this program into an email at some point. Then I just copied it in the email program like normal (Control + C) and pasted into into PC-BASIC by hitting F11+V and it all appeared. Then type RUN and Mandelbrot stuff appears.


There are an infinite number of fractions between any two whole numbers: between 1 and 2 there are 1/2, 1/4, 1/8, 1/1000, 1/2304049904, 1/9994848483292929, etc. The dark set are the Mandelbrot numbers. The colors are numbers outside the set, blasting toward infinity.

Zoom in for a closer look, and there is always a ton of similar detail to see: fractals!

Here's the code to cut and paste (remeber to use F11 + V to paste once you're inside PC BASIC):


10           DEFSNG A-Z
20           SCREEN 1: KEY OFF
30           MAXDWELL = 150
40           NUMCOLORS = 4
50           NUMROWS = 100
60           NUMCOLS = 100
70           YOFFSET = 1
80           XOFFSET = 1
90           INPUT "LOWER LEFTHAND CORNER, REAL PART"; ACORNER
100         INPUT "LOWER LEFTHAND CORNER, IMAG. PART"; BCORNER
110         INPUT "LENGTH OF SIDE"; SIDE
120         CLS
130         COLOR 1
140         LINE (0, 0)-(NUMCOLS + XOFFSET, 0)
150         LINE (NUMCOLS + XOFFSET, 0)-(NUMCOLS + XOFFSET, NUMROWS + YOFFSET)
160         LINE (NUMCOLS + XOFFSET, NUMROWS + YOFFSET)-(0, NUMROWS + YOFFSET)
170         LINE (0, NUMROWS + YOFFSET)-(0, 0)
180        LOCATE 17, 1
190         PRINT "PERCENTAGE COMPLETE = 0"
200         PRINT "DWELL FOR LAST PIXEL = 0"
210         PRINT "LARGEST DWELL = 0"
215         PRINT "MAXDWELL ="; MAXDWELL
220         PRINT "REAL PART = "; ACORNER
230         PRINT "IMAGINARY PART = "; BCORNER
240         PRINT "SIDE =  "; SIDE
250         HIGHDWELL = 0
260         GAP = SIDE / NUMROWS
270         AC = ACORNER
280         FOR X = XOFFSET TO NUMROWS - 1 + XOFFSET
290         AC = AC + GAP
300         BC = BCORNER
310         FOR Y = YOFFSET TO NUMCOLS - 1 + XOFFSET
320         BC = BC + GAP
330         AZ = 0
340         BZ = 0
350         COUNT% = 0
360         SIZE = 0
370         WHILE (SIZE < 4) AND (COUNT% < MAXDWELL)  
380         TEMP = AZ * AZ - BZ * BZ + AC
390         BZ = 2 * AZ * BZ + BC
400         AZ = TEMP
410         SIZE = AZ * AZ + BZ * BZ
420         COUNT% = COUNT% + 1
430         WEND
440         COLOR 1
450         LOCATE 18, 23  
460         PRINT COUNT%; " ";
470         IF (COUNT% < MAXDWELL) AND (COUNT% > HIGHDWELL) THEN HIGHDWELL = COUNT%: LOCATE 19, 16: PRINT HIGHDWELL
480         IF COUNT% = MAXDWELL THEN PSET (X, NUMROWS - Y + 1), 0 ELSE PSET (X, NUMROWS - Y + 1), COUNT% MOD (NUMCOLORS - 1) + 1
490        NEXT Y
500         LOCATE 17, 22
510         PRINT 100 * X /NUMCOLS; " ";   
520         NEXT X
530         AS = INPUT$(1)            

                

                       
Once you run it you'll be asked to input three numbers. Here's the starter version:

-2
-2
4

these three inputs will give you the same Mandbrot as above.



Other numbers suggested are:
-.114
.917
.017

You end up zooming into the Mandelbrot, but since it's like fractals it looks very similar (but never the same). Sort of like the chaos in the last post's bit of code.

You can zoom in too much and get crazy numbers like 1.2453245E-9 in the readouts. If you've got the time and computing power you can try this:

10 DEFDBL A-Z




This Mandelbrot code really grinds the hard drive as it works. I used the default 20 Line of Screen 1. You can up the ante for more colors and better resolution by changing the lines, same as last post. Each variation increases colors and/or resolution/and or size but always makes it take longer to actually render onscreen:

20 SCREEN 7 : KEY OFF
40 NUMCOLORS = 16


Lots more colors:

20 SCREEN 13 :KEY OFF
40 NUMCOLORS = 256


Here's one that gives you 16 colors but increases the image size from 100 rows and columns to 200:

20 SCREEN 9 :KEY OFF
40 NUMCOLORS = 16
50 NUMROWS = 200
60 NUMCOLS = 200


Like in the last post, if everything goes haywire, it's probably because your graphics card can't handle this program...even though it's like two decades later chaos, infinities, bifurcations and fractals use a lot of computing power. Plus, you're going through a BASIC emulator which is going to slow things down too.

How slow? Here's a video I took with Line 20 Screen set to only "1" and the colors limited to only 4. The little window is only 100 rows x 100 columns. Look how slow it goes!









Saturday, December 15, 2018

BASIC Programming for CHAOS


BASIC Programming for CHAOS







The last time I played with BASIC programming was on my Commodore 64 computer. I'm attempting run a program that shows chaotic bifurcations (just like my Chaotic Chua Circuits).


We'll start with a simple 7 line code that will become the center of our chaos inducing 23 line code (don't worry, you can just copy and paste from here once you download a BASIC emulator).


So, here is an iterated logistic difference equation showing animal population growth. If you run it on an online BASIC simulator it works. For this, an online simulator works fine. Try this one:  https://repl.it/repls/InsignificantTepidEquipment



TURN ON YOUR CAPS LOCK FOR ALL CAP LETTERS!

If you type "2" as your input the population hovers at around half an animal. If you type "5" as your starting population it goes to infinity (which is an error). So you need numbers less than 4 to keep it running true. The population levels out if you put in 1.5 as a start:


10 N=.1
20 INPUT"VALUE OF R";R
30 FOR I=1 TO 30
40 N1=R*N*(1-N)
50 PRINT N1
60 N=N1
70 NEXT I




Here is the screen capture of it in action:


Infinity: that's a lot of kitties! But an error in the program of going too high (R=5).



So here is R = 3.999




There is a new version of BASIC from Microsoft available as a download or an online simulator here: https://smallbasic-publicwebsite.azurewebsites.net/

It's called Small Basic...and the language is different.

Here's a cut and paste version of the above script in the new language (it works, but doesn't give as many lines of results):

N=0.1
TextWindow.Write("What is the value of R? ")
R = TextWindow.ReadNumber()
FOR I=1 TO 30
N1=R*N*(1-N)
TextWindow.WriteLine("The result it " + N1 + ".")
N=N1
ENDfor

Each one of these lines is a seperate line in Small Basic (just number them 1, 2, 3, etc.) like this screenshot:

Oddly, it cannot handle decimals for the R value, so here is R=5:



Fun in (Small) BASIC for the year 2020!!!!!!!!!!!

Bifurcation/Chaos

Now here is the bifurcation program, which I snagged from a booksale of weeded library books (I'm a librarian). There was a whole pile of stuff on chaos, but it was written in the early 1990s, so it was computer stuff and not oscilloscope stuff--pretty cool! Check out "Science of Chaos" by Christopher Lampton, the appendix (Page 111) has a great little primer on BASIC; although most of the commands seem to be in QBASIC and not BASIC (but it's been about 3 decades ago for me, so who knows). It doesn't matter because this is super easy (just copy and paste what I did).

You download and install a BASIC emulator onto your computer, like I did for the following video and screen shots you can just paste the code in. I used "PC-BASIC" made by Rob Hagemans because it is one of the few emulators that also emulates graphics that are needed to display the chaos! I got it off a site called SourceForge. A lot of BASIC/QBASIC/GW-BASIC emulators don't do graphics. PC-BASIC does. Worked for me on a modern Lenovo ThinkCentre desktop, LOL! https://sourceforge.net/projects/pcbasic/



There is an emulator is called "DOSBOX" also works but is very slow, and you can't paste into it--you just have to retype everything. It runs online, so no downloads. The problem is that you can't pause/exit a program without crashing/locking up:  https://archive.org/details/msdos_qbasic_megapack



Anyway, it is also one of the few emulators that seems to allow pasting lines of code in. That sure beats retyping everything.  I typed this program into an email at some point. Then I just copied it in the email program like normal (Control + C) and pasted into into PC-BASIC by hitting F11+V and it all appeared. Then I typed RUN and it started drwing the lines/single attractor/two splits (4) attractors and finally the chaos.



Here is the BASIC code for Bifurcation Leading To Chaos:


10 KEY OFF:CLS
20 SCREEN 7
30 DEFSNG A-Z
40 COLUMNS = 320
50 ROWS = 200
60 START = 1
70 FINISH = 3.999
80 TOP = 0
90 BOTTOM = 1
100 MAXREPS = 10
110 HEIGHT = BOTTOM - TOP
120 VPCT = 1/HEIGHT
130 FOR R = START TO FINISH STEP(FINISH - START)/COLUMNS
140 X = .1
150 FOR I = 1 TO 100
160 X = R * (X - X * X)
170 NEXT I
180 FOR I = 1 TO 30
190 X = R * (X - X * X)
200 PSET ((R- START) * COLUMNS/(FINISH - START), ROWS-(X - TOP) * ROWS * VPCT)
210 NEXT I
220 NEXT R
230 A$ = INPU$(1)


This was way easier than my Chua Circuit + Oscilloscope adventures in chaos (which were lots of fun too though).

After you cut and paste and run the program the line drawing will eventually stop. If you hit any key and then type LIST it will show you the lines of the program again.

Then comes a neat part: if you want to make a change in a line you could use arrow keys and move up and retype little bits and pieces of the code; or you could just retype the line.

Lets say you want to change line 20 from having a screen value of 7 to a value of 9. Right at the cursor that you're left at after hitting list just type:    20 SCREEN 9      then hit enter and then type RUN and it will change the line and run the program and you can see the changes it makes (or get an error).






COOL CHANGES YOU CAN MAKE TO THE ABOVE CODE:

Line 20 
This sets the screen resolution to 7.
You can change that to 9 and get higher resolution. It worked for me.
I tried setting it to 12, but got an error message. Probably because the emulator couldn't handle that high of a resolution. Here, the higher resolutions are the emulation of old EGA and VGA video cards, LOL! This program is actually best performed on an old CGA graphics adapter (which is why the crappy value of 7 is chosen--it's low res, but works).

Many emulators I tried gave an error at line 10 or 20, meaning they didn't emulate graphics adapters.



The QBASIC Screen values represent:

SCREEN 0: Textmode, cannot be used for graphics. This the screen mode that text based programs run on.

SCREEN 1: 320 x 200 Resolution. Four Colors

SCREEN 2: 640 x 200 Resolution. Two Colors (Black and White)

SCREEN 7: 320 x 200 Resolution. Sixteen Colors (USE THIS ONE)

SCREEN 8: 640 x 200 Resolution. Sixteen Colors

SCREEN 9: 640 x 350 Resolution. Sixteen Colors

SCREEN 10: 640 x 350 Resolution. Two Colors (Black and White)

SCREEN 11: 640 x 480 Resolution. Two Colors

SCREEN 12: 640 x 480 Resolution. Sixteen Colors

SCREEN 13: 320 x 200 Resolution. 256 Colors.





Line 40 and Line 50
I changed the values from the original 320 & 200 to higher values. This changed the aspect ratios and distorted things. Once the values got too high (around 800) it gave stack overflow errors. It also tended to start the line drawing near the center of the screen, and/or have stuff run off the edge of the screen which was annoying.




Lines 160 through Line 200
You'll notice these mirror the equation in the first (animal breeding) program.
What's crazy, is that if you plug in other equations, you'll get nearly identical chaotic bifurcations on screen...because whenever something breeds chaos, the chaos is the same. Chaos = Chaos!




Lines 60 through Line 90
Here's where it gets really interesting and beautiful. These lines are Start, finish, top and bottom. Which you would assume to just shift the same image on the screen left or right or up or down, just like the line 40 and line 50 stuff tended to do. You'd be wrong. It actually enlarges portions of the original output--and because it's a fractal like chaos it stays interesting and amazing.

Here are the original lines:

60 START = 1
70 FINISH = 3.999
80 TOP = 0
90 BOTTOM = 1

And here are a new set of values:

60 START = 3.5601
70 FINISH = 3.59
80 TOP = .34
90 BOTTOM = .35



I'll pop them into the entire code, so you can cut and paste one block:


10 KEY OFF:CLS
20 SCREEN 7
30 DEFSNG A-Z
40 COLUMNS = 320
50 ROWS = 200
60 START = 3.5601
70 FINISH = 3.59
80 TOP = .34
90 BOTTOM = .35
100 MAXREPS = 10
110 HEIGHT = BOTTOM - TOP
120 VPCT = 1/HEIGHT
130 FOR R = START TO FINISH STEP(FINISH - START)/COLUMNS
140 X = .1
150 FOR I = 1 TO 100
160 X = R * (X - X * X)
170 NEXT I
180 FOR I = 1 TO 30
190 X = R * (X - X * X)
200 PSET ((R- START) * COLUMNS/(FINISH - START), ROWS-(X - TOP) * ROWS * VPCT)
210 NEXT I
220 NEXT R
230 A$ = INPU$(1)


...and here are the results, which are a an enlarged portion of the lower "eye" of the original:



Keep playing with lines 60 through 90 and get your own crazy, unique views of chaos.




Line 150 / Line 180
Change the numbers in these so instead of 1 to 30. Let's say: make it 1 to 10 and 1 to 20 it will draw faster, but also differently!!! If you make the numbers larger (especially on Line 180 it will draw much slower, and also give an error at the end that might blank the screen out--so take a photo before it reaches the end just in case--or video).



Lower numbers in Lines 150 and 180 so it drew very quickly, and gave a sort of negative Lorenz Butterfly type look:




This one had a larger number on Line 180 and took a couple minutes to finish. It's filled in quite a bit in the chaotic area (which might not be chaotic anymore I guess).






Another useful feature you can use in QBASIC (which I think most of these commands are actually from) is BEEP.

At the end of your program add another line and write BEEP.

So for the above experiments we would add:

240 BEEP

Then, when your chaos is done drawing you're treated to a very loud BEEP! Don't have headphones on with that one.