Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
hi everyone, I'm a newbie with Arduino and in desperate need for help! I study industrial design and am working on a project where I want to have a little engine with a counterweight (like you find in electric toothbrushes, vibrators...) be controlled by the signals read by this ecg module: https://how2electronics.com/ecg-monitoring-with-ad8232-ecg-sensor-arduino/
both of those setups work fine for themselves, and since I had the manual and all the information it was easy even for me to get everything running. But since my knowledge doesn't go any further than that, I am a bit lost now. How do I have to connect the hardware, and how do I re-write the code to get it to work? I've been copy-pasting the codes on the websites posted above.
Hopefully this post describes well enough what I'm trying to do. I'd be happy to answer any more questions or show some pics of what I've got so far. Any help would be greatly appreciated!
Unfortunately, I have no experience with either. Looking at both projects though, I do not see a conflict in wiring - well, except for the potentiometer. You can leave that one out since you're using the ECG data instead.
Combining code (without modifying anything - and both functions work as before) should not be a problem either.
This could look something like this, where I presume you'd want the ECG data to be used as an input for the motor.
#define PWM 3
int pot;
int out;
void setup() {
// initialize the serial communication:
Serial.begin(9600);
pinMode(10, INPUT); // Setup for leads off detection LO +
pinMode(11, INPUT); // Setup for leads off detection LO -
pinMode(PWM,OUTPUT);
}
void loop() {
pot=analogRead(A0);
if((digitalRead(10) == 1)||(digitalRead(11) == 1)){
Serial.println('!');
} else{
// send the value of analog input 0:
Serial.println(pot);
}
out=map(pot,0,1023,0,255);
analogWrite(PWM,out);
delay(1); // may longer be needed
}
Â
Note: I do not have any of these components and I have zero experience with these either. So the code is untested. But I'm confident this will get you close to what you may have had in mind. 😊Â
WhyNoPadLock Test your website and discover why the green padlock is not appearing when using HTTPS
AlternativeTo Great resource when you're looking for alternatives for an application that you'd like to use, but might not be available on your platform or the application you have is just not doing it right.
IcoMoon Ultimate place to create your own icon fonts, with existing icons and/or your own designs, for your computer or webpage, ... for free.
VueScan Ultimate scanning tool for Windows, Linux, and macOS, supporting pretty much any scanner, even those no longer supported by your OS. (no scanner drivers needed!)
WinRAR My favorite file compression/decompression tool. Fast, efficient, and support quite a lot of formats. Unfortunately ... NOT free.
Links Page These and more of our favorite links can be found on the Links Page.
New Downloads
ConnectMeNow4-v4.0.19-beta-macOS-Universal.dmgDate: 2026-03-08 - Size: 5.7 MBVersion 4 of ConnectMeNow Beta Releasse - A tool for more convenient mounting of network shares under macOS. This is the Apple Silicon version (not suitable for Intel).
squirclenomore-v1.0.3-macos.dmgDate: 2026-01-20 - Size: 5.5 MBmacOS Tahoe applies a very ugly Squircle jail to application icons - SquircleNoMore removes these and resets the normal application icon.
RenameMyTVSeries-2.3.15-Windows-x64-setup.exeDate: 2025-12-14 - Size: 49.1 MBRename My TV Series, for Windows (Intel 64 bit), a tool to assist in renaming TV Show episode files. Static builds of ffmpeg and ffprobe are included.
RenameMyTVSeries-2.3.12-GTK-Linux-x64-static-ffmpeg.tar.xzDate: 2025-10-06 - Size: 78.3 MBRename My TV Series, for Linux (64 bit GTK), a tool to assist in renaming TV Show episode files. This bundle comes with (large) static builds of ffmpeg and ffprobe.
RenameMyTVSeries-2.3.12-QT5-Linux-x64-static-ffmpeg.tar.xzDate: 2025-09-28 - Size: 78.3 MBRename My TV Series, for Linux (64 bit QT5), a tool to assist in renaming TV Show episode files. This bundle comews with rather large static builds of ffmpeg and ffprobe.
Downloads Page Find these and more Downloads on the Downloads Page, where you will also find articles references, operating system requirements and categories.
Amazon Ads
Support us by doing your shopping at Amazon.com, either click the link, or click one of the links below …
You can also sponsor us through these Amazon offerings:
Please consider disabling your ad blocker for our website.We rely on these ads to be able to run our website.You can of course support us in other ways (see Support Us on the left).