I ordered some LED's, sockets, 2n2222 transistors and some 12V relays today.

What do you all think of this plan:

USB->UART (buy it)

UART->LOGIC output (build it: see falstad/video)

LOGIC->RELAY (buy it)

POWER- through relay (spare 12v from shucked HDD's)

Automotive/pinball LED T10 bulbs in sockets mounted to PCB or 3D printed structure. (buy it)

#electronics
#soldering
#microsoft
#MicrosoftTeams
#onair
#onairlight
#dietz
#chrome
#python
#ee
#circuit
#falstad
#LED
#arduino
#raspberrypi

My python code sends data out of the serial port if Teams is On a call and sends nothing otherwise.

The circuit turns the LED red when it sees pulses and leaves it red for a second or so. As long as it gets serial data once a second or so the LED stays on. If anything goes wrong it goes off

Would you buy a serial to on/off GPIO output module like this?

#electronics #soldering #microsoft #MicrosoftTeams #onair #onairlight #dietz #chrome #python #ee #circuit #falstad #LED #arduino #raspberrypi

I have simmed and soldered and achieved blinky blinky!

Next step. It's not bright enough. Buying a logic level relay and some T10 LED bulbs. I'm going to try some things.

https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0lwrOMsAcA2A7AJixsX4BOFfNELQkRAFgGYqBTAWjDACgBnEJtSFEFJG7xq1AUKEQAZgEMANhwZsA7t2xDcWNViG14WyGwBu3Qbv2m44qDeq7o9CVGjw2AJ2GjwZJiLFNBGzA4OHdtDWxw8AwySRCwwi9qfkT-MFjweNV0MTAvFEIyPLEsFRBCLH50oQr+PQMy1Osm-DrGr1byyvBuw1UmljIB2gb+ryZCgRHuSb7LIUCAq0GoMqWhJc9-QLmePmsmdWtDD0OUMXq1C0u4tbMQS7OLi12Ma4tDnQeXsoxaIq8GHO4C8pVUn0kMSiOzWfgO1EmgTB3GoaDEi1RF1GKLR8MREjWmJ6-CYRJh4Oo6RB-kpZBuYVJVNJJNpNlu4LhizhVN2rI2rJ57RpKXG012902624gqkKOSxJRVM602QiBgkFKstJ8umjLpWlo9FVzg1hNxnW1VV6Zqxcrq2Ih3y0vi89I5ro+rLdIDsC10X0CtEJSvwirI5LD8Kp8rmcMmcO9j0maI2s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oftTeams #onair #onairlight #dietz #chrome #python #ee #circuit #falstad #LED

Sometimes #Falstad circuit simulator doesn't have essential components such as #DCDC converters with a feedback. But, If you put just an opamp with 10A current limit as a comparator + diode, there you have a much simplified buck converter model.

Pong in Hardware… Virtually

We are big fans of the Falstad circuit simulator. Sure, it isn't perfect, but there's nothing else like it when you want to whip up a simple circuit. But we were blown away when we saw a more or less complete hardware implementation of Pong in Falstad. No kidding. Starting with the original schematics, there are multiple pages that show each sub-circuit and even a playable subset that you can play the game in your browser.

But wait… you probably noticed there's no CRT display in the simulator's component menu. That's true, there isn't. However, you can write JavaScript to interact with a running simulation, so the display is a simple bit of JavaScript that samples signals at predetermined points and does the appropriate drawings. There's even audio output for the sound effects, although that is built into the simulator.

As an example of how the display works, look at this snippet:

// called every timestep, which is 6 nanoseconds of game time. // we do as little work in here as possible. function didStep(sim) { var c = clk.getVoltage(); if (c == lastclk) return; if (c>2.5) { // positive clock transition, increase x x++; if (x == 375) { x = -80; y++; if (sim.getNodeVoltage("VBLANK") > 2.5) { // if we're in vertical blank, set y to 0 y = 0; clearedY = -1; sim.setExtVoltage("PADTRIGGER1", 5); sim.setExtVoltage("PADTRIGGER2", 5); }

You can see the whole thing by simply viewing the page source in your favorite browser.

Not only is this very educational if you ever wanted to know how something like this works, but it is also a great illustration of what you can do with the Falstad simulator and some Web page work. It gives us a lot of ideas. If you are interested in the Pong circuit itself, we really enjoyed how each page broke down a part of the circuit and explained it along with the relevant simulation.

Don't forget you can try Arduino programs out in Falstad. You can even build a simple analog computer.

#classichacks #softwarehacks #falstad #pong

Pong In Hardware… Virtually

We are big fans of the Falstad circuit simulator. Sure, it isn’t perfect, but there’s nothing else like it when you want to whip up a simple circuit. But we were blown away when we saw …

Hackaday

Circuit VR: The Wheatstone Bridge Analog Computer

We are always impressed with something so simple can actually be so complex. For example, what would you think goes into an analog computer? Of course, a "real" analog computer has opamps that can do logarithms, square roots, multiply, and divide. But would it surprise you that you can make an analog device like a slide rule using a Wheatstone bridge -- essentially two voltage dividers. You don't even need any active devices at all. It is an old idea and one that used to show up in electronic magazines now and again. I'll show you how they work and simulate the device so you don't have to build it unless you just want to.

A voltage divider is one of the easiest circuits in the world to analyze. Consider two resistors Ra and Rb in series. Voltage comes in at the top of Ra and the bottom of Rb is grounded. The node connecting Ra and Rb -- let's call it Z -- is what we'll consider the output.

Let's say we have a 10 V battery feeding A and a perfect voltmeter that doesn't load the circuit connected to Z. By Kirchoff's current law we know the current through Ra and Rb must be the same. After all, there's nowhere else for it to go. We also know the voltage drop across Ra plus the voltage drop across Rb must equal to 10 V. Kirchoff, conservation of energy, whatever you want to call it. Let's call these quantities I, Va, and Vb.

There are many ways to go from here, but let's accept that the current through two series resistors will be the same as if it were one resistor of equal value. That is, a 1 KΩ and a 2 KΩ resistor in series will draw as much current as a 3 KΩ resistor. That means Ohm's law tells us:

I = 10/(Ra+Rb)

Now you can solve for each voltage drop:

Va = I Ra Vb = I Rb

In fact, our voltmeter at Z will measure Vb since it is grounded.

Big Hairy Deal

Of course, you probably know about voltage dividers. But we were going to talk about Wheatstone bridges. The truth is these are just two voltage dividers in parallel and you measure the voltage between the two outputs (call them Z1 and Z2). You often see this circuit drawn like a diamond, but don't let that fool you. It is still just two voltage dividers.

Without using any math, you can see that if the voltage dividers are the same then Z1 and Z2 will be the same and, therefore, no current will flow because the voltage between the two points is zero. What happens when the divider is not the same? There will be more voltage on one Z point than the other.

Historically, this was used to measure resistance. You could use two matched resistors in part of the bridge, have an unknown resistance in one of the remaining legs and a variable resistor with a dial calibrated to read ohms. You'd turn the dial until a meter read zero and read the resistance value from the dial. If the power source is AC, you can also measure reactance using a similar circuit.

But the Slide Rule?

So how do you get from a piece of antique test equipment to a slide rule? Let's change the bridge so the left-hand divider has resistors Ra and Rb while the other one has Rc and Rd. We can look at the algebra:

Z1=V (Rb/(Ra + Rb)) Z2=V (Rd/(Rc + Rd))

We want Z1 to equal Z2 so:

V (Rb/(Ra + Rb)) = V (Rd/(Rc + Rd))

We can divide both sides by V and get rid of that term:

(Rb/(Ra + Rb)) = (Rd/(Rc + Rd))

So to balance the bridge we need:

(Ra + Rb)/Rb  = (Rc + Rd)/Rd _reciprocal both sides_ (Ra Rd + Rb Rd) = (Rc Rb + Rb Rd)  _multiply both sides by Rb Rd_ Ra Rd = Rc Rb      _subtract Rb Rd from both sides_ Ra = (Rb Rc)/Rd _Solve for Ra_

As a simple thought experiment, then, imagine that Rd=1. If you set Rb and Rc then you can adjust Ra to balance and the value of Ra will be the answer. Or you can set Rb to 1 and enter numbers in Rc and Rd. Once you balance Ra, you'll know the result of the division.

In practice, though, you might want to scale the result, especially for division. For example, if Rb=1, Rc=2, and Rd=1000 you would need to set A to .002 ohms which is hard to do. In that case, though, you could set Rb to a scale factor. If it were, say, 10K, then Ra can be set to 20 ohms.

Simulation

You could break out a few potentiometers and have a go at this. We'd suggest linear ones unless you are very handy at making logarithmic scale dials. But since this is Circuit VR, we'd rather do a simulation. Falstad fits the bill, but any simulator is well up to the task.

Analog slide rule simulation

There are two switches in the simulation. The top "C" switch lets you switch in the top resistor or a 10X, 100X, or 1000X range resistor for C. The bottom "D" switch lets you select a 1 ohm resistor or a variable resistor for D. The ammeter in the center shows the bridge balance and will read 0A when you are in balance.

Speaking of variable resistors, I did put sliders for each of the resistors on the right sidebar of the simulator. However, using them often puts values in like 10.002K which reads 10K on the screen and is a source of error. Of course, you'd have the same problem with real pots, so maybe that's a good simulation. However, it is better to double click the resistor you want to change and enter its value directly. Obviously, you shouldn't change the three fixed C resistors or the fixed D resistor.

Next Steps

A similar device in a 1960 Radio Electronics

If you want to see what this circuit looked like in the flesh, check out pages 48 and 49 of the June 1960 Radio Electronics. It may have even been the very article that spawned [Bil Herd's] first computer kit. A similar kit from Edmund Scientific used three potentiometers to form the bridge in a common configuration. We've even seen a version from GE that used an audio oscillator so you could hear the null point using headphones. You can see both of those on the article starting on page 65 of the December 1961 Popular Electronics. Or check out a newer build over on Hackaday.io.

It would be an easy enough rainy day project. If you have an old-fashioned mirror scale meter from an old multimeter, it would really shine in this application. Making the dials in a CAD program and printing them out would be effortless, too.

If you want a challenge, why not use an AC source along with variable capacitors and inductors to make a complex number calculator? That'd be something and if you pull it off, we'd cover it.

Meanwhile, we'd like to point out that real analog computers were not this simple. On the other hand, by definition, this is an analog computer just like a real slide rule. If you read the Radio Electronics article, you'll see it can even chain an answer into the next problem just like you would do on a slipstick.

#engineering #history #analogcomputer #falstad #sliderule #voltagedivider #wheatstonebridge

Circuit VR: The Wheatstone Bridge Analog Computer

We are always impressed with something so simple can actually be so complex. For example, what would you think goes into an analog computer? Of course, a “real” analog computer has opam…

Hackaday

Listen To The RF Around You

These days, we are spoiled for choice with regard to SDRs for RF analysis, but sometimes we're more interested in the source of RF than the contents of the transmission. For this role, [Maker_Wolf] created the RFListener, a wideband directional RF receiver that converts electromagnetic signal to audio.

The RF Listener is built around a AD8318 demodulator breakout board, which receives signals using a directional broadband (900 Mhz - 12 Ghz) PCB antenna, and outputs an analog signal. This signal is fed through a series of amplifiers and filters to create audio that can be fed to the onboard speaker. Everything is housed in a vaguely handgun shaped enclosure, with some switches on the back and a LED amplitude indicator. [Maker_Wolf] demonstrates the RFListener around his house, pointing it at various devices like his router, baby monitor and microwave. In some cases, like with a toy drone, the modulation is too high frequency to generate audio, so the RF listener can also be switched to "tone mode", which outputs audio tone proportional to the signal amplitude.

The circuit is completely analog, and the design was first done in Falstad Circuit Simulator, followed by some breadboard prototyping, and a custom PCB for the final version. As is, it's already an interesting exploration device, but it would be even more so if it was possible to adjust the receiver bandwidth and frequency to turn it into a wideband foxhunting tool.

#radiohacks #falstad #foxhunting #radiodirectionfinding #receiver

Listen To The RF Around You

These days, we are spoiled for choice with regard to SDRs for RF analysis, but sometimes we’re more interested in the source of RF than the contents of the transmission. For this role, [Maker…

Hackaday

Circuit VR: Arduino Virtually Meets Analog

There was a time when building electronics and building software were two distinct activities. These days, almost any significant electronic project will use a CPU somewhere, or -- at least -- could. Using a circuit simulator can get you part of the way and software simulators abound. But cosimulation -- simulating both analog circuits and a running processor -- is often only found in high-end simulation products. But I noticed the other day the feature quietly snuck into our favorite Web-based simulator, Falstad.

The classic simulator is on the left and the virtual Arduino is on the right.

Back in March, the main project added work from [Mark McGarry] to support AVR8js written by [Uri Shaked]. The end result is you can have the circuit simulator on the left of the screen and a Web-based Arduino IDE on the right side. But how does it work beyond the simple demo? We wanted to find out.

The screen looks promising. The familiar simulator is to the left and the Arduino IDE -- sort of -- is to the right. There's serial output under the source code, but it doesn't scroll very well, so if you output a lot of serial data, it is hard to read.

Nothing is Perfect

I love just about everything about the Falstad simulator and having an Arduino cosimulation is great. But there is one really important issue that may get resolved eventually. Normally when you draw a schematic you can save it as text or encoded in a link. If you click the link or import the text, everything is back to the way it was when you saved. I use that in a lot of Circuit VR posts so you can click on a circuit and see it live.

However, the simulator does not save the source code in the virtual Arduino. You have to do that yourself. That means if you have everything working, save your circuit, and close your browser you'll have to recreate your Arduino code next time. Luckily, I tested this out before I lost any work. There should be a big red warning on the page, though.

What that means, though, is that I can't give you a link to follow along with examples. Here's what you can do:

  • Have a look at the source code.
  • Open the simulator.
  • Copy the text from the top of the source code comments and paste it into the simulator (detailed instructions in the comments).
  • Just don't forget to save your source code changes. If you make changes to the circuit, you'll want to export them to text and copy them into the source code so you can save everything together.

    An Example

    Test schematic.

    I wanted an easy example that showed the benefit of using cosimulation. I settled on looking at some alternatives for doing an analog to digital conversion using successive approximation. A virtual potentiometer provides an input voltage. There's a comparator and a buffered PWM output. Here's the schematic:

    Input/Output

    There are three interface points to the Arduino. The PWM output is set as an external voltage using the "Inputs and Sources" components (remember, the output from the Arduino is the input to the circuit). Conversely, the comparator output and the connection to the Arduino's analog converter (A0) are labeled nodes from the "Output and Labels" menu. The names are significant, including the spaces.

    The Code

    In theory, the code is pretty simple. You guess a voltage and read the output of the comparator to see if you are right. There are two methods in the code and you can switch between them by setting the convert define to convert0 or convert1.

    On every pass through the loop, the code calls one of the convert functions to manage the successive approximation process through a different algorithm. It also updates the PWM output on each pass.

    The first approximation algorithm is very simple but not very efficient. It guesses each output voltage starting at 0 and moving up 1/255 V on each pass. When the comparator goes from false to true, you know the input voltage must be less than the current voltage but more than the previous voltage.

    The second algorithm is smarter and works like a binary search. The first guess is 128/255. That voltage is either higher or lower than our target. If it is lower, we remember that the bit should be on and, either way, move to the next bit. In other words, the second test will be either 64/255 or 128/255 + Simulide64/255. Again, the new value is either high or low and will determine the state of the next bit.

    The first algorithm could finish fast or it may have to count all the way to 255 to find the answer. The second algorithm always takes 8 measurements. There's no way for the comparator to tell us our reference voltage is exactly equal to the input even if we could define what that means for an analog signal. So we have to measure each bit and decide if it should be on or off.

    The output appears in the serial terminal. The first number is the result of the conversion and the second is the value from the built-in converter for the same voltage.

    Voltage Reference

    Generating the reference voltage is the key. It would be possible to use 8 output bits and an R2R network to generate an output voltage quickly, but that eats up a lot of pins. Instead, I used one pin to generate voltages using PWM. This isn't as fast, of course, because you have to allow the RC filter time for the voltage to reach its desired value.

    Pin 9 generates a PWM signal using a time-honored technique. Suppose you want to generate 20/255 (about 8% duty cycle). You take an 8-bit accumulator and add 20 to it repeatedly. The PWM output is the carry out of the top bit. You can find a spreadsheet with the logic, but you'll have to imagine the output waves are squares since the spreadsheet helpfully draws straight lines between points.

    This spreadsheet models the PWM output logic.

    To do this right, the code should run on a precise interrupt and equalize the time between outputs. However, for this quick demo, I've assumed the time for calling the main loop will be regular enough. I considered doing it on an interrupt, but -- honestly -- I'm not sure how faithful the simulator is, how time-accurate it is, and it doesn't appear you can easily add libraries to it, so you'd almost certainly have to manage the interrupts at the register level.

    The output signal gets smoothed by an RC filter. The values here are interesting and it is fun to watch the scope as you vary the parameters in this part of the circuit. You want a noise-free reference signal. So that implies a big capacitor. However, a big capacitor takes more time to charge and discharge, so the voltage will take longer to settle. It is a classic trade-off. Do you want a noisy fast response or a clean slow response?

    In this case, the pot probably doesn't change very fast, but in real life, the input signal might be changing all the time and you might even consider a sample and hold on that input to make sure it doesn't change while you are in the middle of guessing.

    Tuning

    Obviously, you can change the RC values easily in the simulator. It is even possible to add sliders to set the values graphically while the simulation is running (the pot is set up to do this already). Changing the code, however, requires a stop and restart.

    In the code, you can change the number of loop cycles the convert routines wait to allow a new PWM value to settle (SETTLELOOPS) and how long to pause between readings (SAMPLOOP). The interactions between these numbers and the RC values are critical. Larger RC time constants require more time to produce correct results. Smaller RC numbers will require less time, but the noise will introduce errors. Take your pick.

    PWM signal with 2uF capacitor.

    PWM signal with 47uF capacitor.

    The Verdict

    This is a toy example. The PWM generation suffers from some issues and PWM isn't a great idea for a conversion reference. Still, it shows a good bit of what is possible with the cosimulation available with Falstad. I am really looking forward to the next time I need some exotic signal fed into a circuit. Just using the Arduino as a function generator will have its uses.

    I do wish you could add libraries and save an entire project more easily. Still, there are many what-if scenarios you could simulate quickly and easily using this tool. Since it has only been in the code base for a few months, I'm hopeful some of these issues will work out over time. Add debugging to the mix, and it would be a real winner.

    Tinkercad allows you to simulate Arduino, but not with the circuit sophistication of Falstad. It does require an install, but we are always surprised we don't hear more about Simulide.

    #arduinohacks #hackadaycolumns #arduino #cosimulation #falstad #simulation

    Circuit VR: Arduino Virtually Meets Analog

    There was a time when building electronics and building software were two distinct activities. These days, almost any significant electronic project will use a CPU somewhere, or — at least &#…

    Hackaday