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.
So connect it as the shown in the ECG example:
And next add the motor wiring leaving out the potentiometer. So leave the wires from the first circuit and ADD these:
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. 😊
Lubuntu A Ubuntu variant aimed at being small and fast. Love it!
PDFCreator Ultimate tool for Windows users: Print ANYTHING you can print to a PDF with this FREE printer driver.
XKPassword Super practical website for those who need to generate one or a list of passwords based on words (more secure).
SpeedOf.me Test the speed of your Internet connection
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.
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.18-macOS-x86-64.dmgDate: 2024-04-24 - Size: 3.5 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Intel version which works on Intel and Apple Silicon Macs.
ConnectMeNow4-v4.0.18-macOS-arm64.dmgDate: 2024-04-24 - Size: 3 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Apple Silicon version (not suitable for Intel).
MiniWOL2 MacOS (64 bits Apple Silicon)Date: 2023-08-01 - Size: 1.2 MBminiWol is a simple, but effective application to send Wake On LAN to network devices. This is the signed 64 bit MacOS ARM (Apple Silicon) version.
MovieScanner2-2.2.3-Windows-32bit-setup.exeDate: 2023-04-12 - Size: 18.6 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 32 bit Windows version.
MovieScanner2-2.2.2-Linux-GTK-64bits.tar.gzDate: 2023-04-11 - Size: 29.2 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for GTK.
MovieScanner2-2.2.2-Linux-QT5-64bits.tar.gzDate: 2023-04-11 - Size: 29.1 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for QT5.
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).