1
\$\begingroup\$

TL;DR I am storing a 24-bit number that represents number of pulses from a clock on a digital counter IC, and want to transmit that number to a more sophisticated device to perform a speed = distance/time calculation. Is there a simple way to do this over an internet protocol like HTTP, or utility like netcat, without a CPU?

Conceptually the problem is very simple - I have a 24-bit number that I need to transmit to a hard-coded network address.

I am making a speedometer using digital ICs and motion sensors - when an object moves past the first row of motion sensors, it starts the timer (LM555 IC), and when it moves past the second row it stops the timer. The timer is pulsing a 24-bit counter (74HC590's chained together). In order to calculate the speed of the object, we need to calculate speed = distance / time = distance_between_sensors / (sampling_frequency * num_pulses). This computation, though possible to perform using ICs, would be simpler to perform on a more sophisticated device because it involves floating point numbers up to 24 bits. I am trying to do this project without a CPU to keep costs lower and make it easier to reproduce. Most people alredy own multiple sophisticated computers and devices with network acccess that I would like to make use of.

Is it possible to transmit the 24-bit number (representing number of pulses from the clock) to such a device without a CPU on the speedometer? Ideally there would be a black-box device that would require a hard-coded network address for HTTP or other network protocol like netcat. This address would be serving requests of a fixed format from the device, and performing the computation.

\$\endgroup\$
13
  • 3
    \$\begingroup\$ Define "CPU". You can probably find some way to make something that can do this that doesn't technically count as a CPU by any given metric. \$\endgroup\$
    – Hearth
    Nov 17, 2023 at 4:26
  • \$\begingroup\$ It sounds like a better question to ask would be: what is the best way to measure timing remotely, and transmit it onwards to a system where it can be processed into a speed, such as for a chronograph? If you agree, please add any relevant details to constrain such an application. \$\endgroup\$ Nov 17, 2023 at 4:46
  • 4
    \$\begingroup\$ Many microcontrollers are cheaper that the parts and labour required to do this with discrete components. The necessary calculations could probably be done in an Arduino or similar device, without needing to send the data off somewhere for processing. \$\endgroup\$ Nov 17, 2023 at 5:22
  • 4
    \$\begingroup\$ @cornelius Therefore, shouldn't it be less expensive to perform these in isolation? No, the opposite is the case. Economies of scale allow microcontrollers to be very cheap for what they can do. Your system would probably get cheaper if you threw away all your custom logic and replaced it with a single microcontroller. \$\endgroup\$ Nov 17, 2023 at 9:12
  • 1
    \$\begingroup\$ @cornelius There are microcontrollers that cost less than $0.10. It is almost always cheaper to use a microcontroller than to try to do it with discrete logic. \$\endgroup\$
    – Hearth
    Nov 17, 2023 at 13:28

2 Answers 2

2
\$\begingroup\$

If you are measuring the time for an object to move between two points using discrete ICs, then you have already spent as much on components as you would have spent on a microcontroller.

Discrete component circuits are good learning tools. They teach you about what goes on inside of more complicated systems. The problem is that they become really expensive and complicated when you try to expand them.

You've found that it is relatively simple to count the time period with a timer IC and some counter ICs. Now you'd like to do some math, and the project complexity is going to explode.

You can't really "offload" the calculations to a PC or other full sized computer.

If you try to implement, for example, an Ethernet stack so that you can send the count to a PC you will end up implementing a tremendously complex pile of electronics that will (at some point) end up implementing all the things contained in a typical microcontroller. On top of that, you have to implement the hardware interface - Ethernet isn't simply some wires connected to a chip. There are transformers involved and line drivers to push a signal with the proper levels through long wires.

The cheapest way to implement what you want to do is to use a microcontroller development board. Something like an Arduino, or any one of many alternatives.

I can buy Arduino Nano knock-offs for about $4 US each. That's probably less than you spent on your 555 timer, the counter ICs, and whatever glue logic you needed to make it go. You could program a Nano to measure the time period easily, then adding the speed computation is trivial - and you can easily connect the Nano to a display of some sort to show the result. You could also put an Ethernet adapter on the Nano and send the data to a server some where for logging or analysis. Even easier would be an ESP32. $5 US each in a pack of three, and it has WiFi built in.

I'm all for using discrete components to learn, but it is usually cheaper and simpler to throw a microcontroller and some software at real world tasks.


I find your 74HC590 at $0.88 US at DigiKey, and the LM555 for $0.80. That's already $3.44 US. That's already most of the price of an ESP32. You are headed for a really expensive project if you stick with discrete parts.

\$\endgroup\$
1
  • \$\begingroup\$ There are advanced multi input CPU for less than $2. \$\endgroup\$
    – Fredled
    Nov 17, 2023 at 13:39
1
\$\begingroup\$

I don’t think so.

A networking protocol stack requires elaborate state machines, nontrivial data storage and serialization, and support hardware. A simple digital system could transmit your 24-bit value via something like SPI or UART, but Ethernet+TCP/IP is out of the question even for the most minimal robustness and security. The internet protocols were designed to run on CPUs. Even the ugliest hack would probably require at least an FPGA, and CPUs are easier to work with than FPGAs.

\$\endgroup\$
2
  • \$\begingroup\$ I agree: It's possible to send 24 bits via SPI or I2C and to a PC via a USB-to-RS485 or USB-to-SPI adapter. I did the experiment myself. But via the internet or Ethernet, addressing and protocols are too complicated. It would require an insane amount of logic ICs if you can manage to find out how and a very large PCB. Of course the cost of programming, if you can't program a CPU yourself, is quite high. There is also cost related to factory programming in mass production. But that's the only way to do it. \$\endgroup\$
    – Fredled
    Nov 17, 2023 at 13:36
  • 1
    \$\begingroup\$ There are chips out there that do Ethernet to/from simple serial protocols like UART, but they're basically full microcontrollers just preprogrammed. And I don't recommend them; they have no hope of keeping up with security features of any type. \$\endgroup\$
    – Ben Voigt
    Nov 20, 2023 at 16:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.